Trouble porting OpenGL code to iPhone's OpenGL ES

Hi friends,
I am new to OpenGL…

Here, is the sample code which I am using. This code is in OpenGL. I want to convert it to OpenGL ES. glArrayElement() is not supported in OpenGL ES. Instead, it was recommended to use glDrawElements(), glDrawArrays(). I am not able to convert this. Can you please help me out to convert the code.

glTexCoordPointer(2,GL_FLOAT,sizeof(struct texcoord),tex);
glColorPointer(4,GL_UNSIGNED_BYTE,4,col);
glNormalPointer(GL_FLOAT,sizeof(vector),wet->n);
glVertexPointer(2,GL_FLOAT,sizeof(struct vertexcoord),vert);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glLockArraysEXT(0,wet->w*wet->h);
i=0;
for(int y=0;y<wet->h-1;y++)
{
glBegin(GL_TRIANGLE_STRIP);
for(int x=0;x<wet->w;x++)
{
glArrayElement(i);
glArrayElement(i+wet->w);
i++;
}
glEnd();
}
glUnlockArraysEXT();

And one more question is do we have any replacement for glEnable(GL_TEXTURE_RECTANGLE_EXT) in OpenGL ES.

Thanks in advance
Vamshi

viewtopic.php?f=13&t=1616

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.