This is quite easy to achieve.
The CEGUI system will stay in the same state as long as you don't delete thee singleton pointer. From what I understand, you don't want the GUI to be displayed. This can be achieved from the game (or render) loop. Your game (or render) loop should have this line somewhere:
Code: Select all
//Renders GUI
CEGUI::System::getSingleton().renderGUI();
Now, in a game, there are many variables to be passed back and forth, normally state variables. A good practice is to have a class that holds all these states, but for this example we'll just say that our variable (a global variable) is a bool named RENDERGUI.
So from the code above, you should replace it with so:
Code: Select all
if(RENDERGUI){
//Renders GUI
CEGUI::System::getSingleton().renderGUI();
}
When RENDERGUI is false, the gui will not display on the screen and vica versa. Since this is a global variable, it should be accessed by any function. For example: If you are in the game presently and want to access the console or go into options by pressing the ESC key (which is what most games do), then your keyboard input function for the ESC key should just do this:
And there you have it. Each time you press the ESC key, it will either show or hide the GUI.