PDA

View Full Version : glDrawElements + glEnable(GL_TEXTURE_2D), no glTexCoordPointer



ingramb
01-18-2007, 07:14 PM
I'm working with a large existing engine (that I didn't write), and at a certain point in the code, the following occurs on one of the texture units:

glEnable(GL_TEXTURE_2D) is set
glEnableClientState(GL_VERTEX_ARRAY) is set
glDrawElements() is called
glEnableClientState(GL_TEXTURE_COORD_ARRAY) is NOT set
glEnable(GL_TEXGEN_S/T) is NOT set

This is technically valid as far as I know; I think gl will just use the last coordinates set by glTexCoord for each vertex that is drawn. But this won't give useful results will it? Is there any good reason for the above state to be set, or is the engine just being stupid?

k_szczech
01-19-2007, 12:47 AM
Is there any good reason for the above state to be set, or is the engine just being stupid?Could be that there is a shader active that computes texture coordinates.

Did you use glIsEnabled or did you just inspect the code?

ingramb
01-19-2007, 08:45 AM
There are no shaders. I'm working with a version of opengl that I have the source code to, so I can just look at the internal state in the debugger when glDrawElements is called.

It's possible that the problem lies in the opengl implementation as well. I'd just like the verify that there is a problem before I spend too much time trying to track it down.