A SERVICE OF

logo

Using csAppearance
41
The csAppearance class includes a series of set...() methods to dene the appearance
characteristics of a geometry. A series of corresponding get...() methods provide access
to those values. The following set...() methods are described in greater detail in the rest
of this chapter:
void setTexture(csTexture* texture);
void setTexEnable(csBool texEnable);
void setTexMode(csContext::TexModeEnum texMode);
void setTexBlendColor(const csVec4f& texBlendColor);
void setTexBlendColor(csFloat v0, csFloat v1, csFloat v2, csFloat v3);
void setTexEnv(csContext::TexEnvEnum texEnv);
void setTexGen(csTexGen* texGen);
void setTexGenEnable(csBool texGenEnable);
void setMaterial(csMaterial* material);
void setLightEnable(csBool lightEnable);
void setShadeModel(csContext::ShadeModelEnum shadeModel);
void setTranspEnable(csBool transpEnable);
void setTranspMode(csContext::TranspModeEnum transpMode);
void setAlphaFunc(csContext::AlphaFuncEnum alphaFunc);
void setAlphaRef(csFloat alphaRef);
void setBlendColor(const csVec4f& blendColor);
void setBlendColor(csFloat v0, csFloat v1, csFloat v2, csFloat v3);
void setSrcBlendFunc(csContext::SrcBlendFuncEnum srcBlendFunc);
void setDstBlendFunc(csContext::DstBlendFuncEnum dstBlendFunc);
void setColorMask(const csVec4ub &colorMask);
void setColorMask(csUByte v0, csUByte v1, csUByte v2, csUByte v3);
void setDepthFunc(csContext::DepthFuncEnum depthFunc);
void setDepthMask(csUInt depthMask);
void setFogEnable(csBool fogEnable);
void setPolyMode(csContext::PolyModeEnum polyMode);
These method are separated into two groups:
Methods containing the string tex modify textures.
The remaining methods modify the appearance of geometries.
Lazy Updating of Appearance Values
csAppearance values are updated in a lazy way: a value is changed only when it is used.
For example, if a ball is currently displayed and you change its color using setColor(),
the ball would change color immediately on the screen. If, however, the ball is out of view
of the camera, the color of the ball would not be updated until it is seen by the camera.