My code to initialise the gui is below:
Code: Select all
try {
CEGUI::OpenGLRenderer* myRenderer = new CEGUI::OpenGLRenderer( 0 );
new CEGUI::System( myRenderer );
using namespace CEGUI;
WindowManager& wmgr = WindowManager::getSingleton();
CEGUI::SchemeManager::getSingleton().loadScheme( "SleekSpace.scheme" );
// load in a font. The first font loaded automatically becomes the default font.
//if(! CEGUI::FontManager::getSingleton().isFontPresent( "Commonwealth-10" ) )
// CEGUI::FontManager::getSingleton().createFont( "Commonwealth-10.font" );
//System::getSingleton().setDefaultFont( "Commonwealth-10" );
Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
System::getSingleton().setGUISheet( myRoot );
FrameWindow* fWnd = (FrameWindow*)wmgr.createWindow( "SleekSpace/FrameWindow", "testWindow" );
myRoot->addChildWindow( fWnd );
// position a quarter of the way in from the top-left of parent.
fWnd->setPosition( UVector2( UDim( 0.25f, 0 ), UDim( 0.25f, 0 ) ) );
// set size to be half the size of the parent
fWnd->setSize( UVector2( UDim( 0.5f, 0 ), UDim( 0.5f, 0 ) ) );
fWnd->setText( "Hello World!" );
} catch (CEGUI::Exception e) {
string s = e.getMessage().c_str();
assert(0);
}
thanks