1
General discussions / Re: Using SFML 2.1 for Window, Input, ... with Ogre3D Example(Working)
« on: November 12, 2013, 06:29:13 am »You should put this on the SFML wiki. And maybe even tidy up your overall code style (comments, code indenting, commented code, ect)
I plan on it, this was a quick post just to get the example online so it doesn't get lost.
I am going to modify the example with the following snippet I wrote in order to do away with the "Ogre Config Dialog"
#if defined OIS_LINUX_PLATFORM
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_ParticleFX");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_CgProgramManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_OctreeSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_PCZSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_OctreeZone");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_BSPSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/RenderSystem_GL");
#endif
Ogre::RenderSystemList::const_iterator renderers = mRoot->getAvailableRenderers().begin();
while(renderers != mRoot->getAvailableRenderers().end())
{
Ogre::String rName = (*renderers)->getName();
if (rName == "OpenGL Rendering Subsystem")
break;
renderers++;
}
Ogre::RenderSystem *renderSystem = *renderers;
renderSystem->setConfigOption("Full Screen","No");
renderSystem->setConfigOption("Video Mode","1024 x 768 @ 32-bit colour");
renderSystem->setConfigOption("Display Frequency","50 Hz");
renderSystem->setConfigOption("FSAA","16");
renderSystem->setConfigOption("Fixed Pipeline Enabled","Yes");
renderSystem->setConfigOption("RTT Preferred Mode","FBO");
renderSystem->setConfigOption("VSync","No");
renderSystem->setConfigOption("sRGB Gamma Conversion","No");
mRoot->setRenderSystem(renderSystem);
// Create a render window
mWindow = mRoot->initialise(true, "MyGame v0.0.1");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_ParticleFX");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_CgProgramManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_OctreeSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_PCZSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_OctreeZone");
mRoot->loadPlugin("/usr/lib/OGRE/Plugin_BSPSceneManager");
mRoot->loadPlugin("/usr/lib/OGRE/RenderSystem_GL");
#endif
Ogre::RenderSystemList::const_iterator renderers = mRoot->getAvailableRenderers().begin();
while(renderers != mRoot->getAvailableRenderers().end())
{
Ogre::String rName = (*renderers)->getName();
if (rName == "OpenGL Rendering Subsystem")
break;
renderers++;
}
Ogre::RenderSystem *renderSystem = *renderers;
renderSystem->setConfigOption("Full Screen","No");
renderSystem->setConfigOption("Video Mode","1024 x 768 @ 32-bit colour");
renderSystem->setConfigOption("Display Frequency","50 Hz");
renderSystem->setConfigOption("FSAA","16");
renderSystem->setConfigOption("Fixed Pipeline Enabled","Yes");
renderSystem->setConfigOption("RTT Preferred Mode","FBO");
renderSystem->setConfigOption("VSync","No");
renderSystem->setConfigOption("sRGB Gamma Conversion","No");
mRoot->setRenderSystem(renderSystem);
// Create a render window
mWindow = mRoot->initialise(true, "MyGame v0.0.1");