PDA

View Full Version : Problems with textures



markl
05-15-2000, 09:58 AM
Hi,

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

Frank
08-02-2000, 09:38 PM
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,

Frank

markl
08-03-2000, 08:12 AM
Hallo Frank,

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

regards Patrick