Next | Prev | Up | Top | Contents | Index

Using Texture Color Tables

To use a texture color table, define a color table, as described in "The Color Table Extension". Use GL_TEXTURE_COLOR_TABLE_SGI as the value for the target parameter of the various commands, keeping in mind the following points:

The following code fragment loads a table that inverts a texture. It uses a GL_LUMINANCE external format table to make identical R, G, and B mappings.

loadinversetable()
{    
    static unsigned char table[256];
    int i;

    for (i = 0; i < 256; i++) {
        table[i] = 255-i; 
    }

    glColorTableSGI(GL_TEXTURE_COLOR_TABLE_SGI, GL_RGBA8_EXT, 
                    256, GL_LUMINANCE, GL_UNSIGNED_BYTE, table);
    glEnable(GL_TEXTURE_COLOR_TABLE_SGI);
}

Next | Prev | Up | Top | Contents | Index