GL_EXT_shared_texture_palette

GL_EXT_shared_texture_palette:

Ok, I’ve had this topic in the beginners forum for more than a week now and no one seems to know there, so does anyone here know how to use this extension?
actual source would be great

thanks

Firstly, the spec is all you need to understand the extension. Grab it from http://oss.sgi.com/projects/ogl-sample/registry/

As for source code using the extension, I think it’s probably one of the easiest, if not the easiest, extensions out there (compared to monsters like ARB_vertex_program).
When you call glEnable(GL_SHARED_TEXTURE_PALETTE_EXT) the shared texture palette is used instead of the per-texture object palette. Calling glDisable will disable this again. It’s as simple as that

Edit: Fixed two typos.

[This message has been edited by Asgard (edited 11-12-2002).]

so as I understand you, once you call
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT), in your render loop you can say

glColorSubTable(…)
draw all objects needing that palette
glColorSubTable(…)
draw all objects needing that palette

is this correct or do you have to define which textures use which palette at load time or something?

so as I understand you, once you call
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT), in your render loop you can say

That glEnable just switches the texture palette to be the shared texture palette.

is this correct or do you have to define which textures use which palette at load time or something?

I don’t really know what you want to do exactly. Palettes as defined in EXT_paletted_textures are per-texture object state. The shared palette can be used to quickly change the palette for more textures that use the same palette (that is, the shared palette) at once.

To change the shared palette, pass in GL_SHARED_TEXTURE_PALETTE_EXT as target parameter to the glColorTable routines.

[This message has been edited by Asgard (edited 11-12-2002).]

thanks! I’ll try some stuff out and post back with my results later.

Yes! it works! Thanks so much
The effect is spectacular, I can e-mail it to you if you want. Just tell me if you do.