Datafiles parsing error [SOLVED]

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

Toby
Just popping in
Just popping in
Posts: 2
Joined: Wed Jul 03, 2013 14:11

Datafiles parsing error [SOLVED]

Postby Toby » Wed Jul 03, 2013 17:37

Hi,

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.
Last edited by Toby on Wed Jul 03, 2013 22:07, edited 1 time in total.

Toby
Just popping in
Just popping in
Posts: 2
Joined: Wed Jul 03, 2013 14:11

Re: Datafiles parsing error

Postby Toby » Wed Jul 03, 2013 22:06

OK, now I know where the problem was. I used old version of datafiles. Downloaded CEED (last release) and used datafiles version 1.0
For now is everything good and I can see my first "Hello world" window using CEGUI 0.8.2

Toby.

belial
Just popping in
Just popping in
Posts: 2
Joined: Sat Jul 20, 2013 12:45

Re: Datafiles parsing error [SOLVED]

Postby belial » Sun Jul 21, 2013 12:43

Thanks, I was just wondering if 1.0 datafiles works with 0.8.2.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 22 guests