CEGUI 0.8.7 and SFML 2.4.2 - load imageset

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

HawkDeath
Just popping in
Just popping in
Posts: 1
Joined: Tue Jul 11, 2017 17:07

CEGUI 0.8.7 and SFML 2.4.2 - load imageset

Postby HawkDeath » Tue Jul 11, 2017 17:18

Hi,
I try to use CEGUI in my program when I try to load a TaharezLook.imageset a program return this exception.
What I do wrong? How to fix this?

Code: Select all

//this code load a resources
   CEGUI::SchemeManager::getSingletonPtr()->createFromFile("bin/TaharezLook.scheme");
   CEGUI::ImageManager::getSingletonPtr()->loadImageset("bin/TaharezLook.imageset");      
   CEGUI::FontManager::getSingletonPtr()->createFromFile("bin/DejaVuSans-10.font");
   
   CEGUI::Font::setDefaultResourceGroup("fonts");
   CEGUI::Scheme::setDefaultResourceGroup("schemes");
   CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeel");
   CEGUI::WindowManager::setDefaultResourceGroup("layouts");
   CEGUI::ImageManager::setImagesetDefaultResourceGroup("imagesets");


Code: Select all

//this code creates a button
      CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
      CEGUI::Window *sheet = wmgr.createWindow("DefaultWindow", "CEGUIDemo/Sheet");
      CEGUI::Window *quit = wmgr.createWindow("TaharezLook/Button", "CEGUIDemo/QuitButton");
      quit->setText("Quit");
      quit->setSize(CEGUI::USize(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0)));
      sheet->addChild(quit);
      CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(sheet);

      auto quitFunc = [](const CEGUI::EventArgs &)->bool {
         exit(0);
      };
      quit->subscribeEvent(CEGUI::PushButton::EventClicked,
         CEGUI::Event::Subscriber(&quitFunc));


Code: Select all

CEGUI::FileIOException in function 'void __thiscall CEGUI::DefaultResourceProvid
er::loadRawDataContainer(const class CEGUI::String &,class CEGUI::RawDataContain
er &,const class CEGUI::String &)' (C:\programming\gits\cegui-0.8.7\cegui\src\De
faultResourceProvider.cpp:66) : TaharezLook.imageset does not exist
CEGUI::UnknownObjectException in function 'class CEGUI::WindowFactory *__thiscal
l CEGUI::WindowFactoryManager::getFactory(const class CEGUI::String &) const' (C
:\programming\gits\cegui-0.8.7\cegui\src\WindowFactoryManager.cpp:186) : A Windo
wFactory object, an alias, or mapping for 'TaharezLook/Button' Window objects is
 not registered with the system.

Have you forgotten to load a scheme using CEGUI::SchemeManager::createFromFile(..)?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: CEGUI 0.8.7 and SFML 2.4.2 - load imageset

Postby Ident » Tue Jul 11, 2017 17:35

I guess what it says is correct: the files are not in the specified path. Can't tell you anything other than that from a remote view.
CrazyEddie: "I don't like GUIs"

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: CEGUI 0.8.7 and SFML 2.4.2 - load imageset

Postby lucebac » Thu Jul 13, 2017 18:36

Usually, this is because your datafiles folder is not where CEGUI expects it. If you use Visual Studio and just clicked "debug" or "run", the working directory is set "wrong". You can either set the Debug directory of VS to "$(OutDir)" or launch the executable manually.
The datafiles folder should be placed next to your main executable and I strongly recommend you to not change the directory layout unless you know what you are doing. For now, please just copy over the whole datafiles folder to your e.g. Debug directory. Also, you can have a look at one of the application templates and see how resource initialization is done there.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: CEGUI 0.8.7 and SFML 2.4.2 - load imageset

Postby Ident » Thu Aug 17, 2017 19:58

What lucebac said sounds correct, forgot about that very important aspect.

Did that solve your issue?
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests