I've been trying to get CEGUI works for 3 days now. When I thought that I have everything done and I'm ready to render my first window into the screen, unexpected error has occured. XMLParser is unable to parse scheme datafile. Everytime I try to create scheme from file I got an exception:
Unhandled exception at at 0x764AC41F in MyShowcase.exe: Microsoft C++ exception: CEGUI::InvalidRequestException at memory location 0x0017E580.
If I debug it and go thru the code so the problem is in parsing the schema file. I'm using CEGUI 0.8.2 version and I have datafiles from the last release of CEGUI Layout editor (0.7.1)
I'm using CEGUI with Direct3D11Renderer and here is my whole code:
Bootstrap function:
Code: Select all
ceguiRenderer = &(CEGUI::Direct3D11Renderer::bootstrapSystem(device, context));
In render loop:
Code: Select all
CEGUI::System::getSingleton().renderAllGUIContexts();
Before get into the render loop:
Code: Select all
// create CEGUI window (TEMP)
CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );
// initialise the required dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());
// ### ABSOLUTE PATHS ARE TEMPORARY, JUST TO BE SURE THAT FILES EXISTS AND CAN BE LOADED ###
rp->setResourceGroupDirectory("schemes", "e:\\C++\\PROJECTS\\CPP_D3D_FRAMEWORK\\Debug\\datafiles\\schemes\\");
rp->setResourceGroupDirectory("imagesets", "e:\\C++\\PROJECTS\\CPP_D3D_FRAMEWORK\\Debug\\datafiles\\imagesets\\");
rp->setResourceGroupDirectory("fonts", "e:\\C++\\PROJECTS\\CPP_D3D_FRAMEWORK\\Debug\\datafiles\\fonts\\");
rp->setResourceGroupDirectory("layouts", "e:\\C++\\PROJECTS\\CPP_D3D_FRAMEWORK\\Debug\\datafiles\\layouts\\");
rp->setResourceGroupDirectory("looknfeels", "e:\\C++\\PROJECTS\\CPP_D3D_FRAMEWORK\\Debug\\datafiles\\looknfeel\\");
// set the default resource groups to be used
CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
parser->setProperty("SchemaDefaultResourceGroup", "schemas");
// ### CALLING THIS METHOD CAUSES THE CRASH ###
CEGUI::SchemeManager::getSingleton().createFromFile( "TaharezLook.scheme" );
CEGUI::FontManager::getSingleton().createFromFile( "DejaVuSans-10.font" );
CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow*>( wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));
myRoot->addChild( fWnd );
// position a quarter of the way in from the top-left of parent.
fWnd->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.25f, 0 ) ) );
// set size to be half the size of the parent
fWnd->setSize( CEGUI::USize( CEGUI::UDim(0.5f, 0), CEGUI::UDim(0.5f, 0) ) );
fWnd->setText( "Hello World!" );
Before application quits:
Code: Select all
(*ceguiRenderer).destroySystem();
Please, can you give me a advice or hint what I'm doing wrong ?
Thanks, Toby.