This small program allows you to use overlays
on an SGI NT platform.
Draw a dynamic rubberband in the overlays planes.
Draw a triangle in the main plane.
No drawing occurs in the main planes when drawing
in the overlays planes.
If a "paint" event occurs the triangle is rotated.
usage:
rubberband.exe
Btn1Down : start rubberbanding
Btn1Move : draw rubberband
Btn1Up : stop rubberbanding
For each new rectangle the color changes! ;-)
package:
developped with VisualC++ 5.0
Win32 project called overlays.dsw
files:
rubberband.c : the main program
overlays.cpp : overlays functions / debug
overlays.h : definition for overlay functions
functions:
oglCreateWindow():
Register and create a Window.
createContextAndOverlays():
Find the rights PixelFormats for both Main and Overlays planes.
Create OpenGL contexts for main and Overlays planes.
Associates and Realize color palette for Overlays planes
dumpOverlays and dumpNormals:
For debugging issue, those functions dump the content of the
pixel format in stdout if the symbol DEBUG_OVL is defined.
Draw():
Draw triangle in the main planes.
DrawOvl();
Draw rubberband in the overlays planes.
setupViewport:
Reset the Viewport for both contexts when resizing the Window.
wgl functions: (see MS documentation)
wglSwapLayerBuffers:
Allow to swap a specific set of planes.
ie: wglSwapLayerBuffers(hDC, WGL_SWAP_MAIN_PLANE);
Swap only the main planes.
wglSwapLayerBuffers(hDC,WGL_SWAP_OVERLAY1);
Swap only the overlays planes.
wglDescribeLayerPlane:
Return the Pixel description for a specific layer
wglSetLayerPaletteEntries:
Associate a palette with a specific layer.
wglRealizeLayerPalette:
Realize the palette in the specific layer.
wglCreateLayerContext:
Create an OpenGL context for a specific layer.
dependencies:
libraries: opengl32.lib glu32.lib
dlls: opengl32.dll, glu32.dll
Author:
|
Jacques Lefaucheux
jacques@paris.sgi.com
January 20, 1999
|