Archived

This topic is now archived and is closed to further replies.

b1llz

Strange glBindTexture Problem!

Recommended Posts

b1llz    122
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.

Share this post


Link to post
Share on other sites
b1llz    122
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.

Share this post


Link to post
Share on other sites