Strange glBindTexture Problem!

Started by
2 comments, last by b1llz 20 years, 11 months ago
Hi, Im having a strange problem. In a simple program, when I call glBindTexture while getting the texture id in a global variable, if I do not call glEnable(GL_TEXTURE_2D) then, and instead I call it while actually rendering the model (e.g.) in a function like renderModel(), just before glVertex3f() and glTexCoord2f(), nothing happens. Means that the call glEnable(GL_TEXTURE_2D) isnt having any effect whatsoever when called in this particular function, even though its a global function just as the initialization function where the texture is actually created (as mentioned above). I have absolutely no idea why this is happening. Similarly, when in each frame, I render the whole world (and thus bind many textures) and when in the next frame, I render the model and try to bind its own texture id in OpenGL, it somehow doesnt have any effect and it renders the model with the last texture bound (the one it bound while rendering the world). I would really appreciate if someone could help me. Thanks, On a long enough time line, the survival rate drops to zero.
On a long enough time line, the survival rate drops to zero.
Advertisement
hi,

could you post the code?
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
Are you calling it between a Begin/End pair?

The PAIN is coming...this summer!!!In cinemas everywhere.
quote:Original post by Mihail121
Are you calling it between a Begin/End pair?

The PAIN is coming...this summer!!!In cinemas everywhere.


Unfortunately yes...I was doin this and thus soon after posting here on forums, I found out how stupid the bug was..and now its removed. I wasted quite a lot of time debugging it. It''s intelligent of you to guess the problem rightaway. Thanks for the help anyway.

cheers


On a long enough time line, the survival rate drops to zero.
On a long enough time line, the survival rate drops to zero.

This topic is closed to new replies.

Advertisement