Esempio n. 1
0
//------------------------------------------------------------------------------
bool wxOgreResources::LoadResourceFile(const Ogre::String& file)
{
    Ogre::ConfigFile cf;
    cf.load(file);
    Ogre::ConfigFile::SectionIterator it = cf.getSectionIterator();

    Ogre::String location, type, group;
    while (it.hasMoreElements()) {
        group = it.peekNextKey();
        Ogre::ConfigFile::SettingsMultiMap *settings = it.getNext();
        Ogre::ConfigFile::SettingsMultiMap::iterator i;

        for (i = settings->begin(); i != settings->end(); ++i) {
            type = i->first;
            location = i->second;

            try {
                m_rmgr->addResourceLocation(location, type, group);
            } catch (Ogre::Exception& e) {
                wxOgreExceptionBox(e);
                return false;
            }
        }
    }

    return true;
}
Esempio n. 2
0
//------------------------------------------------------------------------------
void wxOgreResources::InitialiseAllResources()
{
    try {
        m_rmgr->initialiseAllResourceGroups();
    } catch (Ogre::Exception& e) {
        wxOgreExceptionBox(e);
    }
}
Esempio n. 3
0
//------------------------------------------------------------------------------
void wxOgreResources::AddResource(const Ogre::String& p, const Ogre::String& t,
                                  const Ogre::String& g)
{
    try {
        m_rmgr->addResourceLocation(p, t, g);
    } catch (Ogre::Exception& e) {
        wxOgreExceptionBox(e);
    }
}
//------------------------------------------------------------------------------
void wxOgreRenderSystem::LoadPlugin(const Ogre::String& plugin)
{
    try {
#if WXOGRE_DEBUG and OGRE_PLATFORM == OGRE_PLATFORM_WINDOWS
		m_root->loadPlugin(OGRE_PLUGINDIR + plugin + "_d");
#else
		m_root->loadPlugin(OGRE_PLUGINDIR + plugin);
#endif
	} catch (Ogre::Exception& e) {
        wxOgreExceptionBox(e);
    }
}