OpenGL and MFC

Started by
0 comments, last by Bagpuss 21 years, 1 month ago
OK, I have been posting in here for the last few weeks about problems with NT and OpenGL. I had and MFC project that used to work on a win 98 PC. This I managed to lose, and then I was sent away on business with a works Laptop, so in my spare time I recreated it (or so I thought) on the Laptop. The framework is very simple, it draws a few lines, (in orthographic) and then draws a few textures on 64 * 64 tiles. No matter what I do, all my textures appear as blue (which is the colour of the last line drawn), but only the White areas of the Textures are drawn in the blue colour, the rest is black. (or transparent I suppose). Can anyone shed any light on this problem, or even supply me with some code or bitmaps that they know definitely work (MFC code please if possible, I want to reproduce as much of my system to analyse the faults) on my NT machine. As an aside, I got home the other weekend, and ran the new code on my desktop, and no joy there, I get the same problem, so I don''t believe it is an NT issue. I only want to get a basic framework, I''ll butcher it to my own needs from there, but if anyone can shed some light or effer the framework, then I''ll but you as many drinks as you like if I ever meet you Thanks, Bp
Advertisement
I had a similar problem myself sometime ago. My mistake was that the GL texture env mode was set to GL_MODULATE but should have been GL_DECAL.

To resolve this, just use

glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);

See the Docs (e.g. MSDN Library) of glTexEnv* for the differences.

If, however, GL_MODULATE is what you wanted in the first place, e.g. to do proper alphablending, you should set the current material to a white one, which prevents the fragments from getting blue.

Tilmann

Ok, now I am really looking forward to the drinks part! :D

This topic is closed to new replies.

Advertisement