glGetColorTableParameterfvEXT, glGetColorTableParameterivEXT

The glGetColorTableParameterfvEXT and glGetColorTableParameterivEXT functions get palette parameters from color tables.

void glGetColorTableParameterfvEXT(
  GLenum target,
  GLenum pname,
  GLint *params

void glGetColorTableParameterivEXT(
  GLenum target,
  GLenum pname,
  GLint *params


The target texture of the palette for which you want parameter data. Must be TEXTURE_1D, TEXTURE_2D, PROXY_TEXTURE_1D, or PROXY_TEXTURE_2D.
A symbolic constant for the type of palette parameter data pointed to by params.

The following table summarizes the meaning of the valid constants for the pname parameter.

Constant Meaning
GL_COLOR_TABLE_FORMAT_EXT Return the internal format specified by the most recent call to glColorTableEXT or the default value.
GL_COLOR_TABLE_WIDTH_EXT Return the width of the current palette.
GL_COLOR_TABLE_RED_SIZE_EXT Return the actual size used internally to store the red component of the palette data.
GL_COLOR_TABLE_GREEN_SIZE_EXT Return the actual size used internally to store the green component of the palette data.
GL_COLOR_TABLE_BLUE_SIZE_EXT Return the actual size used internally to store the blue component of the palette data.
GL_COLOR_TABLE_ALPHA_SIZE_EXT Return the actual size used internally to store the alpha component of the palette data.

Points to the color table parameter data specified by the pname parameter.


You use the glGetColorTableParameterivEXT and glGetColorTableParameterfvEXT functions to retrieve specific parameter data from color tables set with glColorTableEXT for targeted texture palettes. Also you can use these functions to determine the number of color table entries that glGetColorTableEXT returns.

When the target parameter is GL_PROXY_TEXTURE_1D or GL_PROXY_TEXTURE_2D, and the implementation does not support the values specified for either format or width, glColorTableEXT can fail to create the requested color table. In this case, the color table is empty and all parameters retrieved will be zero. You can determine whether OpenGL supports a particular color table format and size by calling glColorTableEXT with a proxy target, and then calling glGetColorTableParameterivEXT or glGetColorTableParameterfvEXT to determine whether the width parameter matches that set by glColorTableEXT. If the retrieved width is zero, the color table request by glColorTable failed. If the retrieved width is not zero, you can call glColorTable with the real target with TEXTURE_1D or TEXTURE_2D to set the color table.

Note  The glGetColorTableParameterivEXT and glGetColorTableParameterfvEXT functions are extension functions that are not part of the standard OpenGL library but are part of the GL_EXT_paletted_texture extension. To check whether your implementation of OpenGL supports glGetColorTableParameterivEXT and glGetColorTableParameterfvEXT, call glGetString(GL_EXTENSIONS). If it returns GL_EXT_paletted_texture, glGetColorTableParameterivEXT and glGetColorTableParameterfvEXT are supported. To obtain the function address of an extension function, call wglGetProcAddress.

Error Codes

The following are the error codes generated and their conditions.

Error code Condition
GL_INVALID_ENUM target or pname was not an accepted value.
GL_INVALID_OPERATION glGetColorTableParameterivEXT or glGetColorTableParameterfvEXT was called between glBegin and glEnd pairs.


  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Gl.h.
  Library: Use Opengl32.lib.

See Also

glColorSubTableEXT, glColorTableEXT, glGetColorTableEXT, wglGetProcAddress


Community Additions