[Scummvm-git-logs] scummvm master -> 264f6f037be6708e15b0bf1c57496c50076b91f6

aquadran aquadran at gmail.com
Sat Oct 10 12:12:16 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
264f6f037b ALL: Separate USE_OPENGL and USE_OPENG_GAME. Exclude WME3D for GLES2 for now.


Commit: 264f6f037be6708e15b0bf1c57496c50076b91f6
    https://github.com/scummvm/scummvm/commit/264f6f037be6708e15b0bf1c57496c50076b91f6
Author: Paweł Kołodziejski (aquadran at users.sourceforge.net)
Date: 2020-10-10T14:12:07+02:00

Commit Message:
ALL: Separate USE_OPENGL and USE_OPENG_GAME. Exclude WME3D for GLES2 for now.

Changed paths:
    backends/module.mk
    backends/platform/sdl/sdl.cpp
    backends/platform/sdl/sdl.h
    configure
    devtools/create_project/create_project.cpp
    engines/grim/gfx_base.cpp
    engines/grim/gfx_opengl.cpp
    engines/grim/gfx_opengl.h
    engines/grim/grim.cpp
    engines/myst3/gfx.cpp
    engines/myst3/gfx_opengl.cpp
    engines/myst3/gfx_opengl_texture.cpp
    engines/stark/gfx/driver.cpp
    engines/wintermute/base/base_game.cpp
    engines/wintermute/base/gfx/base_renderer3d.h
    engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
    engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
    engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
    engines/wintermute/base/gfx/opengl/base_render_opengl_texture.cpp
    engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h
    engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
    engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h
    engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.cpp
    engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h
    engines/wintermute/base/gfx/opengl/mesh3ds_opengl.cpp
    engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h
    engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.cpp
    engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h
    engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
    engines/wintermute/base/gfx/opengl/meshx_opengl.h
    engines/wintermute/base/gfx/opengl/meshx_opengl_shader.cpp
    engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h
    engines/wintermute/base/gfx/opengl/render_ticket.cpp
    engines/wintermute/base/gfx/opengl/render_ticket.h
    engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
    engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h
    engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.cpp
    engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h
    graphics/opengl/context.cpp
    graphics/opengl/framebuffer.cpp
    graphics/opengl/surfacerenderer.cpp
    graphics/opengl/system_headers.h
    graphics/opengl/texture.cpp
    graphics/opengl/tiledsurface.cpp
    graphics/renderer.cpp


diff --git a/backends/module.mk b/backends/module.mk
index cbe3acb186..568a4cd27e 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -157,7 +157,11 @@ endif
 
 ifdef USE_OPENGL
 MODULE_OBJS += \
-	graphics/openglsdl/openglsdl-graphics.o \
+	graphics/openglsdl/openglsdl-graphics.o
+endif
+
+ifdef USE_OPENGL_GAME
+MODULE_OBJS += \
 	graphics3d/openglsdl/openglsdl-graphics3d.o
 endif
 
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index bdd91032b9..7a43ee4c8b 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -52,9 +52,11 @@
 #include "backends/graphics3d/surfacesdl/surfacesdl-graphics3d.h"
 #ifdef USE_OPENGL
 #include "backends/graphics/openglsdl/openglsdl-graphics.h"
+#include "graphics/cursorman.h"
+#endif
+#ifdef USE_OPENGL_GAME
 #include "backends/graphics3d/openglsdl/openglsdl-graphics3d.h"
 #include "graphics/opengl/context.h"
-#include "graphics/cursorman.h"
 #endif
 #include "graphics/renderer.h"
 
@@ -214,7 +216,7 @@ void OSystem_SDL::initBackend() {
 #endif
 	debug(1, "Using SDL Video Driver \"%s\"", sdlDriverName);
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 	detectFramebufferSupport();
 	detectAntiAliasingSupport();
 #endif
@@ -304,7 +306,7 @@ void OSystem_SDL::initBackend() {
 	}
 }
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 void OSystem_SDL::detectFramebufferSupport() {
 	_capabilities.openGLFrameBuffer = false;
 #if defined(USE_GLES2)
@@ -380,7 +382,7 @@ void OSystem_SDL::detectAntiAliasingSupport() {
 	SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
 }
 
-#endif // USE_OPENGL
+#endif // USE_OPENGL_GAME
 
 void OSystem_SDL::engineInit() {
 #if SDL_VERSION_ATLEAST(2, 0, 0)
@@ -486,7 +488,7 @@ void OSystem_SDL::setWindowCaption(const char *caption) {
 	_window->setWindowCaption(cap);
 }
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 Common::Array<uint> OSystem_SDL::getSupportedAntiAliasingLevels() const {
 	return _capabilities.openGLAntiAliasLevels;
 }
@@ -784,6 +786,7 @@ bool OSystem_SDL::setGraphicsMode(int mode, uint flags) {
 			delete sdlGraphicsManager;
 		}
 
+#ifdef USE_OPENGL_GAME
 		if (accel3d && !dynamic_cast<OpenGLSdlGraphics3dManager *>(sdlGraphics3dManager)) {
 			if (sdlGraphics3dManager) {
 				sdlGraphics3dManager->deactivateManager();
@@ -794,7 +797,9 @@ bool OSystem_SDL::setGraphicsMode(int mode, uint flags) {
 			if (sdlGraphicsManager)
 				sdlGraphics3dManager->setDefaultFeatureState();
 			switchedManager = true;
-		} else if (!accel3d && !dynamic_cast<SurfaceSdlGraphics3dManager *>(sdlGraphics3dManager)) {
+		} else
+#endif
+		if (!accel3d && !dynamic_cast<SurfaceSdlGraphics3dManager *>(sdlGraphics3dManager)) {
 			if (sdlGraphics3dManager) {
 				sdlGraphics3dManager->deactivateManager();
 				delete sdlGraphics3dManager;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index c6b366ab8c..d1e4fdc5bd 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -36,7 +36,7 @@
 #ifdef USE_DISCORD
 class DiscordPresence;
 #endif
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 #include "backends/graphics3d/openglsdl/openglsdl-graphics3d.h"
 #endif
 
@@ -90,7 +90,7 @@ public:
 	//Screenshots
 	virtual Common::String getScreenshotsPath();
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 	Common::Array<uint> getSupportedAntiAliasingLevels() const override;
 #endif
 
@@ -128,7 +128,7 @@ protected:
 
 	SdlGraphicsManager::State _gfxManagerState;
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 	// Graphics capabilities
 	void detectFramebufferSupport();
 	void detectAntiAliasingSupport();
diff --git a/configure b/configure
index 29c0782c86..d5cadcffd6 100755
--- a/configure
+++ b/configure
@@ -5459,9 +5459,8 @@ EOF
 	cc_check_clean
 fi
 
-# Make sure both flags are synced to proper compile with USE_OPENGL
-if test "$_opengl" = "no" || test "$_opengl_game" = "no" ; then
-	_opengl=no
+# If 2d sdl gfx backend has no opengl we will not enable opengl in games due lack of gfx dynamic switch
+if test "$_opengl" = "no" ; then
 	_opengl_game=no
 	_opengles2=no
 	_glew=no
@@ -5480,6 +5479,7 @@ else
 fi
 
 define_in_config_if_yes "$_opengl" "USE_OPENGL"
+define_in_config_if_yes "$_opengl_game" "USE_OPENGL_GAME"
 define_in_config_if_yes "$_opengles2" "USE_GLES2"
 define_in_config_if_yes "$_opengl_shaders" "USE_OPENGL_SHADERS"
 
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 07463b3f1f..242dd9e9f9 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1053,8 +1053,9 @@ const Feature s_features[] = {
 	{              "lua",                       "USE_LUA", false, true,  "lua" },
 	{             "nasm",                      "USE_NASM", false, true,  "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
 	{           "opengl",                    "USE_OPENGL", false, true,  "OpenGL support" },
-	{    "openglshaders",            "USE_OPENGL_SHADERS", false, true,  "OpenGL support (shaders)" },
-	{         "opengles",                      "USE_GLES", false, true,  "forced OpenGL ES mode" },
+	{      "opengl_game",               "USE_OPENGL_GAME", false, true,  "OpenGL support in 3d games" },
+	{   "opengl_shaders",            "USE_OPENGL_SHADERS", false, true,  "OpenGL support (shaders) in 3d games" },
+	{         "opengles",                      "USE_GLES", false, true,  "forced OpenGL ES mode in 3d games" },
 	{          "taskbar",                   "USE_TASKBAR", false, true,  "Taskbar integration support" },
 	{            "cloud",                     "USE_CLOUD", false, true,  "Cloud integration support" },
 	{      "translation",               "USE_TRANSLATION", false, true,  "Translation support" },
diff --git a/engines/grim/gfx_base.cpp b/engines/grim/gfx_base.cpp
index 14bd0ce6fe..804bbf79e7 100644
--- a/engines/grim/gfx_base.cpp
+++ b/engines/grim/gfx_base.cpp
@@ -109,12 +109,12 @@ void GfxBase::drawMesh(const Mesh *mesh) {
 		mesh->_faces[i].draw(mesh);
 }
 
-#ifndef USE_OPENGL
+#ifndef USE_OPENGL_GAME
 // Allow CreateGfxOpenGL to be called even if OpenGL isn't included
 GfxBase *CreateGfxOpenGL() {
 	return CreateGfxTinyGL();
 }
-#endif // USE_OPENGL
+#endif // USE_OPENGL_GAME
 
 Math::Matrix4 GfxBase::makeLookMatrix(const Math::Vector3d& pos, const Math::Vector3d& interest, const Math::Vector3d& up) {
 	Math::Vector3d f = (interest - pos).getNormalized();
diff --git a/engines/grim/gfx_opengl.cpp b/engines/grim/gfx_opengl.cpp
index d8d972c94d..59438d7d5d 100644
--- a/engines/grim/gfx_opengl.cpp
+++ b/engines/grim/gfx_opengl.cpp
@@ -24,7 +24,7 @@
 #include "common/system.h"
 #include "common/config-manager.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "graphics/surface.h"
 #include "graphics/pixelbuffer.h"
diff --git a/engines/grim/gfx_opengl.h b/engines/grim/gfx_opengl.h
index 956f1dd0f7..907884586e 100644
--- a/engines/grim/gfx_opengl.h
+++ b/engines/grim/gfx_opengl.h
@@ -25,7 +25,7 @@
 
 #include "engines/grim/gfx_base.h"
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 
 #ifdef USE_GLEW
 #include <GL/glew.h>
diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp
index 0cb6869c0f..6dbf1a07d1 100644
--- a/engines/grim/grim.cpp
+++ b/engines/grim/grim.cpp
@@ -41,7 +41,7 @@
 #include "graphics/pixelbuffer.h"
 #include "graphics/renderer.h"
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 #include "graphics/opengl/context.h"
 #endif
 
@@ -271,7 +271,7 @@ GfxBase *GrimEngine::createRenderer(int screenW, int screenH, bool fullscreen) {
 	_softRenderer = matchingRendererType == Graphics::kRendererTypeTinyGL;
 	initGraphics3d(screenW, screenH, fullscreen, !_softRenderer);
 
-#if defined(USE_OPENGL)
+#if defined(USE_OPENGL_GAME)
 	// Check the OpenGL context actually supports shaders
 	if (matchingRendererType == Graphics::kRendererTypeOpenGLShaders && !OpenGLContext.shadersSupported) {
 		matchingRendererType = Graphics::kRendererTypeOpenGL;
@@ -289,7 +289,7 @@ GfxBase *GrimEngine::createRenderer(int screenW, int screenH, bool fullscreen) {
 		renderer = CreateGfxOpenGLShader();
 	}
 #endif
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 	if (matchingRendererType == Graphics::kRendererTypeOpenGL) {
 		renderer = CreateGfxOpenGL();
 	}
diff --git a/engines/myst3/gfx.cpp b/engines/myst3/gfx.cpp
index 063fbd3f2d..85afd68b50 100644
--- a/engines/myst3/gfx.cpp
+++ b/engines/myst3/gfx.cpp
@@ -29,7 +29,7 @@
 #include "graphics/renderer.h"
 #include "graphics/surface.h"
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 #include "graphics/opengl/context.h"
 #endif
 
@@ -206,7 +206,7 @@ Renderer *createRenderer(OSystem *system) {
 
 	initGraphics3d(width, height, fullscreen, isAccelerated);
 
-#if defined(USE_OPENGL)
+#if defined(USE_OPENGL_GAME)
 	// Check the OpenGL context actually supports shaders
 	if (matchingRendererType == Graphics::kRendererTypeOpenGLShaders && !OpenGLContext.shadersSupported) {
 		matchingRendererType = Graphics::kRendererTypeOpenGL;
@@ -223,7 +223,7 @@ Renderer *createRenderer(OSystem *system) {
 		return CreateGfxOpenGLShader(system);
 	}
 #endif
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 	if (matchingRendererType == Graphics::kRendererTypeOpenGL) {
 		return CreateGfxOpenGL(system);
 	}
diff --git a/engines/myst3/gfx_opengl.cpp b/engines/myst3/gfx_opengl.cpp
index 6268843169..c6568c6fa6 100644
--- a/engines/myst3/gfx_opengl.cpp
+++ b/engines/myst3/gfx_opengl.cpp
@@ -23,7 +23,7 @@
 #include "common/rect.h"
 #include "common/textconsole.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "graphics/colormasks.h"
 #include "graphics/opengl/context.h"
diff --git a/engines/myst3/gfx_opengl_texture.cpp b/engines/myst3/gfx_opengl_texture.cpp
index 6197a81994..e33c37f483 100644
--- a/engines/myst3/gfx_opengl_texture.cpp
+++ b/engines/myst3/gfx_opengl_texture.cpp
@@ -22,7 +22,7 @@
 
 #include "common/scummsys.h"
 
-#if defined(USE_OPENGL) || defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_GAME) || defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
 
 #include "engines/myst3/gfx_opengl_texture.h"
 
diff --git a/engines/stark/gfx/driver.cpp b/engines/stark/gfx/driver.cpp
index 6cb2173aff..618d6b1e42 100644
--- a/engines/stark/gfx/driver.cpp
+++ b/engines/stark/gfx/driver.cpp
@@ -26,7 +26,7 @@
 #include "common/config-manager.h"
 
 #include "graphics/surface.h"
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 #include "graphics/opengl/context.h"
 #endif
 
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index cd0f99e730..ae6550e9ec 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -505,12 +505,12 @@ bool BaseGame::initialize2() { // we know whether we are going to be accelerated
 	Common::String rendererConfig = ConfMan.get("renderer");
 	Graphics::RendererType desiredRendererType = Graphics::parseRendererTypeCode(rendererConfig);
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 	if (desiredRendererType == Graphics::kRendererTypeOpenGLShaders) {
 		_renderer3D = makeOpenGL3DShaderRenderer(this);
 	}
 #endif // defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 	if (desiredRendererType == Graphics::kRendererTypeOpenGL) {
 		_renderer3D = makeOpenGL3DRenderer(this);
 	}
diff --git a/engines/wintermute/base/gfx/base_renderer3d.h b/engines/wintermute/base/gfx/base_renderer3d.h
index 8f27061da2..6a7a761219 100644
--- a/engines/wintermute/base/gfx/base_renderer3d.h
+++ b/engines/wintermute/base/gfx/base_renderer3d.h
@@ -32,7 +32,7 @@
 #include "math/matrix4.h"
 #include "math/ray.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "graphics/opengl/system_headers.h"
 #include "graphics/opengl/texture.h"
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
index 1a0ed7d5ba..4e28ebe789 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.cpp
@@ -29,7 +29,7 @@
 #include "graphics/opengl/system_headers.h"
 #include "math/glmath.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h"
@@ -241,7 +241,7 @@ void BaseRenderOpenGL3D::setWindowed(bool windowed) {
 }
 
 void BaseRenderOpenGL3D::fadeToColor(byte r, byte g, byte b, byte a) {
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 #endif // defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
 
@@ -612,7 +612,7 @@ bool BaseRenderOpenGL3D::drawSpriteEx(BaseSurfaceOpenGL3D &tex, const Wintermute
 
 	// The ShaderSurfaceRenderer sets an array buffer which appearently conflicts with us
 	// Reset it!
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 #endif // defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
 
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
index fbbd260fca..39237e1475 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d.h
@@ -155,6 +155,6 @@ private:
 
 } // wintermute namespace
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #endif
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
index 9291331675..a522984f37 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.cpp
@@ -28,7 +28,7 @@
 #include "graphics/opengl/system_headers.h"
 #include "math/glmath.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h"
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h"
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
index a7943d19a0..be910b348e 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl3d_shader.h
@@ -33,7 +33,7 @@
 #include "math/matrix4.h"
 #include "math/ray.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "graphics/opengl/shader.h"
 
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.cpp b/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.cpp
index 3f58248b28..fd84f204db 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.cpp
@@ -36,7 +36,7 @@
 #include "common/config-manager.h"
 #include "graphics/transparent_surface.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "graphics/opengl/texture.h"
 #include "graphics/opengl/surfacerenderer.h"
diff --git a/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h b/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h
index 9141bd3f47..ba13fff404 100644
--- a/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h
+++ b/engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h
@@ -35,7 +35,7 @@
 #include "common/list.h"
 #include "graphics/transform_struct.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 class BaseSurfaceOpenGLTexture;
diff --git a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
index ed9e1ed405..d768627821 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.cpp
@@ -24,7 +24,7 @@
 #include "engines/wintermute/base/gfx/base_image.h"
 #include "graphics/transparent_surface.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl3d.h"
@@ -307,4 +307,4 @@ void BaseSurfaceOpenGL3D::setTexture() {
 
 } // End of namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
diff --git a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h
index 12ab371eb1..920fb2f338 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h
@@ -26,7 +26,7 @@
 #include "engines/wintermute/base/gfx/base_surface.h"
 #include "graphics/opengl/texture.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 
diff --git a/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.cpp b/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.cpp
index 4e32a5035d..5ea4dacb83 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.cpp
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.cpp
@@ -38,7 +38,7 @@
 #include "common/stream.h"
 #include "common/system.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h"
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl_texture.h"
@@ -487,4 +487,4 @@ bool BaseSurfaceOpenGLTexture::putSurface(const Graphics::Surface &surface, bool
 
 } // End of namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
diff --git a/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h b/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h
index 7f106bab24..f6c94a3e37 100644
--- a/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h
+++ b/engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h
@@ -34,7 +34,7 @@
 #include "engines/wintermute/base/gfx/base_surface.h"
 #include "common/list.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 struct TransparentSurface;
@@ -113,6 +113,6 @@ private:
 
 } // End of namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #endif
diff --git a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.cpp b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.cpp
index 277df6b6b9..7a95c581c1 100644
--- a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.cpp
@@ -23,7 +23,7 @@
 #include "engines/wintermute/wintypes.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h"
 
@@ -51,4 +51,4 @@ void Mesh3DSOpenGL::render() {
 
 } // namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
diff --git a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h
index 5fb5ba17f2..39e1d0b384 100644
--- a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h
+++ b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl.h
@@ -25,7 +25,7 @@
 
 #include "engines/wintermute/base/gfx/3ds/mesh3ds.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 
@@ -39,6 +39,6 @@ public:
 
 } // namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #endif
diff --git a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.cpp b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.cpp
index 237f3b85e9..8d4ea319ae 100644
--- a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.cpp
@@ -23,7 +23,7 @@
 #include "engines/wintermute/wintypes.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h"
 
diff --git a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h
index ea94b196c3..cd2ff7516a 100644
--- a/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h
+++ b/engines/wintermute/base/gfx/opengl/mesh3ds_opengl_shader.h
@@ -25,7 +25,7 @@
 
 #include "engines/wintermute/base/gfx/3ds/mesh3ds.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "graphics/opengl/shader.h"
 
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
index 6b4cded0b2..af7368ad49 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl.cpp
@@ -29,7 +29,7 @@
 #include "engines/wintermute/base/gfx/x/material.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/meshx_opengl.h"
@@ -82,4 +82,4 @@ bool MeshXOpenGL::render(ModelX *model) {
 
 } // namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl.h b/engines/wintermute/base/gfx/opengl/meshx_opengl.h
index e6521321a4..edfed5f533 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl.h
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl.h
@@ -31,7 +31,7 @@
 
 #include "engines/wintermute/base/gfx/x/meshx.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.cpp b/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.cpp
index c9fa598b8d..24916bf5af 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.cpp
@@ -29,7 +29,7 @@
 #include "engines/wintermute/base/gfx/x/material.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h"
diff --git a/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h b/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h
index b08e856b7a..287bb40201 100644
--- a/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h
+++ b/engines/wintermute/base/gfx/opengl/meshx_opengl_shader.h
@@ -31,7 +31,7 @@
 
 #include "engines/wintermute/base/gfx/x/meshx.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "graphics/opengl/shader.h"
 
diff --git a/engines/wintermute/base/gfx/opengl/render_ticket.cpp b/engines/wintermute/base/gfx/opengl/render_ticket.cpp
index 598a3bacdd..bddc614f47 100644
--- a/engines/wintermute/base/gfx/opengl/render_ticket.cpp
+++ b/engines/wintermute/base/gfx/opengl/render_ticket.cpp
@@ -31,7 +31,7 @@
 #include "graphics/transform_tools.h"
 #include "common/textconsole.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/render_ticket.h"
 #include "engines/wintermute/base/gfx/opengl/base_surface_opengl_texture.h"
@@ -208,4 +208,4 @@ void RenderTicketOpenGL::drawToSurface(Graphics::Surface *_targetSurface, Common
 
 } // End of namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
diff --git a/engines/wintermute/base/gfx/opengl/render_ticket.h b/engines/wintermute/base/gfx/opengl/render_ticket.h
index 89059dd594..8c156fc18a 100644
--- a/engines/wintermute/base/gfx/opengl/render_ticket.h
+++ b/engines/wintermute/base/gfx/opengl/render_ticket.h
@@ -33,7 +33,7 @@
 #include "graphics/surface.h"
 #include "common/rect.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 
@@ -79,6 +79,6 @@ private:
 
 } // End of namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #endif
diff --git a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
index 4bbca0b715..250ec868b8 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.cpp
@@ -30,7 +30,7 @@
 #include "engines/wintermute/dcgf.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h"
diff --git a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h
index 9b397d32a6..3b021ab3ec 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl.h
@@ -31,7 +31,7 @@
 
 #include "engines/wintermute/base/gfx/shadow_volume.h"
 
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 namespace Wintermute {
 
@@ -51,6 +51,6 @@ private:
 
 } // namespace Wintermute
 
-#endif // defined(USE_OPENGL) && !defined(USE_GLES2)
+#endif // defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 
 #endif
diff --git a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.cpp b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.cpp
index 74a5acf60c..4e7e5c8318 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.cpp
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.cpp
@@ -30,7 +30,7 @@
 #include "engines/wintermute/dcgf.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "engines/wintermute/base/gfx/opengl/base_render_opengl3d.h"
 #include "engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h"
diff --git a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h
index 850edccea8..daa22c2bb2 100644
--- a/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h
+++ b/engines/wintermute/base/gfx/opengl/shadow_volume_opengl_shader.h
@@ -32,7 +32,7 @@
 #include "engines/wintermute/base/gfx/shadow_volume.h"
 #include "graphics/opengl/system_headers.h"
 
-#if defined(USE_GLES2) || defined(USE_OPENGL_SHADERS)
+#if defined(USE_OPENGL_SHADERS)
 
 #include "graphics/opengl/shader.h"
 
diff --git a/graphics/opengl/context.cpp b/graphics/opengl/context.cpp
index cd55381374..051a1547dc 100644
--- a/graphics/opengl/context.cpp
+++ b/graphics/opengl/context.cpp
@@ -29,7 +29,7 @@
 
 #include "graphics/opengl/system_headers.h"
 
-#ifdef USE_OPENGL
+#ifdef USE_OPENGL_GAME
 
 namespace Common {
 DECLARE_SINGLETON(OpenGL::ContextGL);
diff --git a/graphics/opengl/framebuffer.cpp b/graphics/opengl/framebuffer.cpp
index 2cde9b2654..5cbd8b6f7b 100644
--- a/graphics/opengl/framebuffer.cpp
+++ b/graphics/opengl/framebuffer.cpp
@@ -23,7 +23,7 @@
 #include "common/textconsole.h"
 #include "common/util.h"
 
-#if defined(USE_OPENGL) && !defined(AMIGAOS)
+#if defined(USE_OPENGL_GAME) && !defined(AMIGAOS)
 
 #if defined(SDL_BACKEND) && !defined(USE_GLEW) && !defined(USE_GLES2)
 #define GL_GLEXT_PROTOTYPES // For the GL_EXT_framebuffer_object extension
diff --git a/graphics/opengl/surfacerenderer.cpp b/graphics/opengl/surfacerenderer.cpp
index b1090860f1..060561b20f 100644
--- a/graphics/opengl/surfacerenderer.cpp
+++ b/graphics/opengl/surfacerenderer.cpp
@@ -22,7 +22,7 @@
 
 #include "common/scummsys.h"
 
-#if defined(USE_OPENGL)
+#if defined(USE_OPENGL_GAME)
 
 #include "graphics/opengl/surfacerenderer.h"
 
diff --git a/graphics/opengl/system_headers.h b/graphics/opengl/system_headers.h
index 7725b5ab5d..c6b21e3a4a 100644
--- a/graphics/opengl/system_headers.h
+++ b/graphics/opengl/system_headers.h
@@ -48,9 +48,9 @@
 
 #elif defined(USE_GLEW)
 #include <GL/glew.h>
-#elif defined(SDL_BACKEND) && defined(USE_OPENGL)
+#elif defined(SDL_BACKEND) && defined(USE_OPENGL_GAME)
 #include <SDL_opengl.h>
-#elif defined(USE_OPENGL)
+#elif defined(USE_OPENGL_GAME)
 #include <GL/gl.h>
 #endif
 
diff --git a/graphics/opengl/texture.cpp b/graphics/opengl/texture.cpp
index 95b6b8cf9c..89cac50a20 100644
--- a/graphics/opengl/texture.cpp
+++ b/graphics/opengl/texture.cpp
@@ -22,7 +22,7 @@
 
 #include "common/textconsole.h"
 
-#if defined(USE_OPENGL)
+#if defined(USE_OPENGL_GAME)
 
 #include "graphics/opengl/texture.h"
 #include "graphics/opengl/context.h"
diff --git a/graphics/opengl/tiledsurface.cpp b/graphics/opengl/tiledsurface.cpp
index 98f984f007..9c711f2c3c 100644
--- a/graphics/opengl/tiledsurface.cpp
+++ b/graphics/opengl/tiledsurface.cpp
@@ -22,7 +22,7 @@
 
 #include "common/textconsole.h"
 
-#if defined(USE_OPENGL)
+#if defined(USE_OPENGL_GAME)
 
 #include "graphics/opengl/tiledsurface.h"
 
diff --git a/graphics/renderer.cpp b/graphics/renderer.cpp
index 8f61beb917..64f55a2635 100644
--- a/graphics/renderer.cpp
+++ b/graphics/renderer.cpp
@@ -27,7 +27,7 @@
 namespace Graphics {
 
 static const RendererTypeDescription rendererTypes[] = {
-#if defined(USE_OPENGL) && !defined(USE_GLES2)
+#if defined(USE_OPENGL_GAME) && !defined(USE_GLES2)
 	{ "opengl", _s("OpenGL"), kRendererTypeOpenGL },
 #endif
 #if defined(USE_OPENGL_SHADERS) || defined(USE_GLES2)
@@ -76,13 +76,13 @@ RendererType getBestMatchingAvailableRendererType(RendererType desired) {
 	}
 #endif
 
-#if (!defined(USE_OPENGL) && defined(USE_OPENGL_SHADERS)) || defined(USE_GLES2)
+#if (!defined(USE_OPENGL_GAME) && defined(USE_OPENGL_SHADERS)) || defined(USE_GLES2)
 	if (desired == kRendererTypeOpenGL) {
 		desired = kRendererTypeOpenGLShaders;
 	}
 #endif
 
-#if !defined(USE_OPENGL) && !defined(USE_GLES2) && !defined(USE_OPENGL_SHADERS)
+#if !defined(USE_OPENGL_GAME) && !defined(USE_GLES2) && !defined(USE_OPENGL_SHADERS)
 	if (desired == kRendererTypeOpenGL || desired == kRendererTypeOpenGLShaders) {
 		desired = kRendererTypeTinyGL;
 	}




More information about the Scummvm-git-logs mailing list