OpenGL Renderer : glViewport

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

JohnArgentieri
Just popping in
Just popping in
Posts: 15
Joined: Tue Jan 09, 2007 16:14

OpenGL Renderer : glViewport

Postby JohnArgentieri » Wed Jan 17, 2007 18:47

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

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Postby vasmann » Mon Jan 22, 2007 12:45

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.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 16 guests