PDA

View Full Version : GL_EXT_paletted_texture



Sylvain
09-23-2000, 12:37 PM
Hello i am trying to use GL_EXT_paletted_texture..
of course i can't understand the problem http://www.opengl.org/discussion_boards/ubb/smile.gif

here's my sequence:

glPixelStorei(GL_UNPACK_ALIGNMENT,1);
glGenTextures(1,&texName);

glBindTexture(GL_TEXTURE_2D,texName);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, tilingStates[pBitmap->u]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, tilingStates[pBitmap->v]);

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R, filteringStates[pBitmap->mag]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R, filteringStates[pBitmap->min]);

glColorTableEXT(GL_TEXTURE_2D,GL_COLOR_INDEX8_EXT, 256,3,GL_UNSIGNED_BYTE,pic->Infos.pPalette);

glTexImage2D(GL_PROXY_TEXTURE_2D,0,GL_COLOR_INDEX, w,h,0,1,GL_UNSIGNED_BYTE,pic->Infos.pData);


Any idea??? Anyway i haven't found any samples @Nvidia concerning paletted textures... where can i find some??

thanks..

Pauly
09-23-2000, 04:27 PM
What happens?

My tga loader can use paletted textures: http://home.clara.net/paulyg/ogl.htm

Sylvain
09-24-2000, 01:34 AM
OK thanks Paul.. the right sequence is:

glColorTableEXT(GL_TEXTURE_2D,GL_RGB,256,GL_RGB,GL _UNSIGNED_BYTE,pic->Infos.pPalette);
glTexImage2D(GL_TEXTURE_2D,0,GL_COLOR_INDEX8_EXT,w ,h,0,GL_COLOR_INDEX,GL_UNSIGNED_BYTE,pic->Infos.pData);

bye