Page 1 of 1

can't load imageset

Posted: Thu Dec 14, 2006 07:12
by realtiger
hi all

I use this code to load a scheme.

Code: Select all

   CEGUI::OpenGLRenderer *renderer;
   CEGUI::System *system;
   CEGUI::Imageset *imgSet;

   try
   {
      renderer = new CEGUI::OpenGLRenderer(0, 800, 600);
      system = new CEGUI::System(renderer);

      CEGUI::SchemeManager::getSingleton().loadScheme("datafiles/schemes/TaharezLook.scheme");
      CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");

//      imgSet = CEGUI::ImagesetManager::getSingleton().createImageset("c:/CEGUI-SDK-0.5.0b/datafiles/schemes/TaharezLook.imageset");
   }
   catch (CEGUI::Exception &e)
   {
      MessageBoxA(0, e.getMessage().c_str(), "ERROR", MB_OK);
      return 1;
   }


But this error occured:

Code: Select all

14/12/2006 14:08:25 (Error)   Exception: DefaultResourceProvider::load - TaharezLook.imageset does not exist
14/12/2006 14:08:25 (Error)   Imageset::load - loading of Imageset from file 'TaharezLook.imageset' failed.


I have copied datafiles folder from SDK to project folder.

Anyone knows why?

Posted: Thu Dec 14, 2006 07:58
by realtiger
I have found the answer in wiki.
The Direct3D and OpenGL renderers do not, by default, use a specialised ResourceProvider; these systems default to loading all resources from the current working directory for the running application (usually the directory containing the executable). This fact is of major importance when specifying paths to files within other files; they are all relative to the same directory, they are not relative to each other.