From dcd7364559e20e7d89ffeee0740b60a65c8d5362 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Dec 2015 16:32:22 +0300 Subject: Move OpenGL functions related files into opengl directory. --- src/CMakeLists.txt | 22 +- src/Makefile.am | 22 +- src/graphicsmanager.cpp | 11 +- src/gui/widgets/desktop.cpp | 2 +- src/gui/windows/chatwindow.cpp | 2 +- src/render/graphics.cpp | 2 +- src/render/mgl.cpp | 32 --- src/render/mgl.h | 38 --- src/render/mgl.hpp | 141 ----------- src/render/mglcheck.h | 31 --- src/render/mgldefines.h | 131 ---------- src/render/mglemu.cpp | 47 ---- src/render/mglemu.h | 41 ---- src/render/mglfunctions.h | 99 -------- src/render/mgltypes.h | 209 ---------------- src/render/mglxinit.cpp | 3 +- src/render/mobileopengl2graphics.cpp | 4 +- src/render/mobileopenglgraphics.cpp | 4 +- src/render/modernopenglgraphics.cpp | 4 +- src/render/naclgles.cpp | 2 +- src/render/naclglfunctions.h | 322 ------------------------- src/render/normalopenglgraphics.cpp | 2 +- src/render/opengl/mgl.cpp | 32 +++ src/render/opengl/mgl.h | 38 +++ src/render/opengl/mgl.hpp | 141 +++++++++++ src/render/opengl/mglcheck.h | 31 +++ src/render/opengl/mgldefines.h | 131 ++++++++++ src/render/opengl/mglemu.cpp | 47 ++++ src/render/opengl/mglemu.h | 41 ++++ src/render/opengl/mglfunctions.h | 99 ++++++++ src/render/opengl/mgltypes.h | 209 ++++++++++++++++ src/render/opengl/naclglfunctions.h | 322 +++++++++++++++++++++++++ src/render/opengl/opengldebug.h | 36 +++ src/render/opengldebug.h | 36 --- src/render/safeopenglgraphics.cpp | 2 +- src/render/shaders/shader.cpp | 2 +- src/render/shaders/shaderprogram.cpp | 4 +- src/render/shaders/shadersmanager.cpp | 4 +- src/resources/mobileopenglscreenshothelper.cpp | 4 +- src/resources/openglimagehelper.cpp | 7 +- src/resources/openglscreenshothelper.cpp | 4 +- src/resources/safeopenglimagehelper.cpp | 5 +- src/utils/glxhelper.cpp | 5 +- 43 files changed, 1188 insertions(+), 1183 deletions(-) delete mode 100644 src/render/mgl.cpp delete mode 100644 src/render/mgl.h delete mode 100644 src/render/mgl.hpp delete mode 100644 src/render/mglcheck.h delete mode 100644 src/render/mgldefines.h delete mode 100644 src/render/mglemu.cpp delete mode 100644 src/render/mglemu.h delete mode 100644 src/render/mglfunctions.h delete mode 100644 src/render/mgltypes.h delete mode 100644 src/render/naclglfunctions.h create mode 100644 src/render/opengl/mgl.cpp create mode 100644 src/render/opengl/mgl.h create mode 100644 src/render/opengl/mgl.hpp create mode 100644 src/render/opengl/mglcheck.h create mode 100644 src/render/opengl/mgldefines.h create mode 100644 src/render/opengl/mglemu.cpp create mode 100644 src/render/opengl/mglemu.h create mode 100644 src/render/opengl/mglfunctions.h create mode 100644 src/render/opengl/mgltypes.h create mode 100644 src/render/opengl/naclglfunctions.h create mode 100644 src/render/opengl/opengldebug.h delete mode 100644 src/render/opengldebug.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 58472028d..020a54100 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1013,15 +1013,15 @@ SET(SRCS resources/map/metatile.h resources/map/objectslayer.cpp resources/map/objectslayer.h - render/mgl.cpp - render/mgl.h - render/mgl.hpp - render/mglcheck.h - render/mgldefines.h - render/mglemu.cpp - render/mglemu.h - render/mglfunctions.h - render/mgltypes.h + render/opengl/mgl.cpp + render/opengl/mgl.h + render/opengl/mgl.hpp + render/opengl/mglcheck.h + render/opengl/mgldefines.h + render/opengl/mglemu.cpp + render/opengl/mglemu.h + render/opengl/mglfunctions.h + render/opengl/mgltypes.h render/mglx.cpp render/mglx.h render/mglx.hpp @@ -1042,7 +1042,7 @@ SET(SRCS mumblemanager.h navigationmanager.cpp navigationmanager.h - render/naclglfunctions.h + render/opengl/naclglfunctions.h render/normalopenglgraphics.cpp render/normalopenglgraphics.h notifymanager.cpp @@ -1055,7 +1055,7 @@ SET(SRCS render/graphics_drawImageRect.hpp render/nullopenglgraphics.cpp render/nullopenglgraphics.h - render/opengldebug.h + render/opengl/opengldebug.h render/openglgraphicsdef.hpp render/openglgraphicsdef1.hpp render/openglgraphicsdefadvanced.hpp diff --git a/src/Makefile.am b/src/Makefile.am index 10677e7b6..0a4ae4081 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -518,15 +518,15 @@ SRC += events/actionevent.h \ logger.h \ maingui.cpp \ maingui.h \ - render/mgl.cpp \ - render/mgl.h \ - render/mgl.hpp \ - render/mglcheck.h \ - render/mgldefines.h \ - render/mglemu.cpp \ - render/mglemu.h \ - render/mglfunctions.h \ - render/mgltypes.h \ + render/opengl/mgl.cpp \ + render/opengl/mgl.h \ + render/opengl/mgl.hpp \ + render/opengl/mglcheck.h \ + render/opengl/mgldefines.h \ + render/opengl/mglemu.cpp \ + render/opengl/mglemu.h \ + render/opengl/mglfunctions.h \ + render/opengl/mgltypes.h \ render/mglx.cpp \ render/mglx.h \ render/mglx.hpp \ @@ -542,7 +542,7 @@ SRC += events/actionevent.h \ render/naclfunctions.h \ render/naclgles.cpp \ render/naclgles.h \ - render/naclglfunctions.h \ + render/opengl/naclglfunctions.h \ render/normalopenglgraphics.cpp \ render/normalopenglgraphics.h \ input/mouseinput.h \ @@ -554,7 +554,7 @@ SRC += events/actionevent.h \ render/graphics_drawImageRect.hpp \ render/nullopenglgraphics.cpp \ render/nullopenglgraphics.h \ - render/opengldebug.h \ + render/opengl/opengldebug.h \ render/openglgraphicsdef.hpp \ render/openglgraphicsdef1.hpp \ render/openglgraphicsdefadvanced.hpp \ diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index d04588456..f814df04b 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -33,7 +33,7 @@ #endif // USE_SDL2 #elif defined(__native_client__) #include -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #else // ANDROID #include #endif // ANDROID @@ -46,14 +46,15 @@ #include "settings.h" #ifdef USE_OPENGL -#include "render/mglcheck.h" -#include "render/mgl.h" -#include "render/mglemu.h" #include "render/mobileopengl2graphics.h" #include "render/mobileopenglgraphics.h" #include "render/modernopenglgraphics.h" #include "render/normalopenglgraphics.h" #include "render/safeopenglgraphics.h" + +#include "render/opengl/mgl.h" +#include "render/opengl/mglcheck.h" +#include "render/opengl/mglemu.h" #endif #include "render/renderers.h" #include "render/sdlgraphics.h" @@ -66,7 +67,7 @@ #include "resources/mobileopenglscreenshothelper.h" #include "resources/safeopenglimagehelper.h" #endif // ANDROID -#include "render/mglfunctions.h" +#include "render/opengl/mglfunctions.h" #endif // USE_OPENGL #include "resources/sdlimagehelper.h" diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 27fb7dff3..0cf8bd11b 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -29,7 +29,7 @@ #include "input/inputmanager.h" -#include "render/opengldebug.h" +#include "render/opengl/opengldebug.h" #include "resources/image.h" #include "resources/imagehelper.h" diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index a30c2fefa..691996878 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -64,7 +64,7 @@ #include "gui/widgets/tabs/chat/tradetab.h" #include "gui/widgets/tabs/chat/whispertab.h" -#include "render/opengldebug.h" +#include "render/opengl/opengldebug.h" #include "net/chathandler.h" #include "net/serverfeatures.h" diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index f038fdfff..d43c8bdc8 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -90,7 +90,7 @@ #ifdef __APPLE__ #include #endif -#include "render/mgldefines.h" +#include "render/opengl/mgldefines.h" #endif #include "debug.h" diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp deleted file mode 100644 index ccc646092..000000000 --- a/src/render/mgl.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "render/mgl.h" - -#ifdef USE_OPENGL - -#include "debug.h" - -#define defName(name) name##_t m##name = nullptr - -// include function defines -#include "render/mgl.hpp" - -#endif diff --git a/src/render/mgl.h b/src/render/mgl.h deleted file mode 100644 index d8de629a5..000000000 --- a/src/render/mgl.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGL_H -#define RENDER_MGL_H - -#include "main.h" - -#ifdef USE_OPENGL - -#include "render/mgldefines.h" -#include "render/mgltypes.h" - -#define defName(name) extern name##_t m##name - -#include "render/mgl.hpp" - -#undef defName - -#endif // USE_OPENGL -#endif // RENDER_MGL_H diff --git a/src/render/mgl.hpp b/src/render/mgl.hpp deleted file mode 100644 index edf3882cf..000000000 --- a/src/render/mgl.hpp +++ /dev/null @@ -1,141 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -defName(glGenRenderbuffers); -defName(glBindRenderbuffer); -defName(glRenderbufferStorage); -defName(glGenFramebuffers); -defName(glBindFramebuffer); -defName(glFramebufferTexture2D); -defName(glFramebufferRenderbuffer); -defName(glDeleteFramebuffers); -defName(glDeleteRenderbuffers); -defName(glGetStringi); -defName(glGenSamplers); -defName(glDeleteSamplers); -defName(glBindSampler); -defName(glSamplerParameteri); -defName(glDebugMessageControl); -defName(glDebugMessageCallback); -defName(glFrameTerminator); -defName(glLabelObject); -defName(glGetObjectLabel); -defName(glInsertEventMarker); -defName(glPushGroupMarker); -defName(glPopGroupMarker); -defName(glGenVertexArrays); -defName(glBindVertexArray); -defName(glDeleteVertexArrays); -defName(glDisableVertexAttribArray); -defName(glDeleteShader); -defName(glGetShaderInfoLog); -defName(glGetShaderSource); -defName(glDetachShader); -defName(glGetAttachedShaders); -defName(glGetActiveUniform); -defName(glBindFragDataLocation); -#ifndef __native_client__ -defName(glDeleteProgram); -defName(glCreateProgram); -defName(glGetProgramiv); -defName(glLinkProgram); -defName(glAttachShader); -defName(glGetShaderiv); -defName(glCompileShader); -defName(glShaderSource); -defName(glCreateShader); -defName(glGetUniformLocation); -defName(glGenBuffers); -defName(glDeleteBuffers); -defName(glBindBuffer); -defName(glBufferData); -defName(glEnableVertexAttribArray); -defName(glVertexAttribPointer); -defName(glUseProgram); -defName(glUniform1f); -defName(glUniform2f); -defName(glUniform4f); -defName(glValidateProgram); -defName(glGetProgramInfoLog); -defName(glBindAttribLocation); -defName(glActiveTexture); - -#define mglDrawArrays(...) \ - glDrawArrays(__VA_ARGS__) -#define mglDisable(...) \ - glDisable(__VA_ARGS__) -#define mglHint(...) \ - glHint(__VA_ARGS__) -#define mglScissor(...) \ - glScissor(__VA_ARGS__) -#define mglEnable(...) \ - glEnable(__VA_ARGS__) -#define mglBindTexture(...) \ - glBindTexture(__VA_ARGS__) -#define mglGetIntegerv(...) \ - glGetIntegerv(__VA_ARGS__) -#define mglClear(...) \ - glClear(__VA_ARGS__) -#define mglGetString(...) \ - glGetString(__VA_ARGS__) -#define mglTexParameteri(...) \ - glTexParameteri(__VA_ARGS__) -#define mglTexImage2D(...) \ - glTexImage2D(__VA_ARGS__) -#define mglGenTextures(...) \ - glGenTextures(__VA_ARGS__) -#define mglPixelStorei(...) \ - glPixelStorei(__VA_ARGS__) -#define mglReadPixels(...) \ - glReadPixels(__VA_ARGS__) - -#endif -defName(glGetAttribLocation); -defName(glUniform3f); -defName(glCheckFramebufferStatus); -defName(glProgramUniform1f); -defName(glProgramUniform2f); -defName(glProgramUniform3f); -defName(glProgramUniform4f); -defName(glBindVertexBuffer); -defName(glVertexAttribBinding); -defName(glVertexAttribFormat); -defName(glBindVertexBuffers); -defName(glIsBuffer); -defName(glVertexAttribIFormat); -defName(glVertexAttribIPointer); -defName(glInvalidateTexImage); -defName(glCopyImageSubData); -defName(glPushDebugGroup); -defName(glPopDebugGroup); -defName(glObjectLabel); -defName(glTexStorage2D); -defName(glGenQueries); -defName(glBeginQuery); -defName(glEndQuery); -defName(glDeleteQueries); -defName(glGetQueryObjectiv); -defName(glGetQueryObjectui64v); -defName(glTextureSubImage2D); -defName(glClearTexImage); -defName(glClearTexSubImage); -#ifdef WIN32 -defName(wglGetExtensionsString); -#endif diff --git a/src/render/mglcheck.h b/src/render/mglcheck.h deleted file mode 100644 index a5804b5e1..000000000 --- a/src/render/mglcheck.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGLCHECK_H -#define RENDER_MGLCHECK_H - -#include "main.h" -#ifdef USE_OPENGL - -#define isGLNull(func) (!(func)) -#define isGLNotNull(func) ((func) != nullptr) - -#endif // USE_OPENGL -#endif // RENDER_MGLCHECK_H diff --git a/src/render/mgldefines.h b/src/render/mgldefines.h deleted file mode 100644 index 4f765e2a4..000000000 --- a/src/render/mgldefines.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGLDEFINES_H -#define RENDER_MGLDEFINES_H - -#ifdef USE_OPENGL - -#ifndef GL_NUM_EXTENSIONS -#define GL_NUM_EXTENSIONS 0x821D -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#endif - -#ifndef GL_COMPRESSED_RGBA_ARB -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif -#ifndef GL_MAX_ELEMENTS_VERTICES -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#endif - -#ifndef GL_DEBUG_OUTPUT -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_OUTPUT 0x92E0 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826a -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#endif - -#ifndef GL_EXT_debug_label -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 -#endif - -#ifndef GL_ARRAY_BUFFER -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#endif - -#ifndef GL_STREAM_DRAW -#define GL_STREAM_DRAW 0x88E0 -#define GL_STATIC_DRAW 0x88E4 -#define GL_DYNAMIC_DRAW 0x88E8 -#endif - -#ifndef GL_COMPILE_STATUS -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#endif - -#ifndef GL_DEPTH_CLAMP -#define GL_DEPTH_CLAMP 0x864F -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_SAMPLE_MASK 0x8E51 -#endif - -#ifndef GL_POLYGON_SMOOTH -#define GL_POLYGON_SMOOTH 0x0B41 -#endif - -#ifndef GL_DEPTH_BOUNDS_TEST_EXT -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#endif - -#ifndef GL_TEXTURE_COMPRESSION_HINT_ARB -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#endif - -#ifndef GLX_CONTEXT_PROFILE_MASK_ARB -#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 -#endif - -#ifndef GLX_CONTEXT_MAJOR_VERSION_ARB -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define GLX_CONTEXT_FLAGS_ARB 0x2094 -#endif - -#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#endif - -#endif // USE_OPENGL - -#endif // RENDER_MGLDEFINES_H diff --git a/src/render/mglemu.cpp b/src/render/mglemu.cpp deleted file mode 100644 index 216d5ab8f..000000000 --- a/src/render/mglemu.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifdef USE_OPENGL - -#include "render/mglemu.h" - -#include "resources/openglimagehelper.h" - -#include "debug.h" - -void APIENTRY emuglTextureSubImage2D(GLuint texture, GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const void *pixels) -{ - OpenGLImageHelper::bindTexture(texture); - glTexSubImage2D(target, level, - xoffset, yoffset, - width, height, - format, type, pixels); -} - -void APIENTRY emuglActiveTexture(GLenum texture A_UNUSED) -{ -} - -#endif diff --git a/src/render/mglemu.h b/src/render/mglemu.h deleted file mode 100644 index bbe1a121e..000000000 --- a/src/render/mglemu.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGLEMU_H -#define RENDER_MGLEMU_H -#ifdef USE_OPENGL - -#include "render/mgltypes.h" - -void APIENTRY emuglTextureSubImage2D(GLuint texture, - GLenum target, - GLint level, - GLint xoffset, - GLint yoffset, - GLsizei width, - GLsizei height, - GLenum format, - GLenum type, - const void *pixels); - -void APIENTRY emuglActiveTexture(GLenum texture); - -#endif // USE_OPENGL -#endif // RENDER_MGLEMU_H diff --git a/src/render/mglfunctions.h b/src/render/mglfunctions.h deleted file mode 100644 index 8972ebb17..000000000 --- a/src/render/mglfunctions.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGLFUNCTIONS_H -#define RENDER_MGLFUNCTIONS_H - -#ifdef USE_OPENGL - -#include "logger.h" - -#ifdef WIN32 -#define getFunction(name) wglGetProcAddress(name) -#elif defined ANDROID -#define getFunction(name) eglGetProcAddress(name) -#elif defined __APPLE__ -#define getFunction(name) nullptr -#elif defined __native_client__ -#define getFunction(name) glGetProcAddressREGAL(name) -#else -#define getFunction(name) glXGetProcAddress(\ - reinterpret_cast(name)) -#endif - -#define assignFunction(func) \ - { \ - m##func = reinterpret_cast(getFunction(#func)); \ - if (m##func == nullptr) \ - logger->log("function not found: " #func); \ - else \ - logger->log("assigned function: " #func); \ - } - -#define assignFunction3(func, ext) \ - { \ - m##func = reinterpret_cast(getFunction(#func#ext)); \ - if (m##func == nullptr) \ - { \ - logger->log("function not found: " #func#ext); \ - m##func = reinterpret_cast(getFunction(#func)); \ - if (m##func == nullptr) \ - logger->log("function not found: " #func); \ - else \ - logger->log("assigned function: " #func); \ - } \ - else \ - { \ - logger->log("assigned function: " #func#ext); \ - } \ - } - -#define assignFunctionARB(func) assignFunction3(func, ARB) - -#define assignFunctionEXT(func) assignFunction3(func, EXT) - -#define assignFunction2(func, name) \ - { \ - m##func = reinterpret_cast(getFunction(name)); \ - if (m##func == nullptr) \ - logger->log(std::string("function not found: ") + name); \ - else \ - logger->log(std::string("assigned function: ") + name); \ - } - -#define assignFunctionEmu2(func, name) \ - { \ - m##func = reinterpret_cast(getFunction(name)); \ - if (m##func == nullptr) \ - { \ - m##func = emu##func; \ - logger->log(std::string("emulated function: ") + name); \ - } \ - else \ - { \ - logger->log(std::string("assigned function: ") + name); \ - } \ - } - -#define emulateFunction(func) m##func = emu##func; \ - logger->log("emulated function: " #func) - -#endif // USE_OPENGL -#endif // RENDER_MGLFUNCTIONS_H diff --git a/src/render/mgltypes.h b/src/render/mgltypes.h deleted file mode 100644 index 1937bb6a2..000000000 --- a/src/render/mgltypes.h +++ /dev/null @@ -1,209 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2012-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_MGLTYPES_H -#define RENDER_MGLTYPES_H - -#include "main.h" - -#ifdef USE_OPENGL - -#include "render/mgldefines.h" - -#ifdef ANDROID -#include -#include -#define APIENTRY GL_APIENTRY -#else -#ifndef USE_SDL2 -#define GL_GLEXT_PROTOTYPES 1 -#endif -#include -#ifdef __native_client__ -#include -#else -#include -#endif -#endif - -#if defined(__GXX_EXPERIMENTAL_CXX0X__) -#include -#else -#include -#endif - -typedef void (APIENTRY *glGenRenderbuffers_t)(GLsizei, GLuint *); -typedef void (APIENTRY *glBindRenderbuffer_t)(GLenum target, - GLuint renderbuffer); -typedef void (APIENTRY *glRenderbufferStorage_t)(GLenum target, - GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRY *glGenFramebuffers_t)(GLsizei n, GLuint *framebuffers); -typedef void (APIENTRY *glBindFramebuffer_t)(GLenum target, - GLuint framebuffer); -typedef void (APIENTRY *glFramebufferTexture2D_t)(GLenum target, - GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRY *glFramebufferRenderbuffer_t)(GLenum target, - GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRY *glDeleteFramebuffers_t) (GLsizei, const GLuint *); -typedef void (APIENTRY *glDeleteRenderbuffers_t) (GLsizei, const GLuint *); -typedef const GLubyte *(APIENTRY *glGetStringi_t) (GLenum, GLuint); -typedef void (APIENTRY *glGenSamplers_t) (GLsizei count, GLuint *samplers); -typedef void (APIENTRY *glDeleteSamplers_t) - (GLsizei count, const GLuint * samplers); -typedef void (APIENTRY *glBindSampler_t) (GLuint unit, GLuint sampler); -typedef void (APIENTRY *glSamplerParameteri_t) - (GLuint sampler, GLenum pname, GLint param); -typedef void (APIENTRY *glDebugMessageControl_t) (GLenum source, GLenum type, - GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (APIENTRY *glFrameTerminator_t) (void); -typedef void (APIENTRY *glLabelObject_t) (GLenum type, GLuint object, - GLsizei length, const GLchar *label); -typedef void (APIENTRY *glGetObjectLabel_t) (GLenum type, GLuint object, - GLsizei bufSize, GLsizei *length, GLchar *label); -typedef void (APIENTRY *glInsertEventMarker_t) - (GLsizei length, const char *marker); -typedef void (APIENTRY *glPushGroupMarker_t) - (GLsizei length, const char *marker); -typedef void (APIENTRY *glPopGroupMarker_t) (void); -typedef void (APIENTRY *glGenVertexArrays_t) (GLsizei n, GLuint *arrays); -typedef void (APIENTRY *glBindVertexArray_t) (GLuint array); -typedef void (APIENTRY *glDeleteVertexArrays_t) (GLsizei n, GLuint *arrays); -typedef void (APIENTRY *glDisableVertexAttribArray_t) (GLuint index); -typedef void (APIENTRY *glDeleteShader_t) (GLenum shader); -typedef void (APIENTRY *glGetShaderInfoLog_t) (GLuint shader, - GLsizei maxLength, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRY *glGetShaderSource_t) (GLuint shader, - GLsizei bufSize, GLsizei *length, GLchar *source); -typedef void (APIENTRY *glDetachShader_t) (GLuint program, GLuint shader); -typedef void (APIENTRY *glGetAttachedShaders_t) (GLuint program, - GLsizei maxCount, GLsizei *count, GLuint *shaders); -typedef void (APIENTRY *glGetActiveUniform_t) (GLuint program, GLuint index, - GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef GLint (APIENTRY *glBindFragDataLocation_t) (GLuint program, - GLuint colorNumber, const char *name); -#ifndef __native_client__ -typedef void (APIENTRY *glDeleteProgram_t) (GLuint program); -typedef GLuint (APIENTRY *glCreateProgram_t) (void); -typedef void (APIENTRY *glGetProgramiv_t) (GLuint program, - GLenum pname, GLint *params); -typedef void (APIENTRY *glLinkProgram_t) (GLuint program); -typedef void (APIENTRY *glAttachShader_t) (GLuint program, GLuint shader); -typedef void (APIENTRY *glGetShaderiv_t) (GLuint shader, - GLenum pname, GLint *params); -typedef void (APIENTRY *glCompileShader_t) (GLuint shader); -typedef void (APIENTRY *glShaderSource_t) (GLuint shader, - GLsizei count, const GLchar **string, const GLint *length); -typedef GLuint (APIENTRY *glCreateShader_t) (GLenum shaderType); -typedef GLint (APIENTRY *glGetUniformLocation_t) (GLuint program, - const GLchar *name); -typedef void (APIENTRY *glGenBuffers_t) (GLsizei n, GLuint *buffers); -typedef void (APIENTRY *glDeleteBuffers_t) (GLsizei n, GLuint *buffers); -typedef void (APIENTRY *glBindBuffer_t) (GLenum target, GLuint buffer); -typedef void (APIENTRY *glBufferData_t) (GLenum target, GLsizeiptr size, - const GLvoid *data, GLenum usage); -typedef void (APIENTRY *glEnableVertexAttribArray_t) (GLuint index); -typedef void (APIENTRY *glVertexAttribPointer_t) (GLuint index, GLint size, - GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRY *glUseProgram_t) (GLuint program); -typedef void (APIENTRY *glUniform1f_t) (GLint location, GLfloat v0); -typedef void (APIENTRY *glUniform2f_t) (GLint location, - GLfloat v0, GLfloat v1); -typedef void (APIENTRY *glUniform4f_t) (GLint location, - GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRY *glValidateProgram_t) (GLuint program); -typedef void (APIENTRY *glGetProgramInfoLog_t) (GLuint program, - GLsizei maxLength, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRY *glBindAttribLocation_t) (GLuint program, - GLuint index, const GLchar *name); -typedef void (APIENTRY *glActiveTexture_t) (GLenum texture); -#endif -typedef GLint (APIENTRY *glGetAttribLocation_t) (GLuint program, - const GLchar *name); -typedef void (APIENTRY *glUniform3f_t) (GLint location, - GLfloat v0, GLfloat v1, GLfloat v2); -typedef GLenum (APIENTRY *glCheckFramebufferStatus_t) (GLenum target); -typedef void (APIENTRY *glProgramUniform1f_t) (GLuint program, - GLint location, GLfloat v0); -typedef void (APIENTRY *glProgramUniform2f_t) (GLuint program, - GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRY *glProgramUniform3f_t) (GLuint program, - GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRY *glProgramUniform4f_t) (GLuint program, - GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRY *glBindVertexBuffer_t) (GLuint bindingindex, - GLuint buffer, GLintptr offset, GLintptr stride); -typedef void (APIENTRY *glVertexAttribBinding_t) (GLuint attribindex, - GLuint bindingindex); -typedef void (APIENTRY *glVertexAttribFormat_t) (GLuint attribindex, - GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (APIENTRY *glBindVertexBuffers_t) (GLuint first, GLsizei count, - const GLuint *buffers, const GLuint *offsets, const GLsizei *strides); -typedef GLboolean (APIENTRY *glIsBuffer_t) (GLuint buffer); -typedef void (APIENTRY *glVertexAttribIFormat_t) (GLuint attribindex, - GLint size, GLenum type, GLuint relativeoffset); -typedef void (APIENTRY *glVertexAttribIPointer_t) (GLuint index, GLint size, - GLenum type, GLsizei stride, const GLvoid * pointer); -typedef void (APIENTRY *glInvalidateTexImage_t) (GLuint texture, GLint level); -typedef void (APIENTRY *glCopyImageSubData_t) (GLuint srcName, - GLenum srcTarget, GLint srcLevel, - GLint srcX, GLint srcY, GLint srcZ, - GLuint dstName, GLenum dstTarget, GLint dstLevel, - GLint dstX, GLint dstY, GLint dstZ, - GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); -typedef void (APIENTRY *glPushDebugGroup_t) (GLenum source, GLuint id, - GLsizei length, const GLchar * message); -typedef void (APIENTRY *glPopDebugGroup_t) (void); -typedef void (APIENTRY *glObjectLabel_t) (GLenum identifier, GLuint name, - GLsizei length, const GLchar *label); -typedef void (APIENTRY *glTexStorage2D_t) (GLenum target, GLsizei levels, - GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRY *glGenQueries_t) (GLsizei n, GLuint *ids); -typedef void (APIENTRY *glBeginQuery_t) (GLenum target, GLuint id); -typedef void (APIENTRY *glEndQuery_t) (GLenum target); -typedef void (APIENTRY *glDeleteQueries_t) (GLsizei n, const GLuint *ids); -typedef void (APIENTRY *glGetQueryObjectiv_t) (GLuint id, - GLenum pname, GLint *params); -typedef void (APIENTRY *glGetQueryObjectui64v_t) (GLuint id, - GLenum pname, uint64_t *params); -typedef void (APIENTRY *glTextureSubImage2D_t) (GLuint texture, GLenum target, - GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLenum type, const void *pixels); -typedef void (APIENTRY *glClearTexImage_t) (GLuint texture, GLint level, - GLenum format, GLenum type, const void * data); -typedef void (APIENTRY *glClearTexSubImage_t) (GLuint texture, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, - GLsizei depth, GLenum format, GLenum type, const void * data); - -// callback -typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id, - GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam); - -typedef void (APIENTRY *glDebugMessageCallback_t) (GLDEBUGPROC_t callback, - const void *userParam); - - -#ifdef WIN32 -typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc); -#else -#define CALLBACK -#endif - -#endif // USE_OPENGL -#endif // RENDER_MGLTYPES_H diff --git a/src/render/mglxinit.cpp b/src/render/mglxinit.cpp index d08700192..86d8b8d69 100644 --- a/src/render/mglxinit.cpp +++ b/src/render/mglxinit.cpp @@ -22,10 +22,11 @@ #if defined(USE_OPENGL) && defined(USE_X11) -#include "render/mglfunctions.h" #include "render/mglx.h" #include "render/mglxtypes.h" +#include "render/opengl/mglfunctions.h" + #include "debug.h" void Glx::initFunctions() diff --git a/src/render/mobileopengl2graphics.cpp b/src/render/mobileopengl2graphics.cpp index baca7f219..1037ebe70 100644 --- a/src/render/mobileopengl2graphics.cpp +++ b/src/render/mobileopengl2graphics.cpp @@ -28,10 +28,10 @@ #include "graphicsvertexes.h" #include "logger.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "render/shaders/shaderprogram.h" #include "render/shaders/shadersmanager.h" diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 1a8c697a2..922068527 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -27,10 +27,10 @@ #include "graphicsvertexes.h" #include "logger.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 1ff55045c..ea28bec4d 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -29,10 +29,10 @@ #include "graphicsvertexes.h" #include "logger.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "render/shaders/shaderprogram.h" #include "render/shaders/shadersmanager.h" diff --git a/src/render/naclgles.cpp b/src/render/naclgles.cpp index 6451b6a36..be8ebc184 100644 --- a/src/render/naclgles.cpp +++ b/src/render/naclgles.cpp @@ -24,7 +24,7 @@ #include "logger.h" -#include "render/mglfunctions.h" +#include "render/opengl/mglfunctions.h" #include diff --git a/src/render/naclglfunctions.h b/src/render/naclglfunctions.h deleted file mode 100644 index 8691c997c..000000000 --- a/src/render/naclglfunctions.h +++ /dev/null @@ -1,322 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_NACLGLFUNCTIONS_H -#define RENDER_NACLGLFUNCTIONS_H - -#if defined(__native_client__) && defined(USE_OPENGL) - -#include - -extern const struct PPB_OpenGLES2* gles2Interface; -extern PP_Resource gles2Context; - -#define mglDrawArrays(...) \ - gles2Interface->DrawArrays(gles2Context, __VA_ARGS__) -#define mglEnableVertexAttribArray(...) \ - gles2Interface->EnableVertexAttribArray(gles2Context, __VA_ARGS__) -#define mglVertexAttribPointer(...) \ - gles2Interface->VertexAttribPointer(gles2Context, __VA_ARGS__) -#define mglUseProgram(...) \ - gles2Interface->UseProgram(gles2Context, __VA_ARGS__) -#define mglViewport(...) \ - gles2Interface->Viewport(gles2Context, __VA_ARGS__) -#define mglGenBuffers(...) \ - gles2Interface->GenBuffers(gles2Context, __VA_ARGS__) -#define mglBindBuffer(...) \ - gles2Interface->BindBuffer(gles2Context, __VA_ARGS__) -#define mglBufferData(...) \ - gles2Interface->BufferData(gles2Context, __VA_ARGS__) -#define mglDeleteBuffers(...) \ - gles2Interface->DeleteBuffers(gles2Context, __VA_ARGS__) -#define mglGetUniformLocation(...) \ - gles2Interface->GetUniformLocation(gles2Context, __VA_ARGS__) -#define mglCreateShader(...) \ - gles2Interface->CreateShader(gles2Context, __VA_ARGS__) -#define mglShaderSource(...) \ - gles2Interface->ShaderSource(gles2Context, __VA_ARGS__) -#define mglCompileShader(...) \ - gles2Interface->CompileShader(gles2Context, __VA_ARGS__) -#define mglGetShaderiv(...) \ - gles2Interface->GetShaderiv(gles2Context, __VA_ARGS__) -#define mglAttachShader(...) \ - gles2Interface->AttachShader(gles2Context, __VA_ARGS__) -#define mglBindAttribLocation(...) \ - gles2Interface->BindAttribLocation(gles2Context, __VA_ARGS__) -#define mglLinkProgram(...) \ - gles2Interface->LinkProgram(gles2Context, __VA_ARGS__) -#define mglGetProgramiv(...) \ - gles2Interface->GetProgramiv(gles2Context, __VA_ARGS__) -#define mglClearColor(...) \ - gles2Interface->ClearColor(gles2Context, __VA_ARGS__) -#define mglUniform1f(...) \ - gles2Interface->Uniform1f(gles2Context, __VA_ARGS__) -#define mglUniform2f(...) \ - gles2Interface->Uniform2f(gles2Context, __VA_ARGS__) -#define mglUniform3f(...) \ - gles2Interface->Uniform3f(gles2Context, __VA_ARGS__) -#define mglUniform4f(...) \ - gles2Interface->Uniform4f(gles2Context, __VA_ARGS__) -#define mglUniform1i(...) \ - gles2Interface->Uniform1i(gles2Context, __VA_ARGS__) -#define mglUniform2i(...) \ - gles2Interface->Uniform2i(gles2Context, __VA_ARGS__) -#define mglUniform3i(...) \ - gles2Interface->Uniform3i(gles2Context, __VA_ARGS__) -#define mglUniform4i(...) \ - gles2Interface->Uniform4i(gles2Context, __VA_ARGS__) -#define mglUniform1fv(...) \ - gles2Interface->Uniform1fv(gles2Context, __VA_ARGS__) -#define mglUniform2fv(...) \ - gles2Interface->Uniform2fv(gles2Context, __VA_ARGS__) -#define mglUniform3fv(...) \ - gles2Interface->Uniform3fv(gles2Context, __VA_ARGS__) -#define mglUniform4fv(...) \ - gles2Interface->Uniform4fv(gles2Context, __VA_ARGS__) -#define mglUniform1iv(...) \ - gles2Interface->Uniform1iv(gles2Context, __VA_ARGS__) -#define mglUniform2iv(...) \ - gles2Interface->Uniform2iv(gles2Context, __VA_ARGS__) -#define mglUniform3iv(...) \ - gles2Interface->Uniform3iv(gles2Context, __VA_ARGS__) -#define mglUniform4iv(...) \ - gles2Interface->Uniform4iv(gles2Context, __VA_ARGS__) -#define mglActiveTexture(...) \ - gles2Interface->ActiveTexture(gles2Context, __VA_ARGS__) -#define mglBindTexture(...) \ - gles2Interface->BindTexture(gles2Context, __VA_ARGS__) -#define mglEnable(...) \ - gles2Interface->Enable(gles2Context, __VA_ARGS__) -#define mglClear(...) \ - gles2Interface->Clear(gles2Context, __VA_ARGS__) -#define mglValidateProgram(...) \ - gles2Interface->ValidateProgram(gles2Context, __VA_ARGS__) -#define mglDeleteProgram(...) \ - gles2Interface->DeleteProgram(gles2Context, __VA_ARGS__) -#define mglCreateProgram() \ - gles2Interface->CreateProgram(gles2Context) -#define mglGetProgramInfoLog(...) \ - gles2Interface->GetProgramInfoLog(gles2Context, __VA_ARGS__) -#define mglDisable(...) \ - gles2Interface->Disable(gles2Context, __VA_ARGS__) -#define mglHint(...) \ - gles2Interface->Hint(gles2Context, __VA_ARGS__) -#define mglScissor(...) \ - gles2Interface->Scissor(gles2Context, __VA_ARGS__) -#define mglEnable(...) \ - gles2Interface->Enable(gles2Context, __VA_ARGS__) -#define mglGetIntegerv(...) \ - gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__) -#define mglGetString(...) \ - gles2Interface->GetString(gles2Context, __VA_ARGS__) -#define mglBindFramebuffer(...) \ - gles2Interface->BindFramebuffer(gles2Context, __VA_ARGS__) -#define mglBindRenderbuffer(...) \ - gles2Interface->BindRenderbuffer(gles2Context, __VA_ARGS__) -#define mglBlendColor(...) \ - gles2Interface->BlendColor(gles2Context, __VA_ARGS__) -#define mglBlendEquation(...) \ - gles2Interface->BlendEquation(gles2Context, __VA_ARGS__) -#define mglBlendEquationSeparate(...) \ - gles2Interface->BlendEquationSeparate(gles2Context, __VA_ARGS__) -#define mglBlendFunc(...) \ - gles2Interface->BlendFunc(gles2Context, __VA_ARGS__) -#define mglBlendFuncSeparate(...) \ - gles2Interface->BlendFuncSeparate(gles2Context, __VA_ARGS__) -#define mglBufferSubData(...) \ - gles2Interface->BufferSubData(gles2Context, __VA_ARGS__) -#define mglCheckFramebufferStatus(...) \ - gles2Interface->CheckFramebufferStatus(gles2Context, __VA_ARGS__) -#define mglClearDepthf(...) \ - gles2Interface->ClearDepthf(gles2Context, __VA_ARGS__) -#define mglClearStencil(...) \ - gles2Interface->ClearStencil(gles2Context, __VA_ARGS__) -#define mglColorMask(...) \ - gles2Interface->ColorMask(gles2Context, __VA_ARGS__) -#define mglCompressedTexImage2D(...) \ - gles2Interface->CompressedTexImage2D(gles2Context, __VA_ARGS__) -#define mglCompressedTexSubImage2D(...) \ - gles2Interface->CompressedTexSubImage2D(gles2Context, __VA_ARGS__) -#define mglCopyTexImage2D(...) \ - gles2Interface->CopyTexImage2D(gles2Context, __VA_ARGS__) -#define mglCopyTexSubImage2D(...) \ - gles2Interface->CopyTexSubImage2D(gles2Context, __VA_ARGS__) -#define mglCullFace(...) \ - gles2Interface->CullFace(gles2Context, __VA_ARGS__) -#define mglDeleteFramebuffers(...) \ - gles2Interface->DeleteFramebuffers(gles2Context, __VA_ARGS__) -#define mglDeleteRenderbuffers(...) \ - gles2Interface->DeleteRenderbuffers(gles2Context, __VA_ARGS__) -#define mglDeleteShader(...) \ - gles2Interface->DeleteShader(gles2Context, __VA_ARGS__) -#define mglDeleteTextures(...) \ - gles2Interface->DeleteTextures(gles2Context, __VA_ARGS__) -#define mglDepthFunc(...) \ - gles2Interface->DepthFunc(gles2Context, __VA_ARGS__) -#define mglDepthMask(...) \ - gles2Interface->DepthMask(gles2Context, __VA_ARGS__) -#define mglDepthRangef(...) \ - gles2Interface->DepthRangef(gles2Context, __VA_ARGS__) -#define mglDetachShader(...) \ - gles2Interface->DetachShader(gles2Context, __VA_ARGS__) -#define mglDisableVertexAttribArray(...) \ - gles2Interface->DisableVertexAttribArray(gles2Context, __VA_ARGS__) -#define mglDrawElements(...) \ - gles2Interface->DrawElements(gles2Context, __VA_ARGS__) -#define mglFinish(...) \ - gles2Interface->Finish(gles2Context, __VA_ARGS__) -#define mglFlush(...) \ - gles2Interface->Flush(gles2Context, __VA_ARGS__) -#define mglFramebufferRenderbuffer(...) \ - gles2Interface->FramebufferRenderbuffer(gles2Context, __VA_ARGS__) -#define mglFramebufferTexture2D(...) \ - gles2Interface->FramebufferTexture2D(gles2Context, __VA_ARGS__) -#define mglFrontFace(...) \ - gles2Interface->FrontFace(gles2Context, __VA_ARGS__) -#define mglGenerateMipmap(...) \ - gles2Interface->GenerateMipmap(gles2Context, __VA_ARGS__) -#define mglGenFramebuffers(...) \ - gles2Interface->GenFramebuffers(gles2Context, __VA_ARGS__) -#define mglGenRenderbuffers(...) \ - gles2Interface->GenRenderbuffers(gles2Context, __VA_ARGS__) -#define mglGenTextures(...) \ - gles2Interface->GenTextures(gles2Context, __VA_ARGS__) -#define mglGetActiveAttrib(...) \ - gles2Interface->GetActiveAttrib(gles2Context, __VA_ARGS__) -#define mglGetActiveUniform(...) \ - gles2Interface->GetActiveUniform(gles2Context, __VA_ARGS__) -#define mglGetAttachedShaders(...) \ - gles2Interface->GetAttachedShaders(gles2Context, __VA_ARGS__) -#define mglGetAttribLocation(...) \ - gles2Interface->GetAttribLocation(gles2Context, __VA_ARGS__) -#define mglGetBooleanv(...) \ - gles2Interface->GetBooleanv(gles2Context, __VA_ARGS__) -#define mglGetBufferParameteriv(...) \ - gles2Interface->GetBufferParameteriv(gles2Context, __VA_ARGS__) -#define mglGetError(...) \ - gles2Interface->GetError(gles2Context, __VA_ARGS__) -#define mglGetFloatv(...) \ - gles2Interface->GetFloatv(gles2Context, __VA_ARGS__) -#define mglGetFramebufferAttachmentParameteriv(...) \ - gles2Interface->GetFramebufferAttachmentParameteriv(gles2Context, \ - __VA_ARGS__) -#define mglGetIntegerv(...) \ - gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__) -#define mglGetRenderbufferParameteriv(...) \ - gles2Interface->GetRenderbufferParameteriv(gles2Context, __VA_ARGS__) -#define mglGetShaderInfoLog(...) \ - gles2Interface->GetShaderInfoLog(gles2Context, __VA_ARGS__) -#define mglGetShaderPrecisionFormat(...) \ - gles2Interface->GetShaderPrecisionFormat(gles2Context, __VA_ARGS__) -#define mglGetShaderSource(...) \ - gles2Interface->GetShaderSource(gles2Context, __VA_ARGS__) -#define mglGetTexParameterfv(...) \ - gles2Interface->GetTexParameterfv(gles2Context, __VA_ARGS__) -#define mglGetTexParameteriv(...) \ - gles2Interface->GetTexParameteriv(gles2Context, __VA_ARGS__) -#define mglGetUniformfv(...) \ - gles2Interface->GetUniformfv(gles2Context, __VA_ARGS__) -#define mglGetUniformiv(...) \ - gles2Interface->GetUniformiv(gles2Context, __VA_ARGS__) -#define mglGetVertexAttribfv(...) \ - gles2Interface->GetVertexAttribfv(gles2Context, __VA_ARGS__) -#define mglGetVertexAttribiv(...) \ - gles2Interface->GetVertexAttribiv(gles2Context, __VA_ARGS__) -#define mglGetVertexAttribPointerv(...) \ - gles2Interface->GetVertexAttribPointerv(gles2Context, __VA_ARGS__) -#define mglIsBuffer(...) \ - gles2Interface->IsBuffer(gles2Context, __VA_ARGS__) -#define mglIsEnabled(...) \ - gles2Interface->IsEnabled(gles2Context, __VA_ARGS__) -#define mglIsFramebuffer(...) \ - gles2Interface->IsFramebuffer(gles2Context, __VA_ARGS__) -#define mglIsProgram(...) \ - gles2Interface->IsProgram(gles2Context, __VA_ARGS__) -#define mglIsRenderbuffer(...) \ - gles2Interface->IsRenderbuffer(gles2Context, __VA_ARGS__) -#define mglIsShader(...) \ - gles2Interface->IsShader(gles2Context, __VA_ARGS__) -#define mglIsTexture(...) \ - gles2Interface->IsTexture(gles2Context, __VA_ARGS__) -#define mglLineWidth(...) \ - gles2Interface->LineWidth(gles2Context, __VA_ARGS__) -#define mglPixelStorei(...) \ - gles2Interface->PixelStorei(gles2Context, __VA_ARGS__) -#define mglPolygonOffset(...) \ - gles2Interface->PolygonOffset(gles2Context, __VA_ARGS__) -#define mglReadPixels(...) \ - gles2Interface->ReadPixels(gles2Context, __VA_ARGS__) -#define mglReleaseShaderCompiler(...) \ - gles2Interface->ReleaseShaderCompiler(gles2Context, __VA_ARGS__) -#define mglRenderbufferStorage(...) \ - gles2Interface->RenderbufferStorage(gles2Context, __VA_ARGS__) -#define mglSampleCoverage(...) \ - gles2Interface->SampleCoverage(gles2Context, __VA_ARGS__) -#define mglShaderBinary(...) \ - gles2Interface->ShaderBinary(gles2Context, __VA_ARGS__) -#define mglStencilFunc(...) \ - gles2Interface->StencilFunc(gles2Context, __VA_ARGS__) -#define mglStencilFuncSeparate(...) \ - gles2Interface->StencilFuncSeparate(gles2Context, __VA_ARGS__) -#define mglStencilMask(...) \ - gles2Interface->StencilMask(gles2Context, __VA_ARGS__) -#define mglStencilMaskSeparate(...) \ - gles2Interface->StencilMaskSeparate(gles2Context, __VA_ARGS__) -#define mglStencilOp(...) \ - gles2Interface->StencilOp(gles2Context, __VA_ARGS__) -#define mglStencilOpSeparate(...) \ - gles2Interface->StencilOpSeparate(gles2Context, __VA_ARGS__) -#define mglTexImage2D(...) \ - gles2Interface->TexImage2D(gles2Context, __VA_ARGS__) -#define mglTexParameterf(...) \ - gles2Interface->TexParameterf(gles2Context, __VA_ARGS__) -#define mglTexParameterfv(...) \ - gles2Interface->TexParameterfv(gles2Context, __VA_ARGS__) -#define mglTexParameteri(...) \ - gles2Interface->TexParameteri(gles2Context, __VA_ARGS__) -#define mglTexParameteriv(...) \ - gles2Interface->TexParameteriv(gles2Context, __VA_ARGS__) -#define mglTexSubImage2D(...) \ - gles2Interface->TexSubImage2D(gles2Context, __VA_ARGS__) -#define mglUniformMatrix2fv(...) \ - gles2Interface->UniformMatrix2fv(gles2Context, __VA_ARGS__) -#define mglUniformMatrix3fv(...) \ - gles2Interface->UniformMatrix3fv(gles2Context, __VA_ARGS__) -#define mglUniformMatrix4fv(...) \ - gles2Interface->UniformMatrix4fv(gles2Context, __VA_ARGS__) -#define mglVertexAttrib1f(...) \ - gles2Interface->VertexAttrib1f(gles2Context, __VA_ARGS__) -#define mglVertexAttrib2f(...) \ - gles2Interface->VertexAttrib2f(gles2Context, __VA_ARGS__) -#define mglVertexAttrib3f(...) \ - gles2Interface->VertexAttrib3f(gles2Context, __VA_ARGS__) -#define mglVertexAttrib4f(...) \ - gles2Interface->VertexAttrib4f(gles2Context, __VA_ARGS__) -#define mglVertexAttrib1fv(...) \ - gles2Interface->VertexAttrib1fv(gles2Context, __VA_ARGS__) -#define mglVertexAttrib2fv(...) \ - gles2Interface->VertexAttrib2fv(gles2Context, __VA_ARGS__) -#define mglVertexAttrib3fv(...) \ - gles2Interface->VertexAttrib3fv(gles2Context, __VA_ARGS__) -#define mglVertexAttrib4fv(...) \ - gles2Interface->VertexAttrib4fv(gles2Context, __VA_ARGS__) - -#endif // defined(__native_client__) && defined(USE_OPENGL) -#endif // RENDER_NACLGLFUNCTIONS_H diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 85053b7a3..358d8b13b 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -27,7 +27,7 @@ #include "graphicsvertexes.h" #include "logger.h" -#include "render/mgl.h" +#include "render/opengl/mgl.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/opengl/mgl.cpp b/src/render/opengl/mgl.cpp new file mode 100644 index 000000000..d60c8c1f6 --- /dev/null +++ b/src/render/opengl/mgl.cpp @@ -0,0 +1,32 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "render/opengl/mgl.h" + +#ifdef USE_OPENGL + +#include "debug.h" + +#define defName(name) name##_t m##name = nullptr + +// include function defines +#include "render/opengl/mgl.hpp" + +#endif diff --git a/src/render/opengl/mgl.h b/src/render/opengl/mgl.h new file mode 100644 index 000000000..626e88d13 --- /dev/null +++ b/src/render/opengl/mgl.h @@ -0,0 +1,38 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGLMGL_H +#define RENDER_OPENGLMGL_H + +#include "main.h" + +#ifdef USE_OPENGL + +#include "render/opengl/mgldefines.h" +#include "render/opengl/mgltypes.h" + +#define defName(name) extern name##_t m##name + +#include "render/opengl/mgl.hpp" + +#undef defName + +#endif // USE_OPENGL +#endif // RENDER_OPENGLMGL_H diff --git a/src/render/opengl/mgl.hpp b/src/render/opengl/mgl.hpp new file mode 100644 index 000000000..edf3882cf --- /dev/null +++ b/src/render/opengl/mgl.hpp @@ -0,0 +1,141 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +defName(glGenRenderbuffers); +defName(glBindRenderbuffer); +defName(glRenderbufferStorage); +defName(glGenFramebuffers); +defName(glBindFramebuffer); +defName(glFramebufferTexture2D); +defName(glFramebufferRenderbuffer); +defName(glDeleteFramebuffers); +defName(glDeleteRenderbuffers); +defName(glGetStringi); +defName(glGenSamplers); +defName(glDeleteSamplers); +defName(glBindSampler); +defName(glSamplerParameteri); +defName(glDebugMessageControl); +defName(glDebugMessageCallback); +defName(glFrameTerminator); +defName(glLabelObject); +defName(glGetObjectLabel); +defName(glInsertEventMarker); +defName(glPushGroupMarker); +defName(glPopGroupMarker); +defName(glGenVertexArrays); +defName(glBindVertexArray); +defName(glDeleteVertexArrays); +defName(glDisableVertexAttribArray); +defName(glDeleteShader); +defName(glGetShaderInfoLog); +defName(glGetShaderSource); +defName(glDetachShader); +defName(glGetAttachedShaders); +defName(glGetActiveUniform); +defName(glBindFragDataLocation); +#ifndef __native_client__ +defName(glDeleteProgram); +defName(glCreateProgram); +defName(glGetProgramiv); +defName(glLinkProgram); +defName(glAttachShader); +defName(glGetShaderiv); +defName(glCompileShader); +defName(glShaderSource); +defName(glCreateShader); +defName(glGetUniformLocation); +defName(glGenBuffers); +defName(glDeleteBuffers); +defName(glBindBuffer); +defName(glBufferData); +defName(glEnableVertexAttribArray); +defName(glVertexAttribPointer); +defName(glUseProgram); +defName(glUniform1f); +defName(glUniform2f); +defName(glUniform4f); +defName(glValidateProgram); +defName(glGetProgramInfoLog); +defName(glBindAttribLocation); +defName(glActiveTexture); + +#define mglDrawArrays(...) \ + glDrawArrays(__VA_ARGS__) +#define mglDisable(...) \ + glDisable(__VA_ARGS__) +#define mglHint(...) \ + glHint(__VA_ARGS__) +#define mglScissor(...) \ + glScissor(__VA_ARGS__) +#define mglEnable(...) \ + glEnable(__VA_ARGS__) +#define mglBindTexture(...) \ + glBindTexture(__VA_ARGS__) +#define mglGetIntegerv(...) \ + glGetIntegerv(__VA_ARGS__) +#define mglClear(...) \ + glClear(__VA_ARGS__) +#define mglGetString(...) \ + glGetString(__VA_ARGS__) +#define mglTexParameteri(...) \ + glTexParameteri(__VA_ARGS__) +#define mglTexImage2D(...) \ + glTexImage2D(__VA_ARGS__) +#define mglGenTextures(...) \ + glGenTextures(__VA_ARGS__) +#define mglPixelStorei(...) \ + glPixelStorei(__VA_ARGS__) +#define mglReadPixels(...) \ + glReadPixels(__VA_ARGS__) + +#endif +defName(glGetAttribLocation); +defName(glUniform3f); +defName(glCheckFramebufferStatus); +defName(glProgramUniform1f); +defName(glProgramUniform2f); +defName(glProgramUniform3f); +defName(glProgramUniform4f); +defName(glBindVertexBuffer); +defName(glVertexAttribBinding); +defName(glVertexAttribFormat); +defName(glBindVertexBuffers); +defName(glIsBuffer); +defName(glVertexAttribIFormat); +defName(glVertexAttribIPointer); +defName(glInvalidateTexImage); +defName(glCopyImageSubData); +defName(glPushDebugGroup); +defName(glPopDebugGroup); +defName(glObjectLabel); +defName(glTexStorage2D); +defName(glGenQueries); +defName(glBeginQuery); +defName(glEndQuery); +defName(glDeleteQueries); +defName(glGetQueryObjectiv); +defName(glGetQueryObjectui64v); +defName(glTextureSubImage2D); +defName(glClearTexImage); +defName(glClearTexSubImage); +#ifdef WIN32 +defName(wglGetExtensionsString); +#endif diff --git a/src/render/opengl/mglcheck.h b/src/render/opengl/mglcheck.h new file mode 100644 index 000000000..3c7cdc73c --- /dev/null +++ b/src/render/opengl/mglcheck.h @@ -0,0 +1,31 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_MGLCHECK_H +#define RENDER_OPENGL_MGLCHECK_H + +#include "main.h" +#ifdef USE_OPENGL + +#define isGLNull(func) (!(func)) +#define isGLNotNull(func) ((func) != nullptr) + +#endif // USE_OPENGL +#endif // RENDER_OPENGL_MGLCHECK_H diff --git a/src/render/opengl/mgldefines.h b/src/render/opengl/mgldefines.h new file mode 100644 index 000000000..4cf0b05d5 --- /dev/null +++ b/src/render/opengl/mgldefines.h @@ -0,0 +1,131 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_MGLDEFINES_H +#define RENDER_OPENGL_MGLDEFINES_H + +#ifdef USE_OPENGL + +#ifndef GL_NUM_EXTENSIONS +#define GL_NUM_EXTENSIONS 0x821D +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#endif + +#ifndef GL_COMPRESSED_RGBA_ARB +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif +#ifndef GL_MAX_ELEMENTS_VERTICES +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#endif + +#ifndef GL_DEBUG_OUTPUT +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_OUTPUT 0x92E0 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826a +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#endif + +#ifndef GL_EXT_debug_label +#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F +#define GL_PROGRAM_OBJECT_EXT 0x8B40 +#define GL_SHADER_OBJECT_EXT 0x8B48 +#define GL_BUFFER_OBJECT_EXT 0x9151 +#define GL_QUERY_OBJECT_EXT 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 +#endif + +#ifndef GL_ARRAY_BUFFER +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#endif + +#ifndef GL_STREAM_DRAW +#define GL_STREAM_DRAW 0x88E0 +#define GL_STATIC_DRAW 0x88E4 +#define GL_DYNAMIC_DRAW 0x88E8 +#endif + +#ifndef GL_COMPILE_STATUS +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#endif + +#ifndef GL_DEPTH_CLAMP +#define GL_DEPTH_CLAMP 0x864F +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_SAMPLE_MASK 0x8E51 +#endif + +#ifndef GL_POLYGON_SMOOTH +#define GL_POLYGON_SMOOTH 0x0B41 +#endif + +#ifndef GL_DEPTH_BOUNDS_TEST_EXT +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#endif + +#ifndef GL_TEXTURE_COMPRESSION_HINT_ARB +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#endif + +#ifndef GLX_CONTEXT_PROFILE_MASK_ARB +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 +#endif + +#ifndef GLX_CONTEXT_MAJOR_VERSION_ARB +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 +#endif + +#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#endif + +#endif // USE_OPENGL + +#endif // RENDER_OPENGL_MGLDEFINES_H diff --git a/src/render/opengl/mglemu.cpp b/src/render/opengl/mglemu.cpp new file mode 100644 index 000000000..347180f2d --- /dev/null +++ b/src/render/opengl/mglemu.cpp @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifdef USE_OPENGL + +#include "render/opengl/mglemu.h" + +#include "resources/openglimagehelper.h" + +#include "debug.h" + +void APIENTRY emuglTextureSubImage2D(GLuint texture, GLenum target, + GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const void *pixels) +{ + OpenGLImageHelper::bindTexture(texture); + glTexSubImage2D(target, level, + xoffset, yoffset, + width, height, + format, type, pixels); +} + +void APIENTRY emuglActiveTexture(GLenum texture A_UNUSED) +{ +} + +#endif diff --git a/src/render/opengl/mglemu.h b/src/render/opengl/mglemu.h new file mode 100644 index 000000000..f55f81013 --- /dev/null +++ b/src/render/opengl/mglemu.h @@ -0,0 +1,41 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_MGLEMU_H +#define RENDER_OPENGL_MGLEMU_H +#ifdef USE_OPENGL + +#include "render/opengl/mgltypes.h" + +void APIENTRY emuglTextureSubImage2D(GLuint texture, + GLenum target, + GLint level, + GLint xoffset, + GLint yoffset, + GLsizei width, + GLsizei height, + GLenum format, + GLenum type, + const void *pixels); + +void APIENTRY emuglActiveTexture(GLenum texture); + +#endif // USE_OPENGL +#endif // RENDER_OPENGL_MGLEMU_H diff --git a/src/render/opengl/mglfunctions.h b/src/render/opengl/mglfunctions.h new file mode 100644 index 000000000..faf8e9300 --- /dev/null +++ b/src/render/opengl/mglfunctions.h @@ -0,0 +1,99 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_MGLFUNCTIONS_H +#define RENDER_OPENGL_MGLFUNCTIONS_H + +#ifdef USE_OPENGL + +#include "logger.h" + +#ifdef WIN32 +#define getFunction(name) wglGetProcAddress(name) +#elif defined ANDROID +#define getFunction(name) eglGetProcAddress(name) +#elif defined __APPLE__ +#define getFunction(name) nullptr +#elif defined __native_client__ +#define getFunction(name) glGetProcAddressREGAL(name) +#else +#define getFunction(name) glXGetProcAddress(\ + reinterpret_cast(name)) +#endif + +#define assignFunction(func) \ + { \ + m##func = reinterpret_cast(getFunction(#func)); \ + if (m##func == nullptr) \ + logger->log("function not found: " #func); \ + else \ + logger->log("assigned function: " #func); \ + } + +#define assignFunction3(func, ext) \ + { \ + m##func = reinterpret_cast(getFunction(#func#ext)); \ + if (m##func == nullptr) \ + { \ + logger->log("function not found: " #func#ext); \ + m##func = reinterpret_cast(getFunction(#func)); \ + if (m##func == nullptr) \ + logger->log("function not found: " #func); \ + else \ + logger->log("assigned function: " #func); \ + } \ + else \ + { \ + logger->log("assigned function: " #func#ext); \ + } \ + } + +#define assignFunctionARB(func) assignFunction3(func, ARB) + +#define assignFunctionEXT(func) assignFunction3(func, EXT) + +#define assignFunction2(func, name) \ + { \ + m##func = reinterpret_cast(getFunction(name)); \ + if (m##func == nullptr) \ + logger->log(std::string("function not found: ") + name); \ + else \ + logger->log(std::string("assigned function: ") + name); \ + } + +#define assignFunctionEmu2(func, name) \ + { \ + m##func = reinterpret_cast(getFunction(name)); \ + if (m##func == nullptr) \ + { \ + m##func = emu##func; \ + logger->log(std::string("emulated function: ") + name); \ + } \ + else \ + { \ + logger->log(std::string("assigned function: ") + name); \ + } \ + } + +#define emulateFunction(func) m##func = emu##func; \ + logger->log("emulated function: " #func) + +#endif // USE_OPENGL +#endif // RENDER_OPENGL_MGLFUNCTIONS_H diff --git a/src/render/opengl/mgltypes.h b/src/render/opengl/mgltypes.h new file mode 100644 index 000000000..5969dbeec --- /dev/null +++ b/src/render/opengl/mgltypes.h @@ -0,0 +1,209 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_MGLTYPES_H +#define RENDER_OPENGL_MGLTYPES_H + +#include "main.h" + +#ifdef USE_OPENGL + +#include "render/opengl/mgldefines.h" + +#ifdef ANDROID +#include +#include +#define APIENTRY GL_APIENTRY +#else +#ifndef USE_SDL2 +#define GL_GLEXT_PROTOTYPES 1 +#endif +#include +#ifdef __native_client__ +#include +#else +#include +#endif +#endif + +#if defined(__GXX_EXPERIMENTAL_CXX0X__) +#include +#else +#include +#endif + +typedef void (APIENTRY *glGenRenderbuffers_t)(GLsizei, GLuint *); +typedef void (APIENTRY *glBindRenderbuffer_t)(GLenum target, + GLuint renderbuffer); +typedef void (APIENTRY *glRenderbufferStorage_t)(GLenum target, + GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRY *glGenFramebuffers_t)(GLsizei n, GLuint *framebuffers); +typedef void (APIENTRY *glBindFramebuffer_t)(GLenum target, + GLuint framebuffer); +typedef void (APIENTRY *glFramebufferTexture2D_t)(GLenum target, + GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRY *glFramebufferRenderbuffer_t)(GLenum target, + GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRY *glDeleteFramebuffers_t) (GLsizei, const GLuint *); +typedef void (APIENTRY *glDeleteRenderbuffers_t) (GLsizei, const GLuint *); +typedef const GLubyte *(APIENTRY *glGetStringi_t) (GLenum, GLuint); +typedef void (APIENTRY *glGenSamplers_t) (GLsizei count, GLuint *samplers); +typedef void (APIENTRY *glDeleteSamplers_t) + (GLsizei count, const GLuint * samplers); +typedef void (APIENTRY *glBindSampler_t) (GLuint unit, GLuint sampler); +typedef void (APIENTRY *glSamplerParameteri_t) + (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRY *glDebugMessageControl_t) (GLenum source, GLenum type, + GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (APIENTRY *glFrameTerminator_t) (void); +typedef void (APIENTRY *glLabelObject_t) (GLenum type, GLuint object, + GLsizei length, const GLchar *label); +typedef void (APIENTRY *glGetObjectLabel_t) (GLenum type, GLuint object, + GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (APIENTRY *glInsertEventMarker_t) + (GLsizei length, const char *marker); +typedef void (APIENTRY *glPushGroupMarker_t) + (GLsizei length, const char *marker); +typedef void (APIENTRY *glPopGroupMarker_t) (void); +typedef void (APIENTRY *glGenVertexArrays_t) (GLsizei n, GLuint *arrays); +typedef void (APIENTRY *glBindVertexArray_t) (GLuint array); +typedef void (APIENTRY *glDeleteVertexArrays_t) (GLsizei n, GLuint *arrays); +typedef void (APIENTRY *glDisableVertexAttribArray_t) (GLuint index); +typedef void (APIENTRY *glDeleteShader_t) (GLenum shader); +typedef void (APIENTRY *glGetShaderInfoLog_t) (GLuint shader, + GLsizei maxLength, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRY *glGetShaderSource_t) (GLuint shader, + GLsizei bufSize, GLsizei *length, GLchar *source); +typedef void (APIENTRY *glDetachShader_t) (GLuint program, GLuint shader); +typedef void (APIENTRY *glGetAttachedShaders_t) (GLuint program, + GLsizei maxCount, GLsizei *count, GLuint *shaders); +typedef void (APIENTRY *glGetActiveUniform_t) (GLuint program, GLuint index, + GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef GLint (APIENTRY *glBindFragDataLocation_t) (GLuint program, + GLuint colorNumber, const char *name); +#ifndef __native_client__ +typedef void (APIENTRY *glDeleteProgram_t) (GLuint program); +typedef GLuint (APIENTRY *glCreateProgram_t) (void); +typedef void (APIENTRY *glGetProgramiv_t) (GLuint program, + GLenum pname, GLint *params); +typedef void (APIENTRY *glLinkProgram_t) (GLuint program); +typedef void (APIENTRY *glAttachShader_t) (GLuint program, GLuint shader); +typedef void (APIENTRY *glGetShaderiv_t) (GLuint shader, + GLenum pname, GLint *params); +typedef void (APIENTRY *glCompileShader_t) (GLuint shader); +typedef void (APIENTRY *glShaderSource_t) (GLuint shader, + GLsizei count, const GLchar **string, const GLint *length); +typedef GLuint (APIENTRY *glCreateShader_t) (GLenum shaderType); +typedef GLint (APIENTRY *glGetUniformLocation_t) (GLuint program, + const GLchar *name); +typedef void (APIENTRY *glGenBuffers_t) (GLsizei n, GLuint *buffers); +typedef void (APIENTRY *glDeleteBuffers_t) (GLsizei n, GLuint *buffers); +typedef void (APIENTRY *glBindBuffer_t) (GLenum target, GLuint buffer); +typedef void (APIENTRY *glBufferData_t) (GLenum target, GLsizeiptr size, + const GLvoid *data, GLenum usage); +typedef void (APIENTRY *glEnableVertexAttribArray_t) (GLuint index); +typedef void (APIENTRY *glVertexAttribPointer_t) (GLuint index, GLint size, + GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRY *glUseProgram_t) (GLuint program); +typedef void (APIENTRY *glUniform1f_t) (GLint location, GLfloat v0); +typedef void (APIENTRY *glUniform2f_t) (GLint location, + GLfloat v0, GLfloat v1); +typedef void (APIENTRY *glUniform4f_t) (GLint location, + GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRY *glValidateProgram_t) (GLuint program); +typedef void (APIENTRY *glGetProgramInfoLog_t) (GLuint program, + GLsizei maxLength, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRY *glBindAttribLocation_t) (GLuint program, + GLuint index, const GLchar *name); +typedef void (APIENTRY *glActiveTexture_t) (GLenum texture); +#endif +typedef GLint (APIENTRY *glGetAttribLocation_t) (GLuint program, + const GLchar *name); +typedef void (APIENTRY *glUniform3f_t) (GLint location, + GLfloat v0, GLfloat v1, GLfloat v2); +typedef GLenum (APIENTRY *glCheckFramebufferStatus_t) (GLenum target); +typedef void (APIENTRY *glProgramUniform1f_t) (GLuint program, + GLint location, GLfloat v0); +typedef void (APIENTRY *glProgramUniform2f_t) (GLuint program, + GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRY *glProgramUniform3f_t) (GLuint program, + GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRY *glProgramUniform4f_t) (GLuint program, + GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRY *glBindVertexBuffer_t) (GLuint bindingindex, + GLuint buffer, GLintptr offset, GLintptr stride); +typedef void (APIENTRY *glVertexAttribBinding_t) (GLuint attribindex, + GLuint bindingindex); +typedef void (APIENTRY *glVertexAttribFormat_t) (GLuint attribindex, + GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (APIENTRY *glBindVertexBuffers_t) (GLuint first, GLsizei count, + const GLuint *buffers, const GLuint *offsets, const GLsizei *strides); +typedef GLboolean (APIENTRY *glIsBuffer_t) (GLuint buffer); +typedef void (APIENTRY *glVertexAttribIFormat_t) (GLuint attribindex, + GLint size, GLenum type, GLuint relativeoffset); +typedef void (APIENTRY *glVertexAttribIPointer_t) (GLuint index, GLint size, + GLenum type, GLsizei stride, const GLvoid * pointer); +typedef void (APIENTRY *glInvalidateTexImage_t) (GLuint texture, GLint level); +typedef void (APIENTRY *glCopyImageSubData_t) (GLuint srcName, + GLenum srcTarget, GLint srcLevel, + GLint srcX, GLint srcY, GLint srcZ, + GLuint dstName, GLenum dstTarget, GLint dstLevel, + GLint dstX, GLint dstY, GLint dstZ, + GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); +typedef void (APIENTRY *glPushDebugGroup_t) (GLenum source, GLuint id, + GLsizei length, const GLchar * message); +typedef void (APIENTRY *glPopDebugGroup_t) (void); +typedef void (APIENTRY *glObjectLabel_t) (GLenum identifier, GLuint name, + GLsizei length, const GLchar *label); +typedef void (APIENTRY *glTexStorage2D_t) (GLenum target, GLsizei levels, + GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRY *glGenQueries_t) (GLsizei n, GLuint *ids); +typedef void (APIENTRY *glBeginQuery_t) (GLenum target, GLuint id); +typedef void (APIENTRY *glEndQuery_t) (GLenum target); +typedef void (APIENTRY *glDeleteQueries_t) (GLsizei n, const GLuint *ids); +typedef void (APIENTRY *glGetQueryObjectiv_t) (GLuint id, + GLenum pname, GLint *params); +typedef void (APIENTRY *glGetQueryObjectui64v_t) (GLuint id, + GLenum pname, uint64_t *params); +typedef void (APIENTRY *glTextureSubImage2D_t) (GLuint texture, GLenum target, + GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + GLenum format, GLenum type, const void *pixels); +typedef void (APIENTRY *glClearTexImage_t) (GLuint texture, GLint level, + GLenum format, GLenum type, const void * data); +typedef void (APIENTRY *glClearTexSubImage_t) (GLuint texture, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, + GLsizei depth, GLenum format, GLenum type, const void * data); + +// callback +typedef void (APIENTRY *GLDEBUGPROC_t) (GLenum source, GLenum type, GLuint id, + GLenum severity, GLsizei length, const GLchar *message, GLvoid *userParam); + +typedef void (APIENTRY *glDebugMessageCallback_t) (GLDEBUGPROC_t callback, + const void *userParam); + + +#ifdef WIN32 +typedef const char* (APIENTRY * wglGetExtensionsString_t) (HDC hdc); +#else +#define CALLBACK +#endif + +#endif // USE_OPENGL +#endif // RENDER_OPENGL_MGLTYPES_H diff --git a/src/render/opengl/naclglfunctions.h b/src/render/opengl/naclglfunctions.h new file mode 100644 index 000000000..d1dad707b --- /dev/null +++ b/src/render/opengl/naclglfunctions.h @@ -0,0 +1,322 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_NACLGLFUNCTIONS_H +#define RENDER_OPENGL_NACLGLFUNCTIONS_H + +#if defined(__native_client__) && defined(USE_OPENGL) + +#include + +extern const struct PPB_OpenGLES2* gles2Interface; +extern PP_Resource gles2Context; + +#define mglDrawArrays(...) \ + gles2Interface->DrawArrays(gles2Context, __VA_ARGS__) +#define mglEnableVertexAttribArray(...) \ + gles2Interface->EnableVertexAttribArray(gles2Context, __VA_ARGS__) +#define mglVertexAttribPointer(...) \ + gles2Interface->VertexAttribPointer(gles2Context, __VA_ARGS__) +#define mglUseProgram(...) \ + gles2Interface->UseProgram(gles2Context, __VA_ARGS__) +#define mglViewport(...) \ + gles2Interface->Viewport(gles2Context, __VA_ARGS__) +#define mglGenBuffers(...) \ + gles2Interface->GenBuffers(gles2Context, __VA_ARGS__) +#define mglBindBuffer(...) \ + gles2Interface->BindBuffer(gles2Context, __VA_ARGS__) +#define mglBufferData(...) \ + gles2Interface->BufferData(gles2Context, __VA_ARGS__) +#define mglDeleteBuffers(...) \ + gles2Interface->DeleteBuffers(gles2Context, __VA_ARGS__) +#define mglGetUniformLocation(...) \ + gles2Interface->GetUniformLocation(gles2Context, __VA_ARGS__) +#define mglCreateShader(...) \ + gles2Interface->CreateShader(gles2Context, __VA_ARGS__) +#define mglShaderSource(...) \ + gles2Interface->ShaderSource(gles2Context, __VA_ARGS__) +#define mglCompileShader(...) \ + gles2Interface->CompileShader(gles2Context, __VA_ARGS__) +#define mglGetShaderiv(...) \ + gles2Interface->GetShaderiv(gles2Context, __VA_ARGS__) +#define mglAttachShader(...) \ + gles2Interface->AttachShader(gles2Context, __VA_ARGS__) +#define mglBindAttribLocation(...) \ + gles2Interface->BindAttribLocation(gles2Context, __VA_ARGS__) +#define mglLinkProgram(...) \ + gles2Interface->LinkProgram(gles2Context, __VA_ARGS__) +#define mglGetProgramiv(...) \ + gles2Interface->GetProgramiv(gles2Context, __VA_ARGS__) +#define mglClearColor(...) \ + gles2Interface->ClearColor(gles2Context, __VA_ARGS__) +#define mglUniform1f(...) \ + gles2Interface->Uniform1f(gles2Context, __VA_ARGS__) +#define mglUniform2f(...) \ + gles2Interface->Uniform2f(gles2Context, __VA_ARGS__) +#define mglUniform3f(...) \ + gles2Interface->Uniform3f(gles2Context, __VA_ARGS__) +#define mglUniform4f(...) \ + gles2Interface->Uniform4f(gles2Context, __VA_ARGS__) +#define mglUniform1i(...) \ + gles2Interface->Uniform1i(gles2Context, __VA_ARGS__) +#define mglUniform2i(...) \ + gles2Interface->Uniform2i(gles2Context, __VA_ARGS__) +#define mglUniform3i(...) \ + gles2Interface->Uniform3i(gles2Context, __VA_ARGS__) +#define mglUniform4i(...) \ + gles2Interface->Uniform4i(gles2Context, __VA_ARGS__) +#define mglUniform1fv(...) \ + gles2Interface->Uniform1fv(gles2Context, __VA_ARGS__) +#define mglUniform2fv(...) \ + gles2Interface->Uniform2fv(gles2Context, __VA_ARGS__) +#define mglUniform3fv(...) \ + gles2Interface->Uniform3fv(gles2Context, __VA_ARGS__) +#define mglUniform4fv(...) \ + gles2Interface->Uniform4fv(gles2Context, __VA_ARGS__) +#define mglUniform1iv(...) \ + gles2Interface->Uniform1iv(gles2Context, __VA_ARGS__) +#define mglUniform2iv(...) \ + gles2Interface->Uniform2iv(gles2Context, __VA_ARGS__) +#define mglUniform3iv(...) \ + gles2Interface->Uniform3iv(gles2Context, __VA_ARGS__) +#define mglUniform4iv(...) \ + gles2Interface->Uniform4iv(gles2Context, __VA_ARGS__) +#define mglActiveTexture(...) \ + gles2Interface->ActiveTexture(gles2Context, __VA_ARGS__) +#define mglBindTexture(...) \ + gles2Interface->BindTexture(gles2Context, __VA_ARGS__) +#define mglEnable(...) \ + gles2Interface->Enable(gles2Context, __VA_ARGS__) +#define mglClear(...) \ + gles2Interface->Clear(gles2Context, __VA_ARGS__) +#define mglValidateProgram(...) \ + gles2Interface->ValidateProgram(gles2Context, __VA_ARGS__) +#define mglDeleteProgram(...) \ + gles2Interface->DeleteProgram(gles2Context, __VA_ARGS__) +#define mglCreateProgram() \ + gles2Interface->CreateProgram(gles2Context) +#define mglGetProgramInfoLog(...) \ + gles2Interface->GetProgramInfoLog(gles2Context, __VA_ARGS__) +#define mglDisable(...) \ + gles2Interface->Disable(gles2Context, __VA_ARGS__) +#define mglHint(...) \ + gles2Interface->Hint(gles2Context, __VA_ARGS__) +#define mglScissor(...) \ + gles2Interface->Scissor(gles2Context, __VA_ARGS__) +#define mglEnable(...) \ + gles2Interface->Enable(gles2Context, __VA_ARGS__) +#define mglGetIntegerv(...) \ + gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__) +#define mglGetString(...) \ + gles2Interface->GetString(gles2Context, __VA_ARGS__) +#define mglBindFramebuffer(...) \ + gles2Interface->BindFramebuffer(gles2Context, __VA_ARGS__) +#define mglBindRenderbuffer(...) \ + gles2Interface->BindRenderbuffer(gles2Context, __VA_ARGS__) +#define mglBlendColor(...) \ + gles2Interface->BlendColor(gles2Context, __VA_ARGS__) +#define mglBlendEquation(...) \ + gles2Interface->BlendEquation(gles2Context, __VA_ARGS__) +#define mglBlendEquationSeparate(...) \ + gles2Interface->BlendEquationSeparate(gles2Context, __VA_ARGS__) +#define mglBlendFunc(...) \ + gles2Interface->BlendFunc(gles2Context, __VA_ARGS__) +#define mglBlendFuncSeparate(...) \ + gles2Interface->BlendFuncSeparate(gles2Context, __VA_ARGS__) +#define mglBufferSubData(...) \ + gles2Interface->BufferSubData(gles2Context, __VA_ARGS__) +#define mglCheckFramebufferStatus(...) \ + gles2Interface->CheckFramebufferStatus(gles2Context, __VA_ARGS__) +#define mglClearDepthf(...) \ + gles2Interface->ClearDepthf(gles2Context, __VA_ARGS__) +#define mglClearStencil(...) \ + gles2Interface->ClearStencil(gles2Context, __VA_ARGS__) +#define mglColorMask(...) \ + gles2Interface->ColorMask(gles2Context, __VA_ARGS__) +#define mglCompressedTexImage2D(...) \ + gles2Interface->CompressedTexImage2D(gles2Context, __VA_ARGS__) +#define mglCompressedTexSubImage2D(...) \ + gles2Interface->CompressedTexSubImage2D(gles2Context, __VA_ARGS__) +#define mglCopyTexImage2D(...) \ + gles2Interface->CopyTexImage2D(gles2Context, __VA_ARGS__) +#define mglCopyTexSubImage2D(...) \ + gles2Interface->CopyTexSubImage2D(gles2Context, __VA_ARGS__) +#define mglCullFace(...) \ + gles2Interface->CullFace(gles2Context, __VA_ARGS__) +#define mglDeleteFramebuffers(...) \ + gles2Interface->DeleteFramebuffers(gles2Context, __VA_ARGS__) +#define mglDeleteRenderbuffers(...) \ + gles2Interface->DeleteRenderbuffers(gles2Context, __VA_ARGS__) +#define mglDeleteShader(...) \ + gles2Interface->DeleteShader(gles2Context, __VA_ARGS__) +#define mglDeleteTextures(...) \ + gles2Interface->DeleteTextures(gles2Context, __VA_ARGS__) +#define mglDepthFunc(...) \ + gles2Interface->DepthFunc(gles2Context, __VA_ARGS__) +#define mglDepthMask(...) \ + gles2Interface->DepthMask(gles2Context, __VA_ARGS__) +#define mglDepthRangef(...) \ + gles2Interface->DepthRangef(gles2Context, __VA_ARGS__) +#define mglDetachShader(...) \ + gles2Interface->DetachShader(gles2Context, __VA_ARGS__) +#define mglDisableVertexAttribArray(...) \ + gles2Interface->DisableVertexAttribArray(gles2Context, __VA_ARGS__) +#define mglDrawElements(...) \ + gles2Interface->DrawElements(gles2Context, __VA_ARGS__) +#define mglFinish(...) \ + gles2Interface->Finish(gles2Context, __VA_ARGS__) +#define mglFlush(...) \ + gles2Interface->Flush(gles2Context, __VA_ARGS__) +#define mglFramebufferRenderbuffer(...) \ + gles2Interface->FramebufferRenderbuffer(gles2Context, __VA_ARGS__) +#define mglFramebufferTexture2D(...) \ + gles2Interface->FramebufferTexture2D(gles2Context, __VA_ARGS__) +#define mglFrontFace(...) \ + gles2Interface->FrontFace(gles2Context, __VA_ARGS__) +#define mglGenerateMipmap(...) \ + gles2Interface->GenerateMipmap(gles2Context, __VA_ARGS__) +#define mglGenFramebuffers(...) \ + gles2Interface->GenFramebuffers(gles2Context, __VA_ARGS__) +#define mglGenRenderbuffers(...) \ + gles2Interface->GenRenderbuffers(gles2Context, __VA_ARGS__) +#define mglGenTextures(...) \ + gles2Interface->GenTextures(gles2Context, __VA_ARGS__) +#define mglGetActiveAttrib(...) \ + gles2Interface->GetActiveAttrib(gles2Context, __VA_ARGS__) +#define mglGetActiveUniform(...) \ + gles2Interface->GetActiveUniform(gles2Context, __VA_ARGS__) +#define mglGetAttachedShaders(...) \ + gles2Interface->GetAttachedShaders(gles2Context, __VA_ARGS__) +#define mglGetAttribLocation(...) \ + gles2Interface->GetAttribLocation(gles2Context, __VA_ARGS__) +#define mglGetBooleanv(...) \ + gles2Interface->GetBooleanv(gles2Context, __VA_ARGS__) +#define mglGetBufferParameteriv(...) \ + gles2Interface->GetBufferParameteriv(gles2Context, __VA_ARGS__) +#define mglGetError(...) \ + gles2Interface->GetError(gles2Context, __VA_ARGS__) +#define mglGetFloatv(...) \ + gles2Interface->GetFloatv(gles2Context, __VA_ARGS__) +#define mglGetFramebufferAttachmentParameteriv(...) \ + gles2Interface->GetFramebufferAttachmentParameteriv(gles2Context, \ + __VA_ARGS__) +#define mglGetIntegerv(...) \ + gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__) +#define mglGetRenderbufferParameteriv(...) \ + gles2Interface->GetRenderbufferParameteriv(gles2Context, __VA_ARGS__) +#define mglGetShaderInfoLog(...) \ + gles2Interface->GetShaderInfoLog(gles2Context, __VA_ARGS__) +#define mglGetShaderPrecisionFormat(...) \ + gles2Interface->GetShaderPrecisionFormat(gles2Context, __VA_ARGS__) +#define mglGetShaderSource(...) \ + gles2Interface->GetShaderSource(gles2Context, __VA_ARGS__) +#define mglGetTexParameterfv(...) \ + gles2Interface->GetTexParameterfv(gles2Context, __VA_ARGS__) +#define mglGetTexParameteriv(...) \ + gles2Interface->GetTexParameteriv(gles2Context, __VA_ARGS__) +#define mglGetUniformfv(...) \ + gles2Interface->GetUniformfv(gles2Context, __VA_ARGS__) +#define mglGetUniformiv(...) \ + gles2Interface->GetUniformiv(gles2Context, __VA_ARGS__) +#define mglGetVertexAttribfv(...) \ + gles2Interface->GetVertexAttribfv(gles2Context, __VA_ARGS__) +#define mglGetVertexAttribiv(...) \ + gles2Interface->GetVertexAttribiv(gles2Context, __VA_ARGS__) +#define mglGetVertexAttribPointerv(...) \ + gles2Interface->GetVertexAttribPointerv(gles2Context, __VA_ARGS__) +#define mglIsBuffer(...) \ + gles2Interface->IsBuffer(gles2Context, __VA_ARGS__) +#define mglIsEnabled(...) \ + gles2Interface->IsEnabled(gles2Context, __VA_ARGS__) +#define mglIsFramebuffer(...) \ + gles2Interface->IsFramebuffer(gles2Context, __VA_ARGS__) +#define mglIsProgram(...) \ + gles2Interface->IsProgram(gles2Context, __VA_ARGS__) +#define mglIsRenderbuffer(...) \ + gles2Interface->IsRenderbuffer(gles2Context, __VA_ARGS__) +#define mglIsShader(...) \ + gles2Interface->IsShader(gles2Context, __VA_ARGS__) +#define mglIsTexture(...) \ + gles2Interface->IsTexture(gles2Context, __VA_ARGS__) +#define mglLineWidth(...) \ + gles2Interface->LineWidth(gles2Context, __VA_ARGS__) +#define mglPixelStorei(...) \ + gles2Interface->PixelStorei(gles2Context, __VA_ARGS__) +#define mglPolygonOffset(...) \ + gles2Interface->PolygonOffset(gles2Context, __VA_ARGS__) +#define mglReadPixels(...) \ + gles2Interface->ReadPixels(gles2Context, __VA_ARGS__) +#define mglReleaseShaderCompiler(...) \ + gles2Interface->ReleaseShaderCompiler(gles2Context, __VA_ARGS__) +#define mglRenderbufferStorage(...) \ + gles2Interface->RenderbufferStorage(gles2Context, __VA_ARGS__) +#define mglSampleCoverage(...) \ + gles2Interface->SampleCoverage(gles2Context, __VA_ARGS__) +#define mglShaderBinary(...) \ + gles2Interface->ShaderBinary(gles2Context, __VA_ARGS__) +#define mglStencilFunc(...) \ + gles2Interface->StencilFunc(gles2Context, __VA_ARGS__) +#define mglStencilFuncSeparate(...) \ + gles2Interface->StencilFuncSeparate(gles2Context, __VA_ARGS__) +#define mglStencilMask(...) \ + gles2Interface->StencilMask(gles2Context, __VA_ARGS__) +#define mglStencilMaskSeparate(...) \ + gles2Interface->StencilMaskSeparate(gles2Context, __VA_ARGS__) +#define mglStencilOp(...) \ + gles2Interface->StencilOp(gles2Context, __VA_ARGS__) +#define mglStencilOpSeparate(...) \ + gles2Interface->StencilOpSeparate(gles2Context, __VA_ARGS__) +#define mglTexImage2D(...) \ + gles2Interface->TexImage2D(gles2Context, __VA_ARGS__) +#define mglTexParameterf(...) \ + gles2Interface->TexParameterf(gles2Context, __VA_ARGS__) +#define mglTexParameterfv(...) \ + gles2Interface->TexParameterfv(gles2Context, __VA_ARGS__) +#define mglTexParameteri(...) \ + gles2Interface->TexParameteri(gles2Context, __VA_ARGS__) +#define mglTexParameteriv(...) \ + gles2Interface->TexParameteriv(gles2Context, __VA_ARGS__) +#define mglTexSubImage2D(...) \ + gles2Interface->TexSubImage2D(gles2Context, __VA_ARGS__) +#define mglUniformMatrix2fv(...) \ + gles2Interface->UniformMatrix2fv(gles2Context, __VA_ARGS__) +#define mglUniformMatrix3fv(...) \ + gles2Interface->UniformMatrix3fv(gles2Context, __VA_ARGS__) +#define mglUniformMatrix4fv(...) \ + gles2Interface->UniformMatrix4fv(gles2Context, __VA_ARGS__) +#define mglVertexAttrib1f(...) \ + gles2Interface->VertexAttrib1f(gles2Context, __VA_ARGS__) +#define mglVertexAttrib2f(...) \ + gles2Interface->VertexAttrib2f(gles2Context, __VA_ARGS__) +#define mglVertexAttrib3f(...) \ + gles2Interface->VertexAttrib3f(gles2Context, __VA_ARGS__) +#define mglVertexAttrib4f(...) \ + gles2Interface->VertexAttrib4f(gles2Context, __VA_ARGS__) +#define mglVertexAttrib1fv(...) \ + gles2Interface->VertexAttrib1fv(gles2Context, __VA_ARGS__) +#define mglVertexAttrib2fv(...) \ + gles2Interface->VertexAttrib2fv(gles2Context, __VA_ARGS__) +#define mglVertexAttrib3fv(...) \ + gles2Interface->VertexAttrib3fv(gles2Context, __VA_ARGS__) +#define mglVertexAttrib4fv(...) \ + gles2Interface->VertexAttrib4fv(gles2Context, __VA_ARGS__) + +#endif // defined(__native_client__) && defined(USE_OPENGL) +#endif // RENDER_OPENGL_NACLGLFUNCTIONS_H diff --git a/src/render/opengl/opengldebug.h b/src/render/opengl/opengldebug.h new file mode 100644 index 000000000..b648c9b22 --- /dev/null +++ b/src/render/opengl/opengldebug.h @@ -0,0 +1,36 @@ +/* + * The ManaPlus Client + * Copyright (C) 2014-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef RENDER_OPENGL_OPENGLDEBUG_H +#define RENDER_OPENGL_OPENGLDEBUG_H + +#include "render/opengl/mgl.h" + +#if defined(DEBUG_OPENGL) && defined(USE_OPENGL) +#define GLDEBUG_START(text) if (mglPushGroupMarker) \ + mglPushGroupMarker(sizeof(text), text); +#define GLDEBUG_END() if (mglPopGroupMarker) \ + mglPopGroupMarker(); +#else +#define GLDEBUG_START(text) +#define GLDEBUG_END() +#endif + +#endif // RENDER_OPENGL_OPENGLDEBUG_H diff --git a/src/render/opengldebug.h b/src/render/opengldebug.h deleted file mode 100644 index 4067e051e..000000000 --- a/src/render/opengldebug.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * The ManaPlus Client - * Copyright (C) 2014-2015 The ManaPlus Developers - * - * This file is part of The ManaPlus Client. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef RENDER_OPENGLDEBUG_H -#define RENDER_OPENGLDEBUG_H - -#include "render/mgl.h" - -#if defined(DEBUG_OPENGL) && defined(USE_OPENGL) -#define GLDEBUG_START(text) if (mglPushGroupMarker) \ - mglPushGroupMarker(sizeof(text), text); -#define GLDEBUG_END() if (mglPopGroupMarker) \ - mglPopGroupMarker(); -#else -#define GLDEBUG_START(text) -#define GLDEBUG_END() -#endif - -#endif // RENDER_OPENGLDEBUG_H diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index af136cd19..71edb954d 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -23,7 +23,7 @@ #if defined USE_OPENGL && !defined ANDROID #include "render/safeopenglgraphics.h" -#include "render/mgl.h" +#include "render/opengl/mgl.h" #include "resources/image.h" #include "resources/imagerect.h" diff --git a/src/render/shaders/shader.cpp b/src/render/shaders/shader.cpp index 08a2282b4..6db645ac8 100644 --- a/src/render/shaders/shader.cpp +++ b/src/render/shaders/shader.cpp @@ -22,7 +22,7 @@ #include "render/shaders/shader.h" -#include "render/mgl.h" +#include "render/opengl/mgl.h" #include "debug.h" diff --git a/src/render/shaders/shaderprogram.cpp b/src/render/shaders/shaderprogram.cpp index 4cb4786c8..e239a3eb7 100644 --- a/src/render/shaders/shaderprogram.cpp +++ b/src/render/shaders/shaderprogram.cpp @@ -22,10 +22,10 @@ #include "render/shaders/shaderprogram.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "render/shaders/shader.h" diff --git a/src/render/shaders/shadersmanager.cpp b/src/render/shaders/shadersmanager.cpp index 9caed603d..724327b07 100644 --- a/src/render/shaders/shadersmanager.cpp +++ b/src/render/shaders/shadersmanager.cpp @@ -25,10 +25,10 @@ #include "configuration.h" #include "logger.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "render/shaders/shader.h" #include "render/shaders/shaderprogram.h" diff --git a/src/resources/mobileopenglscreenshothelper.cpp b/src/resources/mobileopenglscreenshothelper.cpp index 50dbcbc64..7efb0f3b9 100644 --- a/src/resources/mobileopenglscreenshothelper.cpp +++ b/src/resources/mobileopenglscreenshothelper.cpp @@ -27,10 +27,10 @@ #include "configuration.h" #include "graphicsmanager.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "debug.h" diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 0010d88b6..8cdf6beec 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -27,17 +27,18 @@ #include "graphicsmanager.h" #include "logger.h" -#include "render/mgl.h" -#include "render/mglcheck.h" #include "render/mobileopengl2graphics.h" #include "render/mobileopenglgraphics.h" #include "render/modernopenglgraphics.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif #include "render/normalopenglgraphics.h" #include "render/safeopenglgraphics.h" +#include "render/opengl/mgl.h" +#include "render/opengl/mglcheck.h" + #include "resources/dye.h" #include "resources/dyepalette.h" #include "resources/image.h" diff --git a/src/resources/openglscreenshothelper.cpp b/src/resources/openglscreenshothelper.cpp index 9d0edd80e..648ec6942 100644 --- a/src/resources/openglscreenshothelper.cpp +++ b/src/resources/openglscreenshothelper.cpp @@ -27,10 +27,10 @@ #include "configuration.h" #include "graphicsmanager.h" -#include "render/mgl.h" #ifdef __native_client__ -#include "render/naclglfunctions.h" +#include "render/opengl/naclglfunctions.h" #endif +#include "render/opengl/mgl.h" #include "debug.h" diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp index 44c8ca124..da6b750dd 100644 --- a/src/resources/safeopenglimagehelper.cpp +++ b/src/resources/safeopenglimagehelper.cpp @@ -27,14 +27,15 @@ #include "graphicsmanager.h" #include "logger.h" -#include "render/mgl.h" -#include "render/mglcheck.h" #include "render/mobileopengl2graphics.h" #include "render/mobileopenglgraphics.h" #include "render/modernopenglgraphics.h" #include "render/normalopenglgraphics.h" #include "render/safeopenglgraphics.h" +#include "render/opengl/mgl.h" +#include "render/opengl/mglcheck.h" + #include "resources/dye.h" #include "resources/dyepalette.h" #include "resources/image.h" diff --git a/src/utils/glxhelper.cpp b/src/utils/glxhelper.cpp index 42ac8ccb5..685f01760 100644 --- a/src/utils/glxhelper.cpp +++ b/src/utils/glxhelper.cpp @@ -24,11 +24,12 @@ #include "logger.h" -#include "render/mglcheck.h" -#include "render/mgldefines.h" #include "render/mglx.h" #include "render/mglxtypes.h" +#include "render/opengl/mglcheck.h" +#include "render/opengl/mgldefines.h" + #include "utils/stringutils.h" #include "debug.h" -- cgit v1.2.3-70-g09d2