Expand/Shrink

glColor

Definition: include pGUI.e
include opengl.e

glColor(atom red, blue, green, alpha=1)
-- or --
glColor3(atom {red,blue,green[,alpha=1]}) (actually declared as a single sequence parameter)
Description: Deprecated, specifically not supported on WebGL.
While still supported on desktop/Phix, these routines have been coloured illegal to indicate they cannot be handled by pwa/p2js.

Sets the current color.

red,blue,green,alpha: values in the range 0.0 (zero intensity) to 1.0 (full intensity).
For the alpha value, 0.0 means completely transparent and 1.0 means completely opaque.
pwa/p2js: Not supported.
Remarks Note that no validation of these values occurs, either in the Phix wrapper or the C code, however all color
components are clamped to the range [0,1] before they are interpolated or written into a color buffer.
glColor3 implicitly sets alpha to 1.0 (full intensity), unless the single parameter has 4 elements.

The GL stores both a current single-valued color index and a current four-valued RGBA color. glColor sets a new four-valued RGBA color.

The C interface specifies no less than 32 entry points, whereas the pGUI interface is simplified to just two entries. The f/d variants should map directly, but take special care with any b/i/s variants, if you ever see any of those - see technicalia for details.

The initial value for the current color is (1, 1, 1, 1).

The current color can be updated at any time. In particular, glColor() can be called between a call to glBegin() and the corresponding call to glEnd().

Existing values can be retrieved via glGet with argument GL_CURRENT_COLOR or GL_RGBA_MODE.
See Also: glBegin, glEnd, glGet
DEV See also //glBegin //glEnd //glGetBooleanv, glGetDoublev, glGetFloatv, glGetIntegerv glIndex
Expand/Shrink