A SERVICE OF

logo

Cube.cxx Explained
197
// define render window
if (doFullScreen) {
csWindow::initPosition(0, 0);
csWindow::initSize(csWindow::get(csWindow::SCREEN_WIDTH),
csWindow::get(csWindow::SCREEN_HEIGHT));
}
new csWindow("cube");
// define rendering context
csContext *ctx = csWindow::getContext();
ctx->setDepthEnable(TRUE);
ctx->setDepthFunc(csContext::LEQUAL_DFUNC);
ctx->setCullFace(csContext::BACK_CULL);
//Set up the camera
csCamera *cam;
if (doOrthoCam)
{
csOrthoCamera *orthoCam = new csOrthoCamera;
orthoCam->setWidth(4.0f);
orthoCam->setHeight(4.0f);
cam = orthoCam;
}
else
{
csPerspCamera *perspCam = new csPerspCamera;
cam = perspCam;
}
da = new csDrawAction;
da->setCamera(cam);
cam->draw(da);
csWindow::setFrameFunc(&frame, da);
csWindow::mainLoop();
return 0;
}