I am trying to texture map a quad in opengl es . But it doesn’t seem to texture map at all. Is there something that needs to be done differently than in regular opengl ?
I am sorry, that was done in Init(). I’ll post the complete code here. I just get a white quad. But I do image info into image_data. Also the image is 5=64x64 (24bits). Hence I am wondering what could be causing this. Also I am on linux so I am using opengl es 1.0.
OK, the problem is with glTexImage2D this uploads the texture into the currently bound texture. Even though you have generated an ID with glGenTextures you are not binding that ID prior to uploading your texture data. So after the glGenTextures add :
glBindTexture(GL_TEXTURE_2D, texture[0]);
This will make sure the texture data gets uploaded into the correct texture. Most likely your data is being uploaded into the default initial texture, and your specific texture remains empty.