Skip to main content
gamedev.net
🔒 Locked

glBindTexture

Started by Lucifero 5 replies 500+ views
Original Post
Lucifero
Lucifero
Hi to all, I''ve some problems with textures... My program run properly for some seconds, displaying all the textures correctly, then it crashes... My code looks like this: /* Drawing function */ ... GLuint _texture; for(count=0; count < numTri; count++) { _texture = myModel[count].getTexture(); glBindTexture(GL_TEXTURE_2D, _texture); ... } If I comment the glBindTexture(GL_TEXTURE_2D, _texture) line it''s all fine, so what''s the problem? Do I have to uBind the textures?
Lucifero
Lucifero
I tried, but the whole computer crashes, forcing me to reset it... =((
Poontardis
Poontardis
Does the frame rate of your app decrease until it crashes?

What''s a typical value of NumTri?
Lucifero
Lucifero
The frame rate is quite constant till crash happens
The typical value of numTri is about 5000

I commented the glBindTexture function and monitored the _texture variable. After some cycles it receive some spurious values like: -1090434783 (it happened also with a numTri of 12)
I think it would cause the crash if passed to glBindTexture.
It seems that there are some pointer errors, even if controlled the code about 10000 times...

I use the Dev-C++ 4.0 IDE, is it a good one? Is Visual C++ better?
The Phantom
The Phantom
I don''t think it''s an Editor issue.. it seams that some how you are overwriting the section of memory to do with the mymodel array.... with out see the rest of the code however that''s just my best guess

As for which IDE is better everyone is gonna have their own view, I like VC++ 6.. but mainly coz I got it cheap

=============
Phantom
''''Things can''''t get any worse..''''
They did...
=============Phantom''Things can''t get any worse..''They did...
Lucifero
Lucifero
Changed computer, and the problem disappeared (I''ve not changed a single line of code)
Maybe bad drivers versions?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.