[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

drawmode Subroutine

Purpose

Specifies the target frame buffer for the drawing subroutines.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void drawmode(Int32 mode)

FORTRAN Syntax

SUBROUTINE DRAWMO(mode)
INTEGER*4 mode

Description

The drawmode subroutine reconfigures the system and redirects the target of a number of GL drawing and attribute subroutines. The affected routines depend on the mode that the user chooses. Calls to the color, getcolor, writemask, getwritemask, mapcolor, and getmcolor subroutines affect only the current drawing mode. In cursor mode, only the getmcolor and mapcolor subroutines perform a function.

Note: This subroutine cannot be used to add to a display list.

Parameter

mode Specifies the drawing mode identifier. The mode constants for both C and FORTRAN and their functions are displayed in the following table:
Mode Constants
C FORTRAN Description
UNDERDRAW UNDRDR Redirects drawing into the background (underlay) bitplanes.
NORMALDRAW NORMDR Redirects all drawing into the mainframe buffer bitplanes.
OVERDRAW OVRDRW Redirects drawing into the foreground (overlay) bitplanes.
PUPDRAW PUPDRW Redirects mapcolor and getmcolor subroutines to affect only the pop-up menus.
CURSORDRAW CURSDR Redirects mapcolor and getmcolor subroutines to affect only the cursor.

The following provides additional descriptions for the preceding modes:

Mode Description
UNDERDRAW The line drawing and polygon drawing routines (both begin-end style and move-draw style) draw into the underlay planes rather than the main frame buffer. The pixmap transfer subroutines (the rectread, rectwrite, and rectcopy subroutines) also draw into the underlays. All of the current attributes are used during drawing, except the color and the writemask. Each drawing mode has a separate current color and current writemask, which are saved and restored when that drawing mode is exited and entered.

Drawing into the underlay planes can only be done in colorindex mode. The system automatically goes into colorindex mode when the UNDERDRAW mode is entered. Lighting and NURBS subroutines do not work correctly in UNDERDRAW mode. Because of the small number of bitplanes, only flat shading is possible; Gouraud shading does not work. The z-buffer is not updated when in UNDERDRAW mode.

The system must have been configured to contain underlay planes before the UNDERDRAW mode can be entered. Underlay planes may be configured by calling the underlay subroutine followed by the gconfig subroutine.

NORMALDRAW All drawing occurs in the main frame buffer. NORMALDRAW is the default drawing mode.
OVERDRAW The line drawing and polygon drawing routines (both begin-end style and move-draw style) draw into the overlay planes rather than the main frame buffer. The pixmap transfer subroutines (the rectread, rectwrite, and rectcopy subroutines) also draw into the overlays. All of the current attributes are used during drawing, except the color and the writemask. Each draw mode has a separate current color and current writemask, which are saved and restored when that draw mode is exited and entered.

Drawing into the overlay planes can only be done in colorindex mode. The system automatically goes into colorindex mode when the OVERDRAW mode is entered. Lighting and NURBS subroutines do not work correctly in OVERDRAW mode. Because of the small number of bitplanes, only flat shading is possible; Gouraud shading does not work. The z-buffer is not updated when in OVERDRAW mode.

The system must have been configured to contain overlay planes before the OVERDRAW mode can be entered. Overlay planes may be configured by calling the overlay subroutine followed by the gconfig subroutine.

Note: To z-buffer drawing into the overlay planes, enable z-buffering. If you do not want to z-buffer this type of drawing, disable z-buffering by calling the zbuffer subroutine with a value of False while drawing into the overlay planes. Unclear visual images may be the unintentional result when a drawing in the overlay becomes z-buffered.
PUPDRAW Only the mapcolor subroutine and getmcolor subroutine are affected. Drawing subroutines cannot be used to draw into the pop-up menus. In particular, lines, polygons, and pixmaps cannot be drawn into the pop-up menus. Only the pop-up subroutines may be used to access the pop-up menus.
CURSORDRAW Only the mapcolor and getmcolor subroutine are affected. Drawing subroutines cannot be used to draw into the cursor. Only the cursor subroutines access the cursor.

Example

The example C language program prompt.c uses the drawmode subroutine with the PUPDRAW mode identifier to set the drawing mode for operations on the pop-up menus.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Only the Color Graphics Processor has underlay planes. Neither the POWERgraphics Gt4 family of graphics adapters, nor the POWERgraphics GXT1000 posses underlay planes. The call drawmode(UNDERDRAW) is ignored on the GXT1000 and Gt4 family adapters.

The call drawmode(OVERDRAW) is ignored for windows that have been created with the winX subroutine, unless the glcompat GLC_CREATE_OVERLAY flag has been set.

When performing BLITs to and from the overlay planes on the GXT1000, note that the transparent pixel value on the GXT1000 is 255, not 0. That is, transparent pixels in a pixmap should have the value of 255. Ordinary drawing into the overlay planes still uses color 0 as the transparent color.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

Enabling drawing into the back buffer with the backbuffer subroutine.

Setting color map mode as the current mode with the cmode subroutine.

Setting the color index in the current mode with the color subroutine.

Setting the display mode to double buffer mode with the doublebuffer subroutine.

Enabling or disabling drawing into the front buffer with the frontbuffer subroutine.

Changing a color map entry to an RGB value with the mapcolor subroutine.

Setting the number of bitplanes used for overlay colors with the overlay subroutine.

Setting the current color in RGB mode with the RGBcolor subroutine.

Setting a display mode that bypasses the color map with the RGBmode subroutine.

Granting write access to a subset of available bitplanes with the RGBwritemask subroutine.

Setting the display mode to single buffer mode with the singlebuffer subroutine.

Setting the number of bitplanes used for underlay colors with the underlay subroutine.

Granting write permission to a subset of available bitplanes with the writemask subroutine.

Turning z-buffer mode on and off with the zbuffer subroutine.

Enabling drawing to the z-buffer with the zdraw subroutine.

Creating Animated Scenes, Removing Hidden Surfaces, and Working in Color Map and RGB Modes.

Configuring the Frame Buffer and Writemasks and Logical Operation.


[ Previous | Next | Contents | Glossary | Home | Search ]