Started playing with CEGUI in combination with SDL and libgls (faking up quadbuffers). In order to render quad buffers I need to be able to change the projection matrix between left and right views, and as yet have not worked out how to do it. In my test app both left and right views are renderd the same.
I note the comment that 'CEGUI::System::getSingleton().renderGUI();' "does all the CEGUI magic and sets OpenGL state itself. As long as the viewport is setup, it will render the GUI."
http://www.cegui.org.uk/wiki/index.php/Using_CEGUI_with_SDL_and_OpenGL_%280.7%29
So I suspect that it is fixing the projection matrix to the default one... is there something else I should be calling instead?
The relevant section of my test code is
Code: Select all
void render_gui()
{
// Clears the colour buffer:
glClear( GL_COLOR_BUFFER_BIT ) ;
glsClear(gls_ctx);
// Renders the GUI:
if (glsIsViewRequired(gls_ctx, gls_mode, gls_swap_eyes, GLS_VIEW_LEFT)) {
CEGUI::System::getSingleton().renderGUI() ;
glsSubmitView(gls_ctx, GLS_VIEW_LEFT);
}
if (glsIsViewRequired(gls_ctx, gls_mode, gls_swap_eyes, GLS_VIEW_RIGHT)) {
CEGUI::System::getSingleton().renderGUI() ;
glsSubmitView(gls_ctx, GLS_VIEW_RIGHT);
}
// render result
glsDrawSubmittedViews(gls_ctx, gls_mode, gls_swap_eyes);
// Updates the screen:
#if SDL_VERSION_ATLEAST(2,0,0)
SDL_GL_SwapWindow(displayWindow);
#else
SDL_GL_SwapBuffers() ;
#endif
}
Cheers,
Simon.
PS. I mod'ed the SDL example code to work with SDL1.3/2.0, it's here if you want it
http://sourceforge.net/apps/trac/speed-dreams/ticket/752