From cfb3c8eadc03f2a549dd6d727c3b426075a6d82e Mon Sep 17 00:00:00 2001 From: Stefano Musumeci Date: Sun, 22 Jun 2014 21:46:50 +0200 Subject: [PATCH] MYST3: Added openGL shader renderer selection. --- engines/myst3/gfx.h | 1 + engines/myst3/gfx_opengl_shaders.cpp | 4 ++++ engines/myst3/myst3.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/engines/myst3/gfx.h b/engines/myst3/gfx.h index eb8dbf7d3db..3ee855c03eb 100644 --- a/engines/myst3/gfx.h +++ b/engines/myst3/gfx.h @@ -103,6 +103,7 @@ protected: }; Renderer *CreateGfxOpenGL(OSystem *system); +Renderer *CreateGfxOpenGLShader(OSystem *system); Renderer *CreateGfxTinyGL(OSystem *system); } // end of namespace Myst3 diff --git a/engines/myst3/gfx_opengl_shaders.cpp b/engines/myst3/gfx_opengl_shaders.cpp index 45fe76af8a0..5ac62ebf125 100644 --- a/engines/myst3/gfx_opengl_shaders.cpp +++ b/engines/myst3/gfx_opengl_shaders.cpp @@ -63,6 +63,10 @@ namespace Myst3 { +Renderer *CreateGfxOpenGLShader(OSystem *system) { + return new ShaderRenderer(system); +} + Renderer *Renderer::createRenderer(OSystem *system) { return new ShaderRenderer(system); } diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp index f0e1212b18f..528162954f8 100644 --- a/engines/myst3/myst3.cpp +++ b/engines/myst3/myst3.cpp @@ -154,7 +154,11 @@ Common::Error Myst3Engine::run() { if (softRenderer) { _gfx = CreateGfxTinyGL(_system); } else { +#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS) + _gfx = CreateGfxOpenGLShader(_system); +#else _gfx = CreateGfxOpenGL(_system); +#endif } _sound = new Sound(this); _ambient = new Ambient(this);