Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP's Implementation of OpenGL: HP 9000 Workstations > Chapter 2 Overview of OpenGL

OpenGL Extensions

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

The extensions listed in this section are in addition to those described in the OpenGL Programming Guide, OpenGL Reference Manual, and OpenGL Programming for the X Window System.

Clamp Border and Clamp Edge Extensions

Texture clamp extensions provide techniques to either clamp to the edge texels or border texels even when using a filter that uses linear filtering. Nearest filtering always just selects one of the texels from the texture map. But when using linear filtering, whether from the minification or magnification filters, the filtered texels can be an average of texels from both the texture map and the texture border. To only use the texture map texels when clamping, use the clamp edge extension. To allow the selection of border texels when clamping, use the clamp border extension.

Table 2-6 Clamp Border and Clamp Edge Extensions

Extended Area

Enumerated Types

Description

Wrap Modes

GL_CLAMP_TO_BORDER_EXT default: GL_REPEAT

When this enumerated type is passed into glTexParameter, it will clamp to the border of the mip level.

Wrap Modes

GL_CLAMP_TO_EDGE_EXT default: GL_REPEAT

When this enumerated type is passed into glTexParameter, it will clamp to the edge of the mip level.

 

To use clamp border extension, substitute GL_CLAMP_TO_BORDER_EXT for the param in glTexParameter. To use clamp edge extension, substitute GL_CLAMP_TO_EDGE_EXT for the param in glTexParameter.

Code fragments and results:

   float BorderColor[4];
BorderColor[0] = 0.0; /* Red */
BorderColor[1] = 0.0; /* Green */
BorderColor[2] = 1.0; /* Blue */
BorderColor[3] = 1.0; /* Alpha */
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, BorderColor);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

Figure 2-1 Repeat Wrap Mode

Repeat Wrap Mode
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

Figure 2-2 Clamp Wrap Mode

Clamp Wrap Mode
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE_EXT);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE_EXT);

Figure 2-3 Clamp to Edge Wrap Mode

Clamp to Edge Wrap Mode
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER_EXT);
glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER_EXT);

Figure 2-4 Clamp to Border Wrap Mode

Clamp to Border Wrap Mode

For related information, see the function glTexParameter.

3D Texture Extension

The 3D texture extension is useful for volumetric rendering of solid surfaces such as a marble vase or for rendering images where geometric alignment is important, such as an MRI medical image. For this extension, the texture maps have width and height as they did for 2D and also an additional depth dimension not included in 2D. The third coordinate forms a right handed coordinate system which is illustrated in Figure 1-5.

Figure 2-5 Right Handed Coordinate System for 3D Texturing

Right Handed Coordinate System for 3D Texturing

Each mipmap level consists of a block of data, see Figure 1-6. Each mipmap level of the texture map is treated as being arranged in a sequence of adjacent rectangles. Each rectangle is a 2-dimensional image. So each mip level is a (2^m+2b)\\times(2^n+2b)\\times(2^l+2b) block where b is a border width of either 0 or 1, and m, n and l are non-negative integers.

Figure 2-6 Each Mipmap is a Block in 3D Texturing

Each Mipmap is a Block in 3D Texturing

Figure 2-7 GL_LINEAR_MIPMAP_LINEAR Filtering May Use Two Blocks

GL_LINEAR_MIPMAP_LINEAR Filtering May Use Two Blocks

Table 2-7 Enumerated Types for 3D Texturing

Extended Area

Enumerated Types

Description

Pixel Storage

GL_[UN]PACK_IMAGE_HEIGHT_EXT default: 0 for each

The height of the image from which the texture is created; it supercedes the value of the height passed into glTexImage3DEXT.

Pixel Storage

GL_[UN]PACK_SKIP_IMAGES_EXT default: 0 for each

The initial skip of contiguous rectangles of the texture.

Texture Wrap Modes

GL_TEXTURE_WRAP_R_EXT default: GL_REPEAT

The wrap mode applied to the r texture coordinate

Enable/Disable

GL_TEXTURE_3D_EXT default: Disabled

The method to enable/disable 3D texturing.

Get Formats

GL_MAX_3D_TEXTURE_SIZE_EXT, GL_TEXTURE_BINDING_3D_EXT default: N/A

The maximum size of the 3D texture allowed; bind query.

Proxy

GL_PROXY_TEXTURE_3D_EXT default: N/A

The proxy texture that can be used to query the configurations.

 

Steps for 3D Texturing Programming

To use the 3D texture extension (see sample program below), do the following steps.

  1. Enable the 3D texture extension using glEnable(GL_TEXTURE_3D_EXT),

  2. Create a 3D texture using glTexImage3DEXT

  3. Specify or generate the s, t and r texture coordinates using glTexGen or glTexCoord3*

  4. Specify other parameters such as filters just as you would for 2D texturing, but use GL_TEXTURE_3D_EXT for the target.

3D Texture Program Fragments

This program draws four layers in the base mipmap level, and a diagonal slice through the base mipmap level.

/* Allocate texture levels separately, then concat to get a 3D texture. */

GLubyte texture1[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture2[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture3[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte texture4[TEXTURE_WIDTH][TEXTURE_HEIGHT][4];
GLubyte textureConcat[TEXTURE_DEPTH][TEXTURE_WIDTH][TEXTURE_HEIGHT][4];

/* The checkerPattern procedure fills a texture with width, height with
a period of Checker_period alternating between firstColor and
secondColor, Texture should be declared prior to calling checkerPattern. */

static void checkerPattern(int width, int height, GLubyte *firstColor,
GLubyte *secondColor, GLubyte *texture,
int Checker_period) {

int texelX, texelY;
int index, fromIndex;
GLubyte *p = texture;
index = 0;

for (texelY = 0; texelY < height; texelY++) {
for (texelX = 0; texelX < width; texelX++) {
if (((texelX/Checker_period) % 2) ^ ((texelY/Checker_period) % 2)) {
*p++ = firstColor[0]; /* red */
*p++ = firstColor[1]; /* green */
*p++ = firstColor[2]; /* blue */
*p++ = firstColor[3]; /* alpha */
} else {
*p++ = secondColor[0]; /* red */
*p++ = secondColor[1]; /* green */
*p++ = secondColor[2]; /* blue */
*p++ = secondColor[3]; /* alpha */
}
}
}
GLubyte blackRGBA[] = {0.0, 0.0, 0.0, 255.0};
GLubyte whiteRGBA[] = {255.0, 255.0, 255.0, 255.0};
GLubyte redRGBA[] = {255.0, 0.0, 0.0, 255.0};
GLubyte greenRGBA[] = {0.0, 255.0, 0.0, 255.0};
GLubyte blueRGBA[] = {0.0, 0.0, 255.0, 255.0};
GLubyte yellowRGBA[]= {255.0, 255.0, 0.0, 255.0};
GLubyte purpleRGBA[]= {255.0, 0.0, 255.0, 255.0};
GLubyte cyanRGBA[]= {0.0, 255.0, 255.0, 255.0};
GLubyte greyRGBA[] = {125.0, 125.0, 125.0, 255.0};

main (int argc, char *argv[]) {
/* Open window for displaying */
Put your favorite code here to open an window and perform perspective setup

glEnable(GL_TEXTURE_3D_EXT);
checkerPattern( TEXTURE_WIDTH, TEXTURE_HEIGHT, blueRGBA, whiteRGBA,
&texture1[0][0][0], 4);
checkerPattern( TEXTURE_WIDTH, TEXTURE_HEIGHT, redRGBA, yellowRGBA,
&texture2[0][0][0], 4);
checkerPattern( TEXTURE_WIDTH, TEXTURE_HEIGHT, greenRGBA, blackRGBA,
&texture3[0][0][0], 4);
checkerPattern( TEXTURE_WIDTH, TEXTURE_HEIGHT, purpleRGBA, cyanRGBA,
&texture4[0][0][0], 4);
/* create a 3D texture, textureConcat, which has a different checker
pattern at each depth */
memcpy(&textureConcat[0][0][0], texture1, sizeof(texture1));
memcpy(&textureConcat[1][0][0], texture2, sizeof(texture2));
memcpy(&textureConcat[2][0][0], texture3, sizeof(texture3));
memcpy(&textureConcat[3][0][0], texture4, sizeof(texture4));

glTexParameterf(GL_TEXTURE_3D_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameterf(GL_TEXTURE_3D_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP);

glTexParameterf(GL_TEXTURE_3D_EXT, GL_TEXTURE_WRAP_R_EXT, GL_CLAMP);
glTexParameterf(GL_TEXTURE_3D_EXT, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_3D_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexImage3DEXT(GL_TEXTURE_3D_EXT, 0, GL_RGBA, TEXTURE_WIDTH, TEXTURE_HEIGHT,
TEXTURE_DEPTH, 0, GL_RGBA, GL_UNSIGNED_BYTE, &textureConcat);
/* Fill a quad with depth of r = 0.125, passed into glTexCoord for every
vertex. */
Add your quad code here

/* Fill a quad with depth of r = 0.375, passed into glTexCoord for
every vertex. */ Add your quad code here

/* Fill a quad with depth of r = 0.625, passed into glTexCoord for
every vertex. */ Add your quad code here

/* Fill a quad with depth of r = 0.875, passed into glTexCoord for
every vertex. */ Add your quad code here

/* Now get a slice across the quad. Heres some quad code for a
sample. Make sure you have appropriate viewing perspectives. */

glBegin(GL_QUADS);
glNormal3f(0., 0., 1.);
glTexCoord3f(0.0, 0.0, 0.0);
glVertex3f(0.5, 0.5, 0.);
glNormal3f(0., 0., 1.);
glTexCoord3f(0.0, 1.0, 0.0);
glVertex3f(0.5, 62.5, 0.);
glNormal3f(0., 0., 1.);
glTexCoord3f(1.0, 1.0, 1.0);
glVertex3f(62.5, 62.5, 0.);
glNormal3f(0., 0., 1.);
glTexCoord3f(1.0, 0.0, 1.0);
glVertex3f(62.5, 0.5, 0.);
glEnd();
}

The results of code fragments are shown in Figure 1-8. This figure shows four layers in the base mipmap level, and a diagonal slice through the base mipmap level.

Figure 2-8 Results from the 3D Texture Program Fragments

Results from the 3D Texture Program Fragments

For more information on 3D texture, see the functions: glTexImage3DEXT, glTexSubImage3DEXT, glCopyTexSubImage3DEXT, glEnable, glDisable.

Shadow and Depth Extensions

The texture depth extension provides a depth texture format. This is needed to use the shadow texture extension. The shadow texture extension is used to compare the texture's r components against the corresponding texel value. Each texel is compared using user specified comparison rules. If the comparison rule passes, the fragments alpha value will be set to one by the shadow texture extension. If the comparison rule fails, the fragment's alpha value will be set to zero. The alpha test can then mask out shadowed areas using the alpha values.

When using this extension, set minification and magnification filter to either GL_NEAREST or GL_LINEAR. Mipmap minification filters of GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, and GL_LINEAR_MIPMAP_LINEAR will give indeterminate results.

Table 2-8 Enumerated Types for Shadow and Depth Texture Extension

Extended Area

Enumerated Types

Description

Texture Formats

GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT16_EXT, GL_DEPTH_COMPONENT24_EXT, GL_DEPTH_COMPONENT32_EXT
default: N/A

Texel formats which are useful when using shadow texturing.

Texture Parameter

GL_TEXTURE_COMPARE_EXT,
default: GL_FALSE

Enables comparison to the r coordinate when set to true.

Texture Parameter

GL_TEXTURE_DEPTH_EXT
default: GL_FALSE

Used to query if you have depth extension available.

Texture Parameter

GL_TEXTURE_COMPARE_OPERATOR_EXT, GL_LEQUAL_R_EXT, GL_GEQUAL_R_EXT default: GL_TEXTURE_LEQUAL_R_EXT

Sets the particular type of comparison with the r texture coordinate.

 

Steps for Shadow Texturing

  1. Set the GL_TEXTURE_COMPARE_EXT to GL_TRUE in glTexParameter

  2. Set the GL_TEXTURE_COMPARE_OPERATOR_EXT to either GL_TEXTURE_LEQUAL_R_EXT or GL_TEXTURE_GEQUAL_R_EXT using glTexParameter.

  3. Use glTexImage with GL_DEPTH_COMPONENT to fill the texture with the image which will be compared with the r coordinate.

  4. Use glTexCoord3* to set the s, t, and r texture coordinates at the vertices of the object to be rendered.

Shadow Texturing Program

This program renders a simple quadrilateral using the shadow texture extension and the alpha test.

/* Put unusual includes */

#define TEXTURE_WIDTH 256
#define TEXTURE_HEIGHT 256
GLubyte texture[TEXTURE_WIDTH][TEXTURE_HEIGHT][1];

static void checkerPattern(int width,
int height,
int Checker_period)
{
int texelX, texelY;
int index ;
index = 0;

for (texelY = 0; texelY < height; texelY++) {
for (texelX = 0; texelX < width; texelX++) {
if (((texelX/Checker_period) % 2)^((texelY/Checker_period) % 2)) {
texture[texelX][texelY][0] = (GLubyte) 0; /* depth */
} else {
texture[texelX][texelY][0] = (GLubyte) 255; /* depth */
}
}
}
}

main code fragment

/* INSERT your favorite window create and map code here */

/* Set up transforms */
glMatrixMode(GL_PROJECTION);
glLoadIdentity ();
glOrtho (-10, 130., -10., 130., 1., -1.);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity ();

glEnable(GL_DEPTH_TEST);
glEnable(GL_ALPHA_TEST);
glEnable(GL_TEXTURE_2D);
glDepthFunc(GL_LEQUAL);
glAlphaFunc(GL_GREATER, 0.5);
glClearDepth(1.0);
width = TEXTURE_WIDTH;
height = TEXTURE_HEIGHT;
checkerPattern( width,height, 64);

glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_EXT, GL_TRUE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_OPERATOR_EXT,
GL_TEXTURE_LEQUAL_R_EXT);

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16_EXT, width,
height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE,
&texture);

/* Render a red (background) and blue (primitive) checker pattern */
glClearColor(1.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_QUADS);
glTexCoord3d(0.0, 0.0, 0.0);
glVertex3f(0.5, 0.5, 0.);
glTexCoord3d(0.0, 1.0, 1.0);
glVertex3f(0.5, 106.5, 0.);
glTexCoord3d(1.0, 1.0, 1.0);
glVertex3f(106.5, 106.5, 0.);
glTexCoord3d(1.0, 0.0, 0.0);
glVertex3f(106.5, 0.5, 0.);
glEnd();

Figure 1-9 shows the results from executing the program.

Figure 2-9 Results from Shadow Texturing

Results from Shadow Texturing

For related information, see the function glTexParameter.

Texture Lighting Extension

The texture lighting extension defines a mechanism for applications to request that color originating from specular lighting be added to the fragment color after texture application. This is referred to as preLight texturing.

Table 2-9 Enumerated Types for Pre-Light Texturing

Extended area

Enumerated Types

Description

Texture Environment

GL_TEXTURE_LIGHTING_MODE_HP, GL_TEXTURE_PRE_SPECULAR_HP, GL_TEXTURE_POST_SPECULAR_HP default: N/A

pname and param parameters for glTexEnv.

 

Procedure for preLight Texturing

You need to add the following preLight texturing code fragments to the normal texturing program that also has lighting.

glTexEnv[if](GL_TEXTURE_ENV, GL_TEXTURE_LIGHTING_MODE_HP,
GL_TEXTURE_PRE_SPECULAR_HP);

or

GLfloat appMode=GL_TEXTURE_PRE_SPECULAR_HP; glTexEnvf(GL_TEXTURE_ENV,
GL_TEXTURE_LIGHTING_MODE_HP, &appMode);

The results from using preLight texturing are given in Figure 1-10. Note that the top image is without prelight texturing, and the bottom is with preLight texturing. The left half of each image is the untextured specular-lighted image, and the right half of each image uses GL_REPLACE texturing.

Figure 2-10 Title not available (Procedure for preLight Texturing )

Figure 2-11 Results from Prelight Texturing

Results from Prelight Texturing

For related information, see the function glTexEnv.

Occlusion Extension

This occlusion culling extension defines a mechanism whereby an application can determine the non-visibility of some set of geometry based on whether an encompassing set of geometry is non-visible. In general, this feature does not guarantee that the target geometry is visible when the test fails, but is accurate with regard to non-visibility.

Typical usage of this feature would include testing the bounding boxes of complex objects for visibility. If the bounding box is not visible, then it is known that the object is not visible and need not be rendered.

Occlusion Culling Code Fragments

The following is a sample code segment that shows a simple usage of occlusion culling.

/* Turn off writes to depth and color buffers */
glDepthMask(GL_FALSE);
glColorMask (GL_FALSE, GL_FALSE, GL_FALSE);
/* Enable Occlusion Culling test */
glEnable(GL_OCCLUSION_TEST_HP);
for (i=0; i < numParts; i++) {
/* Render your favorite bounding box */
renderBoundingBox(i);
/* If bounding box is visible, render part */
glGetBooleanv(GL_OCCLUSION_RESULT_HP, &result);
if (result) {
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
renderPart(i);
glDepthMask(GL_FALSE);
glColorMask (GL_FALSE, GL_FALSE, GL_FALSE);
}
}
/* Disable Occlusion Culling test */
glDisable(GL_OCCLUSION_TEST_HP);
/* Turn on writes to depth and color buffers */
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);

The key idea behind occlusion culling is that the bounding box is much simpler (i.e., fewer vertices) than the part itself. Occlusion culling provides a quick means to test non-visibility of a part by testing its bounding box.

It should also be noted that this occlusion culling functionality is also very useful for viewing frustum culling. If a part's bounding box is not visible for any reason (not just occluded in the Z-buffer), this test will give correct results.

To maximize the probability that an object is occluded by other objects in a scene, the database should be sorted and rendered from front to back. Also, the database may be sorted hierarchically such that the outer objects are rendered first and the inner are rendered last. An example would be rendering the body of an automobile first and the engine and transmission last. In this way the engine would not be rendered due to the bounding box test indicating that the engine is not visible.

Table 2-10 Enumerated Types for Occlusion

Extended Area

Enumerated Types

Description

Enable/Disable/ IsEnabled

GL_OCCLUSION_TEST_HP default: Disabled

pname variable

Get*

GL_OCCLUSION_TEST_RESULT_HP default: Zero (0)

pname variable

 

For related information, see the functions: glGet, glEnable, glDisable, and glIsEnabled.

Texture Autogen Mipmap Extension

The autogen mipmap extension introduces a side effect to the modification of the base level texture map. When enabled, any change to the base-level texture map will cause the computation of a complete mipmap for that base level. The internal formats and border widths of the derived mipmap will match those of the base map, and the dimensions of the derived mipmap follow the requirements set forth in OpenGL for a valid mipmap. A simple 2×2 box filter is used to generate the mipmap levels.

Table 2-11 Enumerated Types for Occlusion

Extended Area

Enumerated Types

Description

Texture Parameter

GL_GENERATE_MIPMAP_EXT default: GL_FALSE

Enables autogen mipmap.

 

To use the autogen mipmap extension, set GL_GENERATE_MIPMAP_EXT to GL_TRUE in glTexParameter. For example, here is a code fragment that uses this extension:

glTexParameter[if](GL_TEXTURE_2D, GL_GENERATE_MIPMAP_EXT, GL_TRUE);

For related information on this extension, see the function glTexParameter.

X Window Extensions for HP's Implementation of OpenGL

HP's implementation of OpenGL includes two GLX extensions that deal with extended GLX visual information that is not included in the OpenGL 1.1 Standard. These extensions are both supported by HP's implementation of the OpenGL API library, but prior to using them,

glXQueryExtensionsString should be called to verify that the extensions are supported on the target display.

GLX Visual Information Extension

The GLX_EXT_visual_info extension provides additional GLX visual information and enhanced control of GLX visual selection. The enumerated types listed below can be passed to either glXChooseVisual, or glXGetConfig to specify or inquire the visual type or transparency capabilities.

Table 2-12 Enumerated Types for GLX Visual Information

Extended Area

Enumerated Types

Description

Visual Type

GLX_TRUE_COLOR_EXT, GLX_DIRECT_COLOR_EXT, GLX_PSEUDO_COLOR_EXT, GLX_STATIC_COLOR_EXT[1], GLX_GRAY_SCALE_EXT[1], GLX_STATIC_GRAY_EXT[1] default: N/A

Values associated with the GLX_X_VISUAL_TYPE_EXT enumerated type.

Visual Transparency Capabilities

GLX_NONE_EXT, GLX_TRANSPARENT_RGB_EXT[1], GLX_TRANSPARENT_INDEX_EXT default: GLX_NONE_EXT

Values associated with the GLX_TRANSPARENT_TYPE_EXT enumerated type.

  1. These enumerated types are supported through the GLX client-side API library, but there are currently no HP X Server GLX VIsuals with these capabilities. They can still be used to query any Server and will operate properly if connected to a non-HP server with GLX support for these visual capabilities.

 

The enumerated types listed below can be used only through glXGetConfig when it is known that the GLX visual being queried supports transparency or in other words, has a GLX_TRANSPARENT_TYPE_EXT property other than GLX_NONE_EXT.

Table 2-13 Enumerated Types for GLX Visual Transparency

Extended Area

Enumerated Types

Description

Transparency Index for PseudoColor Visuals

GLX_TRANSPARENT_INDEX_VALUE_EXT default: N/A

Returns the Pixel Index for the transparent color in a GLX_TRANSPARENT_INDEX_EXT visual.

Transparency Values for RGBA Visuals

GLX_TRANSPARENT_RED_VALUE_EXT, GLX_TRANSPARENT_GREEN_VALUE_EXT, GLX_TRANSPARENT_BLUE_VALUE_EXT, GLX_TRANSPARENT_ALPHA_VALUE_EXT default: N/A

Returns the RGBA data values for the transparent color in a GLX_TRANSPARENT_RGB_EXT type GLX visual (Not supported on HP Servers).

 

GLX_EXT_visual_info Program Fragments

Note that both of the following segments assume that the GLX_EXT_visual_info extension exists for dpy, which is a pre-existing display connection to an X Server.

Here is a sample code segment that forces selection only of a TrueColor visual.

Display *dpy;
XVisualInfo *vInfo;
int attrList[] = {GL_USE_GL,
GLX_X_VISUAL_TYPE_EXT,
GLX_TRUE_COLOR_EXT,
None};

vinfo = glXChooseVisual(dpy, XDefaultScreen(dpy), &attrList);

The following sample is a code segment that selects an overlay visual with index transparency, and then obtains the Pixel index for the transparent color.

Display *dpy;
XVisualInfo *visInfo;
int transparentPixel;
int attrList[] = {GL_USE_GL,
GLX_LEVEL, 1,
GLX_TRANSPARENT_TYPE_EXT,
GLX_TRANSPARENT_INDEX_EXT,
None};

visInfo = glXChooseVisual(dpy, XDefaultScreen(dpy), &attrList);
if (visInfo != NULL) {
glXGetConfig(dpy, visInfo, GLX_TRANSPARENT_INDEX_VALUE_EXT,
&transparentPixel);
}

GLX Visual Rating Extension

The GLX_EXT_visual_rating extension provides additional GLX visual information which applies rating properties to GLX visuals. The enumerated types listed below can be passed to either glXChooseVisual, or glXGetConfig to specify or inquire visual rating information.

Table 2-14 Enumerated Types for GLX Visual Rating

Extended Area

Enumerated Types

Description

Visual Rating

GLX_NONE_EXT, GLX_SLOW_VISUAL_EXT, GLX_NON_CONFORMANT_VISUAL_EXT default: N/A

Values associated with the GLX_VISUAL_CAVEAT_EXT enumerated type.

 

Note that all current HP GLX visuals are rated as GLX_NONE_EXT. This extension is implemented for possible future visual support and for use with non-HP servers. Coding to use the GLX_EXT_visual_rating extension is similar to the segments listed above for the GLX_EXT_visual_info extension.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.