Allow changing OpenGL RTT mode, useful for example if the driver reports incorrect capabilities

This commit is contained in:
scrawl 2012-09-19 19:34:02 +02:00
parent 4b5706d652
commit 32de090079
4 changed files with 10 additions and 0 deletions

View file

@ -299,6 +299,7 @@ void OMW::Engine::go()
mOgre->configure( mOgre->configure(
mCfgMgr.getLogPath().string(), mCfgMgr.getLogPath().string(),
renderSystem, renderSystem,
Settings::Manager::getString("opengl rtt mode", "Video"),
false); false);
// This has to be added BEFORE MyGUI is initialized, as it needs // This has to be added BEFORE MyGUI is initialized, as it needs

View file

@ -24,6 +24,10 @@ antialiasing = none
vsync = false vsync = false
# opengl render to texture mode, valid options:
# PBuffer, FBO, Copy
opengl rtt mode = FBO
[GUI] [GUI]
# 1 is fully opaque # 1 is fully opaque
menu transparency = 0.84 menu transparency = 0.84

View file

@ -145,6 +145,7 @@ float OgreRenderer::getFPS()
void OgreRenderer::configure(const std::string &logPath, void OgreRenderer::configure(const std::string &logPath,
const std::string& renderSystem, const std::string& renderSystem,
const std::string& rttMode,
bool _logging) bool _logging)
{ {
// Set up logging first // Set up logging first
@ -198,6 +199,9 @@ void OgreRenderer::configure(const std::string &logPath,
if (rs == 0) if (rs == 0)
throw std::runtime_error ("RenderSystem with name " + renderSystem + " not found, make sure the plugins are loaded"); throw std::runtime_error ("RenderSystem with name " + renderSystem + " not found, make sure the plugins are loaded");
mRoot->setRenderSystem(rs); mRoot->setRenderSystem(rs);
if (rs->getName().find("OpenGL") != std::string::npos)
rs->setConfigOption ("RTT Preferred Mode", rttMode);
} }
void OgreRenderer::createWindow(const std::string &title, const WindowSettings& settings) void OgreRenderer::createWindow(const std::string &title, const WindowSettings& settings)

View file

@ -132,6 +132,7 @@ namespace OEngine
void configure( void configure(
const std::string &logPath, // Path to directory where to store log files const std::string &logPath, // Path to directory where to store log files
const std::string &renderSystem, const std::string &renderSystem,
const std::string &rttMode,
bool _logging); // Enable or disable logging bool _logging); // Enable or disable logging
/// Create a window with the given title /// Create a window with the given title