Problems loading the schemes

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

badkarmazen2
Just popping in
Just popping in
Posts: 1
Joined: Sat Mar 03, 2007 15:32

Problems loading the schemes

Postby badkarmazen2 » Tue Mar 06, 2007 20:07

Hi,
this is my first try with CEGUI and i'm already stuck. I always receive a exception when i'm tryng to load the scheme. I just followed the tutorials and I fail :oops:

This is what i do

Code: Select all

// GUI is OpenGL and is initialized

CEGUI::OpenGLRenderer * renderer = new CEGUI::OpenGLRenderer (0, width, height); // this works
new CEGUI::System (renderer); // this works

// I have added the following code found in the CEGUIOpenGLBaseApp
CEGUI::DefaultResourceProvider* rp = (CEGUI::DefaultResourceProvider*)
    (CEGUI::System::getSingleton().getResourceProvider());

  rp->setResourceGroupDirectory("schemes", "../datafiles/schemes/");
  rp->setResourceGroupDirectory("imagesets", "../datafiles/imagesets/");
  rp->setResourceGroupDirectory("fonts", "../datafiles/fonts/");
  rp->setResourceGroupDirectory("layouts", "../datafiles/layouts/");
  rp->setResourceGroupDirectory("looknfeels", "../datafiles/looknfeel/");
  rp->setResourceGroupDirectory("lua_scripts", "../datafiles/lua_scripts/");
// all is success full.

try
{
CEGUI::SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLook.scheme");
}
catch(CEGUI::Exception &ex) 
{
    CEGUI::String strDesc = ex.getMessage();
}


the Message i receive is "Default ResourceProvider::load - TaharezLook.scheme does not exist".

What am i missing, I really don't see it.
Thanks in advance.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Tue Mar 06, 2007 21:19

Hi and welcome,

you are almost there :)

When calling the 'setResourceGroupDirectory' methods you tell CEGUI where to find files of that type. That already includes a path. So you should load you scheme without the path information, like this:

Code: Select all

CEGUI::SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");


Otherwise it will try to find "../datafiles/schemes/TaharezLook.scheme" in the "../datafiles/schemes/" direcory which i won't be able too ;)

This 'rule' goes for all files which you set resourcedirectories for, so make sure that none of your other XML files contain path information. Double-check your Imagesets and such.

Good luck!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests