A SERVICE OF

logo

Back Patch Culling
159
Back Patch Culling Code
Now that you understand all the facets of back patch culling, Example 14-1 presents the
series of calls your application must make to implement back patch culling.
Example 14-1 Implementing Back Face Culling
// Create a draw action.
csDrawAction *drawAction = new csDrawAction;
...
// Set the back patch culling mode.
drawAction->setBPCullMode(csDrawAction::DRAW_FRONT_FACING);
// Build scene graph.
csNode *scene = new csNode;
...
// Build back patch culling data for scene graph by using
// csGeoSet::buildBPCullData() in the following developer-supplied
// method.
buildBPCullSceneData(scene);
// Apply the draw action to the scene graph.
drawAction->apply(scene);