Hello.
I have a question for rectangle texture and paletted texture.
I can draw 64x64 texture using EXT_paletted_texture and EXT_shared_texture_palette.
Then, I want to draw none-power-of-two-texutre.
When I use GL_TEXTURE_RECTANGLE_NV instead of GL_TEXTURE_2D and change tex-coord from [0,1] to [0,width(height)] , I can’t draw any Texture.
Please teach me EXT_texture_rectangle support Paletted Texture , or not?
const int w = 64;
const int h = 64;GLubyte TexImage[ w * h ];
GLubyte TexPalette[ 256 * 4 ];
GLuint TexID;( Create Texture Data )
glGenTextures( 1 , &TexID );
glEnable( GL_TEXTURE_RECTANGLE_NV );
glBindTexture( GL_TEXTURE_RECTANGLE_NV , TexID );
glTexImage2D( GL_TEXTURE_RECTANGLE_NV , 0 , GL_COLOR_INDEX8_EXT , w , h , 0 , GL_COLOR_INDEX , GL_UNSIGNED_BYTE , TexImage );( Create Palette Data )
glEnable( GL_SHARED_TEXTURE_PALETTE_EXT );
glEnable( GL_TEXTURE_RECTANGLE_NV );
glColorTableEXT( GL_SHARED_TEXTURE_PALETTE_EXT , GL_RGBA , 256 , GL_RGBA , GL_UNSIGNED_BYTE , TexPalette );glEnable( GL_TEXTURE_RECTANGLE_NV );
glBindTexture( GL_TEXTURE_RECTANGLE_NV , TexID );
glBegin( GL_QUADS );
glTexCoord2f( 0,0 );
glVertex2f( -1,-1 );
glTexCoord2f( w,0 );
glVertex2f( 1,-1 );
glTexCoord2f( w,h );
glVertex2f( 1,1 );
glTexCoord2f( 0,h );
glVertex2f( -1,1 );
glEnd();