|
|
@ -22,6 +22,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "ogreplugin.hpp"
|
|
|
|
#include "ogreplugin.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace bfs = boost::filesystem;
|
|
|
|
namespace bfs = boost::filesystem;
|
|
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
namespace
|
|
|
@ -82,6 +83,10 @@ namespace OgreInit
|
|
|
|
#ifdef ENABLE_PLUGIN_GL
|
|
|
|
#ifdef ENABLE_PLUGIN_GL
|
|
|
|
, mGLPlugin(NULL)
|
|
|
|
, mGLPlugin(NULL)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_GLES2
|
|
|
|
|
|
|
|
, mGLES2Plugin(NULL)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
, mD3D9Plugin(NULL)
|
|
|
|
, mD3D9Plugin(NULL)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -89,6 +94,9 @@ namespace OgreInit
|
|
|
|
|
|
|
|
|
|
|
|
Ogre::Root* OgreInit::init(const std::string &logPath)
|
|
|
|
Ogre::Root* OgreInit::init(const std::string &logPath)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
if (flag1==false)
|
|
|
|
|
|
|
|
{
|
|
|
|
// Set up logging first
|
|
|
|
// Set up logging first
|
|
|
|
new Ogre::LogManager;
|
|
|
|
new Ogre::LogManager;
|
|
|
|
Ogre::Log *log = Ogre::LogManager::getSingleton().createLog(logPath);
|
|
|
|
Ogre::Log *log = Ogre::LogManager::getSingleton().createLog(logPath);
|
|
|
@ -100,10 +108,10 @@ namespace OgreInit
|
|
|
|
|
|
|
|
|
|
|
|
// Disable logging to cout/cerr
|
|
|
|
// Disable logging to cout/cerr
|
|
|
|
log->setDebugOutputEnabled(false);
|
|
|
|
log->setDebugOutputEnabled(false);
|
|
|
|
|
|
|
|
}*/
|
|
|
|
mRoot = new Ogre::Root("", "", "");
|
|
|
|
mRoot = new Ogre::Root("", "", "");
|
|
|
|
|
|
|
|
|
|
|
|
#if defined(ENABLE_PLUGIN_GL) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
|
|
|
|
#if defined(ENABLE_PLUGIN_GL) || (ENABLE_PLUGIN_GLES2) || defined(ENABLE_PLUGIN_Direct3D9) || defined(ENABLE_PLUGIN_CgProgramManager) || defined(ENABLE_PLUGIN_OctreeSceneManager) || defined(ENABLE_PLUGIN_ParticleFX)
|
|
|
|
loadStaticPlugins();
|
|
|
|
loadStaticPlugins();
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
loadPlugins();
|
|
|
|
loadPlugins();
|
|
|
@ -133,6 +141,11 @@ namespace OgreInit
|
|
|
|
delete mGLPlugin;
|
|
|
|
delete mGLPlugin;
|
|
|
|
mGLPlugin = NULL;
|
|
|
|
mGLPlugin = NULL;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_GLES2
|
|
|
|
|
|
|
|
delete mGLES2Plugin;
|
|
|
|
|
|
|
|
mGLES2Plugin = NULL;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
delete mD3D9Plugin;
|
|
|
|
delete mD3D9Plugin;
|
|
|
|
mD3D9Plugin = NULL;
|
|
|
|
mD3D9Plugin = NULL;
|
|
|
@ -157,6 +170,11 @@ namespace OgreInit
|
|
|
|
mGLPlugin = new Ogre::GLPlugin();
|
|
|
|
mGLPlugin = new Ogre::GLPlugin();
|
|
|
|
mRoot->installPlugin(mGLPlugin);
|
|
|
|
mRoot->installPlugin(mGLPlugin);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_GLES2
|
|
|
|
|
|
|
|
mGLES2Plugin = new Ogre::GLES2Plugin();
|
|
|
|
|
|
|
|
mRoot->installPlugin(mGLES2Plugin);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
#ifdef ENABLE_PLUGIN_Direct3D9
|
|
|
|
mD3D9Plugin = new Ogre::D3D9Plugin();
|
|
|
|
mD3D9Plugin = new Ogre::D3D9Plugin();
|
|
|
|
mRoot->installPlugin(mD3D9Plugin);
|
|
|
|
mRoot->installPlugin(mD3D9Plugin);
|
|
|
|