Rendering to QuadBuffer/Stereoscopic Views

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

mungewell
Just popping in
Just popping in
Posts: 1
Joined: Wed Oct 17, 2012 08:00

Rendering to QuadBuffer/Stereoscopic Views

Postby mungewell » Wed Oct 17, 2012 08:19

Hi,
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

Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests