Specifies RGBA color with a single packed 32-bit integer.
FORTRAN (libfgl.a)
void cpack(unsigned Int32 pack)
SUBROUTINE CPACK(pack) INTEGER*4 pack
The cpack subroutine changes the current RGBA (red, green, blue, alpha) values. It is valid only in RGB mode. Red is the least significant byte in the packed integer, then green, blue, and alpha. Components must range from 0 through 255. For example,
cpack(0xFF004080);
sets red to 0x80, green to 0x40, blue to 0x0, and alpha to 0xFF. On systems without alpha bitplanes, set the alpha bit values to zero.
Note that the cpack subroutine can be used while a lighting model is active.
pack | Specifies a packed integer containing the RGBA (red, green, blue, alpha) values to assign as the current color. |
To clear the screen to black, then set the color to white, the example C language program localatten.c calls the cpack subroutine with a value of 0 (black) before a clear subroutine, then calls the cpack subroutine with a value of 0xFFFFFF (white).
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
/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. |
Setting the current color in RGB mode with the c subroutine.
Setting the current color in color map mode with the color subroutine.
Returning the current color in color map mode with the getcolor subroutine.
Returning the current color in RGB mode with the gRGBcolor subroutine.
Setting the current color in RGB mode with the RGBcolor subroutine.
AIX Graphics Library Overview, Setting Drawing Attributes, Understanding the Hardware Used by GL, and Working in Color Map and RGB Modes.