summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-20 21:56:12 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:13 +0300
commita6f4bd5c8949c800a28f2de4291b096caec4cd89 (patch)
tree2c5f70b72038b47f10b08d319e26aa923ab4701a /src
parentf92e278da564dab15d984dcaba153c1a92752651 (diff)
downloadmv-a6f4bd5c8949c800a28f2de4291b096caec4cd89.tar.gz
mv-a6f4bd5c8949c800a28f2de4291b096caec4cd89.tar.bz2
mv-a6f4bd5c8949c800a28f2de4291b096caec4cd89.tar.xz
mv-a6f4bd5c8949c800a28f2de4291b096caec4cd89.zip
add configure option --with-sdl2 for enable SDL2 support.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am4
-rw-r--r--src/main.cpp13
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a915c8c06..72f3edae3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,10 @@ if USE_MUMBLE
manaplus_CXXFLAGS += -DUSE_MUMBLE
endif
+if USE_SDL2
+manaplus_CXXFLAGS += -DUSE_SDL2
+endif
+
if USE_INTERNALGUICHAN
manaplus_CXXFLAGS += -DUSE_INTERNALGUICHAN
manaplus_SOURCES += guichan/include/guichan/actionevent.hpp \
diff --git a/src/main.cpp b/src/main.cpp
index 55af95f4f..7bedd1b9d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -20,6 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
#include "main.h"
#include "client.h"
@@ -46,6 +47,18 @@
#include <windows.h>
#endif
+#include <SDL_version.h>
+
+#if SDL_VERSION_ATLEAST(2,0,0)
+#ifndef USE_SDL2
+#error using SDL2 headers but configure set to use SDL1.2
+#endif
+#else
+#ifdef USE_SDL2
+#error using SDL1.2 headers but configure set to use SDL2
+#endif
+#endif
+
#include "debug.h"
char *selfName = nullptr;