A SERVICE OF

logo

Changing the Context
39
Overriding Appearances and Geometry Properties with csContext
In general, csAppearance settings override csContext default values. You can, however,
override csAppearance settings using csContext::pushOverrideAppearance(). Only one
override appearance per context can be in place at a time.
You can override some properties that are not in csAppearance and are
geometry-specic through the use of pushOverrideGeoProp(). Currently, csCullFace,
csLineWidth, and csPointSize are the only geometry-specic properties that can be
overridden.
Making the Screen One Color
To change the screen to a specied color, use one of the following csContext methods:
static void clear(int which);
static void clear(int which, float r, float g, float b, float a);
where which is a bitmask specifying whether to clear the color planes, depth planes, or
both.
The rst clear() method clears the screen to black. The second version allows you to set
a uniform color and transparency.
Changing the Context
You can create multiple csContext objects but only one can be active at a time. In this way,
in addition to changing eld values in a context object, you can change the entire context
all at once using makeCurrent(). This method replaces the current context with the
csContext object specied in the argument, for example:
csContext* context1 = new csContext;
csContext* context2 = new csContext;
context1->makeCurrent(display, window);
context2->makeCurrent(display, window);