summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-10 13:22:43 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-10 13:22:43 +0300
commit7ad652a0c4d70e7bbca309dd7a1d0b824b6f5efa (patch)
tree080f86218f6deb792df49678137070689d808bfe
parentdf56c8f79f51cf3ea5118b2e8b82930cd71c2679 (diff)
downloadManaVerse-7ad652a0c4d70e7bbca309dd7a1d0b824b6f5efa.tar.gz
ManaVerse-7ad652a0c4d70e7bbca309dd7a1d0b824b6f5efa.tar.bz2
ManaVerse-7ad652a0c4d70e7bbca309dd7a1d0b824b6f5efa.tar.xz
ManaVerse-7ad652a0c4d70e7bbca309dd7a1d0b824b6f5efa.zip
Simplify GLX functions defenition.
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/render/mglx.cpp9
-rw-r--r--src/render/mglx.h14
-rw-r--r--src/render/mglx.hpp27
5 files changed, 33 insertions, 19 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4f5eb6817..d116b4aeb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -866,6 +866,7 @@ SET(SRCS
render/mgltypes.h
render/mglx.cpp
render/mglx.h
+ render/mglx.hpp
render/mglxinit.cpp
render/mglxinit.h
render/mglxtypes.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 8c0554425..e6b55938c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -987,6 +987,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
render/mgltypes.h \
render/mglx.cpp \
render/mglx.h \
+ render/mglx.hpp \
render/mglxinit.cpp \
render/mglxinit.h \
render/mglxtypes.h \
diff --git a/src/render/mglx.cpp b/src/render/mglx.cpp
index b5390fb11..694bdbb6f 100644
--- a/src/render/mglx.cpp
+++ b/src/render/mglx.cpp
@@ -25,13 +25,6 @@
#include "debug.h"
#define defName(name) name##_t m##name = nullptr
-
-defName(glXCreateContext);
-defName(glXGetCurrentContext);
-defName(glXCreateContextAttribs);
-defName(glXChooseFBConfig);
-defName(glXDestroyContext);
-defName(glXMakeCurrent);
-defName(glXSwapBuffers);
+#include "render/mglx.hpp"
#endif
diff --git a/src/render/mglx.h b/src/render/mglx.h
index d0a626b9a..72777489c 100644
--- a/src/render/mglx.h
+++ b/src/render/mglx.h
@@ -26,17 +26,9 @@
#include "render/mglxtypes.h"
-#define defNameE(name) extern name##_t m##name
-
-defNameE(glXCreateContext);
-defNameE(glXGetCurrentContext);
-defNameE(glXCreateContextAttribs);
-defNameE(glXChooseFBConfig);
-defNameE(glXDestroyContext);
-defNameE(glXMakeCurrent);
-defNameE(glXSwapBuffers);
-
-#undef defNameE
+#define defName(name) extern name##_t m##name
+#include "render/mglx.hpp"
+#undef defName
#endif // defined(USE_OPENGL) && defined(USE_X11)
#endif // RENDER_MGLX_H
diff --git a/src/render/mglx.hpp b/src/render/mglx.hpp
new file mode 100644
index 000000000..abc06d9a1
--- /dev/null
+++ b/src/render/mglx.hpp
@@ -0,0 +1,27 @@
+/*
+ * 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(glXCreateContext);
+defName(glXGetCurrentContext);
+defName(glXCreateContextAttribs);
+defName(glXChooseFBConfig);
+defName(glXDestroyContext);
+defName(glXMakeCurrent);
+defName(glXSwapBuffers);