SFML community forums

Help => Graphics => Topic started by: poseidon on January 09, 2010, 02:45:01 am

Title: CEGUI & openGL
Post by: poseidon on January 09, 2010, 02:45:01 am
I want to be able to use sfml to handle the window and events, however, I want to use openGL to render 3d graphics and CEGUI to render a UI.  However, when I tried to use both at the same time I can't see anything being rendered by openGL.

What I simply used the code from the CEGUI tutorial (http://www.sfml-dev.org/wiki/en/tutorials/cegui).  I then created a boolean variable which decided whether CEGUI should render or not.

When I pressed the esc button a boolean variable would be changed and the following code
Code: [Select]

mWindow.Draw(mString);
mGUIManager.Draw();
mWindow.Display();

would not be called.  A method to which called all the openGL commands needed to draw a cube was called instead.

However, no cube ever shows up.

Can someone help me figure out how to get CEGUI and openGL to both take turns displaying (or maybe CEGUI overlaying over the openGL rendered scene).


Thank you for your time,


Joseph
Title: CEGUI & openGL
Post by: Laurent on January 09, 2010, 10:06:19 am
So, you can see your OpenGL scene when you don't use CeGUI at all, right?

It must be a state problem, make sure that you restore all the states you need for your 3D scene after the CeGUI rendering.