Problems with textures


i’m writing an mfc programm which loads
bitmaps to show them in a dialogbox.
My problem is, that the call to glGenTextures
fails and glGetError returns GL_INVALID_OPERATION. The SDK says that this error occurs if glGenTextures is called between glBegin and glEnd. But i’m pretty sure that the call to glGenTextures is not between glBegin and glEnd, because after closing the file open dialog i first redraw
all windows and call the texture loading function after that.
Has anyone an idea why glGenTextures doesn’t work?
Thanks in advance

Patrick Markl

I faced the same problem a couple of days before. The solution is quite simple: You have to provide a valid rendering context first. e.g. wglMakeCurrent( hDC, hRC ). Then glGenTextures works.

Hope this helps,


Hallo Frank,

thank you. This was my problem, but i figured it out.

regards Patrick