OpenGL Renderer : glViewport
Posted: Wed Jan 17, 2007 18:47
by JohnArgentieri
I am having some trouble with CEGUI trying to automatically determine the glviewport to render to. I mean, I am able to render but only a portion of my rendering surface gets drawn to by cegui. Can anyone please help me determine how to tell CEGUI to force the size of the viewport it's rendering to?
Thanks much! Sincerely,
John Argentieri
Posted: Mon Jan 22, 2007 12:45
by vasmann
Hello.
If you see at samples provided with CEGUI lib, there you can find directory [common\src] and here is the file CEGUIOpenGLBaseApplication reshape function
void CEGuiOpenGLBaseApplication::reshape(int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 1.0, 50.0);
glMatrixMode(GL_MODELVIEW);
CEGUI::OpenGLRenderer* renderer = (CEGUI::OpenGLRenderer*)CEGUI::System::getSingleton().getRenderer();
renderer->setDisplaySize(CEGUI::Size((float)w,(float)h));
}
which is called when you change your window size. So it shoul fix Your problem.
Thank You.