Can anyone tell me how to get this darn function to work!!!
Hardly an advanced question, but here it goes:
/* create empty images to work with */ unsigned char image[128][128][4]; unsigned char subimage[32][32][4]; /* make a 128x128 texture from the first image */ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 128, 128, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); /* modify the texture with the 32x32 subimage starting at 64,64 */ glTexSubImage2D(GL_TEXTURE_2D, 0, 64, 64, 32, 32, GL_RGBA, GL_UNSIGNED_BYTE, subimage);
[This message has been edited by kansler (edited 02-11-2004).]
Man! Thats stupid, I thought the darn thing ripped a sub image from the existing texture! Oh man, now i gotta rely on texture coords to get a sub image.