KnowledgeBase
OpenGL Overlay Windows
System:
any |
Category:
graphics |
Last Modified:
2/19/99 |
OS version:
NT 4.0 |
Product:
OpenGL |
Service Pack:
|
What kind of overlay support do the Silicon Graphics 320 and
Silicon Graphics 540 Visual Workstations offer? How would I access an overlay
buffer from OpenGL?
An overlay is a window that is always drawn over an existing window.
It consists of display memory and a separate palette. Generally,
one of the entries in the palette is transparent, which allows underlying
content to show through. These windows are typically used to display
transient content, such as icons, menus, and indicators over other windows
without disturbing the content underneath.
The Silicon Graphics 320 and Silicon Graphics 540 both support an 8-bit, single-buffered, 256-color
overlay window. Generally speaking, entry 0 is the transparent entry,
although this should be verified using the procedure detailed below.
The palette entries for the overlay layer may be
manipulated with the following wgl extensions:
wglSetLayerPaletteEntries()
wglGetLayerPaletteEntries()
wglRealizeLayerPalette()
In order to access this buffer, you must create a window with
the proper pixel format and install it for OpenGL drawing.
Here are the necessary steps:
Find out how many pixel formats are supported for the current display mode
-- return value from DescribePixelFormat()
Examine each pixel format to determine if it supports any layer planes
-- call DescribePixelFormat() for each format
-- check the bReserved field of the PIXELFORMATDESCRIPTOR to determine the number and kind of layers that are supported
Examine the layer information for each layer
-- call wglDescribeLayerPlane() for each layer
-- examine the crTransparent field of the LAYERPLANEDESCRIPTOR to
determine the transparent color
Set the pixel format for the window
-- call SetPixelFormat()
Create a layer context for the pixel format
-- call wglCreateLayerContext()
Make the layer context current
-- call wglMakeCurrent() passing the window HDC and the context HGLRC
Manage the color palette for the layer plane
-- wglSetLayerPaletteEntries(), wglGetLayerPaletteEntries(),
wglRealizeLayerPalette()
See example 2-1, "Creating an Overlay Rendering Context" in the online documentation that comes with the Graphics Software Development Kit for more details. The SDK is available for download from:
http://www.sgi.com/developers/nt/sdk
Send comments on this case to kbase@sgi.com.
Copyright © 1997-98, Silicon Graphics, Inc.
|