Been trying to get CEGUI to load in some resources by following this and this.
From this I have gotten the following code:
Code: Select all
bool GUI::initialise(LPDIRECT3DDEVICE9 d3dDevice9)
{
// Make sure we are not reinitialising.
if(!m_ceguiRenderer)
{
// Setup the Renderer.
m_ceguiRenderer = new CEGUI::DirectX9Renderer(d3dDevice9, 0);
// Initialise the CEGUI system.
new CEGUI::System(m_ceguiRenderer);
// Initialise the resource provider.
CEGUI::DefaultResourceProvider *rp = static_cast<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");
// Set the default resource groups.
CEGUI::Imageset::setDefaultResourceGroup("imagesets");
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes");
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");
CEGUI::WindowManager::setDefaultResourceGroup("layouts");
CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
// Load the scheme file.
CEGUI::SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme");
// Load in a font.
if(!CEGUI::FontManager::getSingleton().isFontPresent("Commonwealth-10"))
CEGUI::FontManager::getSingleton().createFont("Commonwealth-10.font");
// Setup the mouse.
CEGUI::System::getSingleton().setDefaultMouseCursor("VanillaSkin", "MouseArrow");
// Setup the tooltips.
CEGUI::System::getSingleton().setDefaultTooltip("VanillaSkin/Tooltip");
return true;
}
return false;
}But it's throwing an exception when it calls "CEGUI::SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme");".
05/05/2008 16:29:51 (Std) ---- CEGUI System initialisation completed ----
05/05/2008 16:29:51 (Std) ---- Version 0.6.0 ----
05/05/2008 16:29:51 (Std) ---- Renderer module is: CEGUI::DirectX81Renderer - Official Direct3D 9 based renderer module for CEGUI ----
05/05/2008 16:29:51 (Std) ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
05/05/2008 16:29:51 (Std) ---- Scripting module is: None ----
05/05/2008 16:29:51 (Std) Attempting to load Scheme from file 'VanillaSkin.scheme'.
05/05/2008 16:29:51 (Error) CEGUI::InvalidRequestException in file c:\downloads\cegui-0.6.0\cegui-0.6.0\src\ceguidefaultresourceprovider.cpp(54) : DefaultResourceProvider::load - VanillaSkin.scheme does not exist
05/05/2008 16:29:51 (Error) Scheme::Scheme - loading of Scheme from file 'VanillaSkin.scheme' failed.
From looking in my log file, I can see that it can't find the ".scheme" file. Something else which is also strange is that it's using the header file from "c:\downloads\cegui-0.6.0\cegui-0.6.0\src\ceguidefaultresourceprovider.cpp" but that's not where I have the include path set to
My "datafiles" directory is in the same directory as my exe, so it's like:
- Bla.exe
- datafiles/
