PDA

View Full Version : glBindTexture issues



Mordoch Bob
02-23-2002, 10:56 AM
I have a program that gives crashes with the "0xc0...05 Access Violation" whenever I make a call to glBindTexture at a certain point in the program. It is important to note that glBindTexture is called twice in the program, and even if one comments out the first call, the second one always works. The only thing that I understand could be wrong is that the identifier is 0 or <0, but given that I use glGenTextures that shouldn't be the case. So, has anyone else experienced something like this, or if not at least know the cause of what is happening? Any and all replies are welcome.

02-23-2002, 02:04 PM
I just had the exact same problem today working on my project for Computer Graphics.

The first thing I'd do is make sure you are not trying to load a texture that doesn't exist. If you are using a loop, make sure it doesn't loop one extra time. That would cause the problem.

Try running your program through a debugger and insert breakpoints into the loadtexture function. You'll have a better idea of what's happening when it crashes.

Questions Burner
02-25-2002, 09:09 AM
I think the error come from glTexImage2D.

chxfryer
02-25-2002, 09:22 AM
Make sure its NOT in a glBegin(blah)-glEnd(). I dont think that works