PDA

View Full Version : Error with glTexCoordPointer



guju
06-16-2002, 07:44 PM
Hi !
I used the following:
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glBindTexture( GL_TEXTURE_1D, texResult );
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(1, GL_FLOAT, 0, result_damage);
glEnableClientState (GL_VERTEX_ARRAY);
glVertexPointer (3, GL_FLOAT, 0, vertices);
glDrawElements (GL_QUADS, numQuads*4, GL_UNSIGNED_INT, elements_quad);
and i always get the error "invalid Value". But my size is 1! The values in result_damage are between 0.0 and 1.0
Thanks

Zeno
06-18-2002, 04:01 PM
Your code looks ok to me. After which line do you get the invalid value? Are you getting this error from OpenGL or somewhere else?

-- Zeno

guju
06-18-2002, 09:38 PM
I get the error in this line:
glTexCoordPointer(1, GL_FLOAT, 0, result_damage);
if((errCode=glGetError())!=GL_NO_ERROR){
errString=gluErrorString(errCode);
}
I only get the error once. Then it workes fine!!

JML
06-18-2002, 10:25 PM
Make sure the glGetError is not returning an error from a previous gl command. Place a glGetError() before the glTexCoordPointer to make sure the error flag is cleared before calling glTexCoordPointer.

HTH

Jean-Marc.

guju
06-18-2002, 10:34 PM
Thats it. Now i have to find the error else where.
THANKS!!!