cegui中的窗口可以再次用opengl画线之类的么?

OnlyHappy 2010-09-28 06:21:45
在cegui中的例子里面我在drawframe函数里面

void CEGuiOpenGLBaseApplication::drawFrame(void)
{
CEGUI::System& guiSystem = CEGUI::System::getSingleton();
// do time based updates
int thisTime = glutGet(GLUT_ELAPSED_TIME);
float elapsed = static_cast<float>(thisTime - d_lastFrameTime);
d_lastFrameTime = thisTime;
// inject the time pulse
guiSystem.injectTimePulse(elapsed / 1000.0f);
// update fps fields
doFPSUpdate();

// update logo rotation
static float rot = 0.0f;
d_logo_geometry->setRotation(CEGUI::Vector3(rot, 0, 0));
rot += 180.0f * (elapsed / 1000.0f);
if (rot > 360.0f)
rot -= 360.0f;

// do rendering for this frame.
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); // 在这里画线但是没有反应,在另外一个测试程序里面去掉cegui的相关代码,可以画出来
glLineWidth( 2.0 );
glBegin( GL_LINES );
glVertex3f( .0 , .0 , .0 );
glVertex3f( 100.0 , 100.0 , .0 );
glEnd();
guiSystem.renderGUI();
glutPostRedisplay();
glutSwapBuffers();

// here we check the 'quitting' state and cleanup as required.
// this is probably not the best way to do this, but since we're
// using glut, and glutMainLoop can never return, we need some
// way of checking when to exit. And this is it...
if (d_quitFlag)
{
CEGUI::OpenGLRenderer::destroySystem();

// exit
exit(0);
}
}
...全文
141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
OnlyHappy 2010-09-29
  • 打赏
  • 举报
回复

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧