summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/render/mgl.cpp89
-rw-r--r--src/render/mgl.h93
-rw-r--r--src/render/mgl.hpp108
5 files changed, 114 insertions, 178 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3482b6d87..4f5eb6817 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -857,6 +857,7 @@ SET(SRCS
resources/map/objectslayer.h
render/mgl.cpp
render/mgl.h
+ render/mgl.hpp
render/mglcheck.h
render/mgldefines.h
render/mglemu.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 01580c643..8c0554425 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -978,6 +978,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
resources/map/objectslayer.h \
render/mgl.cpp \
render/mgl.h \
+ render/mgl.hpp \
render/mglcheck.h \
render/mgldefines.h \
render/mglemu.cpp \
diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp
index 27174a0c6..edd70b51e 100644
--- a/src/render/mgl.cpp
+++ b/src/render/mgl.cpp
@@ -26,93 +26,6 @@
#define defName(name) name##_t m##name = nullptr
-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(glVertexAttribPointer);
-defName(glEnableVertexAttribArray);
-defName(glDisableVertexAttribArray);
-defName(glGenBuffers);
-defName(glDeleteBuffers);
-defName(glBindBuffer);
-defName(glBufferData);
-defName(glCreateShader);
-defName(glDeleteShader);
-defName(glGetShaderiv);
-defName(glGetShaderInfoLog);
-defName(glGetShaderSource);
-defName(glShaderSource);
-defName(glCompileShader);
-defName(glLinkProgram);
-defName(glDeleteProgram);
-defName(glCreateProgram);
-defName(glAttachShader);
-defName(glDetachShader);
-defName(glGetAttachedShaders);
-defName(glGetUniformLocation);
-defName(glGetActiveUniform);
-defName(glGetProgramiv);
-defName(glBindFragDataLocation);
-defName(glUseProgram);
-defName(glValidateProgram);
-defName(glGetAttribLocation);
-defName(glUniform1f);
-defName(glUniform2f);
-defName(glUniform3f);
-defName(glUniform4f);
-defName(glCheckFramebufferStatus);
-defName(glGetProgramInfoLog);
-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
+#include "render/mgl.hpp"
#endif
diff --git a/src/render/mgl.h b/src/render/mgl.h
index d2ad570d9..7bd7190d6 100644
--- a/src/render/mgl.h
+++ b/src/render/mgl.h
@@ -27,98 +27,11 @@
#include "render/mgldefines.h"
#include "render/mgltypes.h"
-#define defNameE(name) extern name##_t m##name
+#define defName(name) extern name##_t m##name
-defNameE(glGenRenderbuffers);
-defNameE(glBindRenderbuffer);
-defNameE(glRenderbufferStorage);
-defNameE(glGenFramebuffers);
-defNameE(glBindFramebuffer);
-defNameE(glFramebufferTexture2D);
-defNameE(glFramebufferRenderbuffer);
-defNameE(glDeleteFramebuffers);
-defNameE(glDeleteRenderbuffers);
-defNameE(glGetStringi);
-defNameE(glGenSamplers);
-defNameE(glDeleteSamplers);
-defNameE(glBindSampler);
-defNameE(glSamplerParameteri);
-defNameE(glDebugMessageControl);
-defNameE(glDebugMessageCallback);
-defNameE(glFrameTerminator);
-defNameE(glLabelObject);
-defNameE(glGetObjectLabel);
-defNameE(glInsertEventMarker);
-defNameE(glPushGroupMarker);
-defNameE(glPopGroupMarker);
-defNameE(glGenVertexArrays);
-defNameE(glBindVertexArray);
-defNameE(glDeleteVertexArrays);
-defNameE(glVertexAttribPointer);
-defNameE(glEnableVertexAttribArray);
-defNameE(glDisableVertexAttribArray);
-defNameE(glGenBuffers);
-defNameE(glDeleteBuffers);
-defNameE(glBindBuffer);
-defNameE(glBufferData);
-defNameE(glCreateShader);
-defNameE(glDeleteShader);
-defNameE(glGetShaderiv);
-defNameE(glGetShaderInfoLog);
-defNameE(glGetShaderSource);
-defNameE(glShaderSource);
-defNameE(glCompileShader);
-defNameE(glLinkProgram);
-defNameE(glDeleteProgram);
-defNameE(glCreateProgram);
-defNameE(glAttachShader);
-defNameE(glDetachShader);
-defNameE(glGetAttachedShaders);
-defNameE(glGetUniformLocation);
-defNameE(glGetActiveUniform);
-defNameE(glGetProgramiv);
-defNameE(glBindFragDataLocation);
-defNameE(glUseProgram);
-defNameE(glValidateProgram);
-defNameE(glGetAttribLocation);
-defNameE(glUniform1f);
-defNameE(glUniform2f);
-defNameE(glUniform3f);
-defNameE(glUniform4f);
-defNameE(glCheckFramebufferStatus);
-defNameE(glGetProgramInfoLog);
-defNameE(glProgramUniform1f);
-defNameE(glProgramUniform2f);
-defNameE(glProgramUniform3f);
-defNameE(glProgramUniform4f);
-defNameE(glBindVertexBuffer);
-defNameE(glVertexAttribBinding);
-defNameE(glVertexAttribFormat);
-defNameE(glBindVertexBuffers);
-defNameE(glIsBuffer);
-defNameE(glVertexAttribIFormat);
-defNameE(glVertexAttribIPointer);
-defNameE(glInvalidateTexImage);
-defNameE(glCopyImageSubData);
-defNameE(glPushDebugGroup);
-defNameE(glPopDebugGroup);
-defNameE(glObjectLabel);
-defNameE(glTexStorage2D);
-defNameE(glGenQueries);
-defNameE(glBeginQuery);
-defNameE(glEndQuery);
-defNameE(glDeleteQueries);
-defNameE(glGetQueryObjectiv);
-defNameE(glGetQueryObjectui64v);
-defNameE(glTextureSubImage2D);
-defNameE(glClearTexImage);
-defNameE(glClearTexSubImage);
+#include "render/mgl.hpp"
-#ifdef WIN32
-defNameE(wglGetExtensionsString);
-#endif
-
-#undef defNameE
+#undef defName
#endif // USE_OPENGL
#endif // RENDER_MGL_H
diff --git a/src/render/mgl.hpp b/src/render/mgl.hpp
new file mode 100644
index 000000000..ed0b72a64
--- /dev/null
+++ b/src/render/mgl.hpp
@@ -0,0 +1,108 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2012-2014 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 <http://www.gnu.org/licenses/>.
+ */
+
+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(glVertexAttribPointer);
+defName(glEnableVertexAttribArray);
+defName(glDisableVertexAttribArray);
+defName(glGenBuffers);
+defName(glDeleteBuffers);
+defName(glBindBuffer);
+defName(glBufferData);
+defName(glCreateShader);
+defName(glDeleteShader);
+defName(glGetShaderiv);
+defName(glGetShaderInfoLog);
+defName(glGetShaderSource);
+defName(glShaderSource);
+defName(glCompileShader);
+defName(glLinkProgram);
+defName(glDeleteProgram);
+defName(glCreateProgram);
+defName(glAttachShader);
+defName(glDetachShader);
+defName(glGetAttachedShaders);
+defName(glGetUniformLocation);
+defName(glGetActiveUniform);
+defName(glGetProgramiv);
+defName(glBindFragDataLocation);
+defName(glUseProgram);
+defName(glValidateProgram);
+defName(glGetAttribLocation);
+defName(glUniform1f);
+defName(glUniform2f);
+defName(glUniform3f);
+defName(glUniform4f);
+defName(glCheckFramebufferStatus);
+defName(glGetProgramInfoLog);
+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