Advertisement

glGenTextures not working

Started by August 26, 2002 10:49 PM
4 comments, last by DanG 22 years, 4 months ago
I am writing some texture loading code and for some reason glGenTextures is not working. THe code is this ... GLuint m_uiTexID; ... m_uiTexID = 0; ... glGenTextures(1, &m_uiTexID); ... m_uiTexID still has value 0. I checked it through the debugger and just before the call, m_uiTexID is 0 and immediately after it is still 0. I have seen what looks like the same code on NEHE and it works fine. Why won''t it give me the unused texture ID. I''m positive that I''m not using them all. What could be wrong?
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
Did you initialize OpenGL before trying to generate
texture ID? What does glGetError() return?



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
Advertisement
glGetError returns 1282 which is GL_INVALID_OPERATION, which according to documentation means glGenTextures was called between glBegin and glEnd. This is ludicrous. at this point in the code these two functions have yet to be called. As to is OpenGL "intialized", what do you mean?
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
Well, you have to set up the OpenGL context before you
can call any OpenGL functions. For instance, if you
use GLUT, you''d call glutInit() and glutCreateWindow()...etc.
If you use Win32, you''d call wglCreateContext()...etc.



Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I had the intializeation and loading of textures before the window making code.

The glGenTextures wasn''t the only problem by the way, all my OGL code was screwed up.
Ambassador: Mr. Bush are you stoned or just really, REALLY dumb?Pres. Bush - I assure you I am not stoned.
Thanks !!!!
I forgot to do that too...

This topic is closed to new replies.

Advertisement