本文整理汇总了C++中CrtRender::Render方法的典型用法代码示例。如果您正苦于以下问题:C++ CrtRender::Render方法的具体用法?C++ CrtRender::Render怎么用?C++ CrtRender::Render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrtRender
的用法示例。
在下文中一共展示了CrtRender::Render方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onRender
void COLLADA_Viewer::onRender()
{
// base implementation clears screen and sets up camera
FWGLApplication::onRender();
if (!load_ok)
{
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
Browser.onRender();
cellDbgFontPuts(0.5f, 0.5f, 1.0f, 0xff00ffff, "Load Error!");
cellDbgFontDraw();
return;
}
if (mRunning==false)
return;
glPushMatrix();
glEnable(GL_DEPTH_TEST);
_CrtRender.Render();
glPopMatrix();
// FPS REPORTING
glDisable(GL_VSYNC_SCE);
// get current timing info
FWTimeVal timeNow = FWTime::getCurrentTime();
float fElapsedInFrame = (float)(timeNow - mLastTime);
mLastTime = timeNow;
++frames;
timeElapsed+=fElapsedInFrame;
// report fps at appropriate interval
if (timeElapsed>=timeReport)
{
//printf("FPS: %.2f\n",(frames-framesLastReport)*1.f/(float)(timeElapsed-timeLastReport));
timeReport+=REPORT_TIME;
timeLastReport=timeElapsed;
framesLastReport=frames;
}
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
Browser.onRender();
cellDbgFontDraw();
}
示例2: DrawGLScene
//----------------------------------------------------------------------------------------------------
// Main Render
CrtInt32 DrawGLScene(GLvoid)
{
// Clear The Screen And The Depth Buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
CrtMaterial mat;
mat.Ambient = CrtColor3f( 1,1,1 );
mat.Diffuse = CrtColor3f( 1,1,1 );
glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE, (GLfloat *)&mat.Diffuse );
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT, (GLfloat *)&mat.Ambient );
glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR, (GLfloat *)&mat.Specular );
glMaterialf( GL_FRONT_AND_BACK, GL_SHININESS, (GLfloat )mat.Shininess );
_CrtRender.Render();
return TRUE;
}