Given the excerpt of your code you've posted, you're missing calls to (at least) glEnableClientState( GL_VERTEX_ARRAY ) and glColorPointer; additionally, man glVertexPointer reports that that function does not support GL_UNSIGNED_BYTE.

I didn't found anything helpful on texture mapping related to glVertexPointer.
Instead I made some loops to fill an array with all the coordonates of all the points but glDrawArrays doesn't draw it right.

Really? The first result for searching for OpenGL ES texture mapping tutorial seems to be an adequate introduction to texture mapping – it is for iOS (and I think I remember from another thread that you're using Windows), but almost all of the source code in the tutorial is still relevant to cross-platform OpenGL ES...

Looks like you're enabling GL_COLOR_ARRAY, but not calling glColorPointer before drawing. For each array that's enabled, whatever value the pointer is set to will be dereferenced, and if you haven't specified one it'll most likely crash.

Also, you want to load the texture (by calling glTexImage2D) only when you create the texture. In other words, gen, bind, teximage, then loop. The only reason you would want to do that is if you are changing the pixels of the texture every frame on the CPU too.

I removed glColorPointer and now it doesn't crash anymore.Now I'm getting a blank white screen,is there anything else to be done for the texture to show up?
And yes the pixels of the texture will change every frame.

EDIT:
I've put this after glBindTexture:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
and this after glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
now the texture appears but I'm getting a really low frame rate

(Dec 20, 2012 04:06 AM)dotbianry Wrote: And yes the pixels of the texture will change every frame.

Could you elaborate on what it is you're trying to achieve?

If you're trying to show an animation, I'd suggest you combine the multiple frames of the animation into a texture (rather than create a texture for every frame of the animation or, worse, change the texture data every frame), a technique known as using a texture atlas.

I'm trying to make a 3D engine with software rendering.
From OpenGL I only need to send the frame , rendered offscreen to the video memory,and I'm hoping the transfer is fast enough to achieve a playable frame rate.

In that case you'll want to try using glTexSubImage() instead. It's supposed to be faster than creating a new texture object using glTexImage2D(), but don't quote me on it. That might not be true anymore for full texture refreshes.