Error with glTexCoordPointer

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

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

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!!

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.

Thats it. Now i have to find the error else where.
THANKS!!!