I try to use CEGUI 8.2 but I have some undefined references for :
- CEGUI::Imageset::d_defaultResourceGroup ;
- CEGUI::IrrlichtRender::bootstrapSystem ;
But I link with :
-lCEGUIBase-0
-lCEGUIIrrlichtRenderer-0
-lCEGUILuaScriptModule-0
And the link works because without I have some others undefined references.
My current code :
Code: Select all
class CIrrEngine
{
public:
CIrrEngine();
~CIrrEngine(void);
void launch(const std::string &);
void loadRessources(const std::string & path);
private:
irr::IrrlichtDevice * m_device;
CEGUI::LuaScriptModule & m_luaModule;
CEGUI::IrrlichtRenderer & m_renderer;
CEGUI::System * m_system;
};
Code: Select all
CIrrEngine::CIrrEngine()
: m_device( irr::createDevice(irr::video::EDT_OPENGL,
irr::core::dimension2d<irr::u32>(0,0), 16,
false, false, true, 0 ) ),
m_luaModule( CEGUI::LuaScriptModule::create() ),
m_renderer( CEGUI::IrrlichtRenderer::bootstrapSystem(*m_device) ),
m_system( CEGUI::System::getSingletonPtr() )
{
m_system->setScriptingModule(&m_luaModule);
}
CIrrEngine::~CIrrEngine(void)
{
CEGUI::IrrlichtRenderer::destroySystem();
CEGUI::LuaScriptModule::destroy(m_luaModule);
m_device->drop();
}
void CIrrEngine::launch(const std::string & file)
{
//m_luaModule.executeScriptFile(file, "lua_scripts");
m_luaModule.executeString("local player;\n"
"local myRoot;");
}
void CIrrEngine::loadRessources(const std::string & path)
{
CEGUI::DefaultResourceProvider * rp = \
static_cast<CEGUI::DefaultResourceProvider*>(m_system->getResourceProvider());
rp->setResourceGroupDirectory("schemes", path + "schemes/");
rp->setResourceGroupDirectory("imagesets", path + "imagesets/");
rp->setResourceGroupDirectory("fonts", path + "fonts/");
rp->setResourceGroupDirectory("layouts", path + "layouts/");
rp->setResourceGroupDirectory("looknfeels", path + "looknfeel/");
rp->setResourceGroupDirectory("lua_scripts", path + "lua_scripts/");
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");
}