Move specification of RenderingMethod into renderengine

This commit is contained in:
Alexander Bock
2015-05-28 20:44:12 +02:00
parent 1923558f6c
commit 37a54ab22b
3 changed files with 15 additions and 11 deletions
+9 -1
View File
@@ -47,6 +47,7 @@
#include <openspace/util/syncbuffer.h>
#include <ghoul/filesystem/filesystem.h>
#include <ghoul/misc/sharedmemory.h>
#include <openspace/engine/configurationmanager.h>
#include <ghoul/io/texture/texturereader.h>
#ifdef GHOUL_USE_DEVIL
@@ -76,6 +77,9 @@
namespace {
const std::string _loggerCat = "RenderEngine";
const std::string KeyRenderingMethod = "RenderingMethod";
const std::string DefaultRenderingMethod = "ABufferSingleLinked";
const std::map<std::string, int> RenderingMethods = {
{ "ABufferFrameBuffer", ABUFFER_FRAMEBUFFER},
{ "ABufferSingleLinked", ABUFFER_SINGLE_LINKED },
@@ -130,7 +134,11 @@ RenderEngine::~RenderEngine() {
ghoul::SharedMemory::remove(PerformanceMeasurementSharedData);
}
bool RenderEngine::initialize(const std::string& renderingMethod) {
bool RenderEngine::initialize() {
std::string renderingMethod = DefaultRenderingMethod;
if (OsEng.configurationManager()->hasKeyAndValue<std::string>(KeyRenderingMethod))
renderingMethod = OsEng.configurationManager()->value<std::string>(KeyRenderingMethod);
auto it = RenderingMethods.find(renderingMethod);
if (it == RenderingMethods.end()) {
LFATAL("Rendering method '" << renderingMethod << "' not among the available "