Page 1 of 1

Problems loading the schemes

Posted: Tue Mar 06, 2007 20:07
by badkarmazen2
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.

Posted: Tue Mar 06, 2007 21:19
by scriptkid
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!