summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-01 20:48:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-01 23:00:29 +0300
commit1a21baa93fd555e25b95732590282ba9a63dea86 (patch)
treee35bdcd4225da1f93b0a25897c5c2a0b8817653a
parenta391d50cc061b16bcae121a868e848f8ea7c65d2 (diff)
downloadmanaverse-1a21baa93fd555e25b95732590282ba9a63dea86.tar.gz
manaverse-1a21baa93fd555e25b95732590282ba9a63dea86.tar.bz2
manaverse-1a21baa93fd555e25b95732590282ba9a63dea86.tar.xz
manaverse-1a21baa93fd555e25b95732590282ba9a63dea86.zip
Fix compilation nacl with OpenGL (regal).
-rwxr-xr-xconfigure.ac7
-rw-r--r--src/graphicsmanager.cpp2
-rw-r--r--src/localconsts.h2
-rw-r--r--src/render/mglfunctions.h2
-rw-r--r--src/render/mgltypes.h4
-rw-r--r--src/render/mobileopenglgraphics.h2
-rw-r--r--src/render/modernopenglgraphics.h2
-rw-r--r--src/render/normalopenglgraphics.h2
-rw-r--r--src/render/nullopenglgraphics.h2
-rw-r--r--src/render/safeopenglgraphics.h2
-rw-r--r--src/resources/fboinfo.h2
-rw-r--r--src/test/testlauncher.h4
12 files changed, 29 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 2ba061c9c..548e18f04 100755
--- a/configure.ac
+++ b/configure.ac
@@ -254,10 +254,11 @@ if test "x$with_opengl" == "xno"; then
else
with_opengl=yes
if test "x$applebuild_enabled" == "xfalse"; then
-
if test "x$androidbuild_enabled" == "xfalse"; then
- AC_CHECK_LIB([GL], [glBegin], ,
- AC_MSG_ERROR([ *** Unable to find OpenGL library]))
+ if test "x$naclbuild_enabled" == "xfalse"; then
+ AC_CHECK_LIB([GL], [glBegin], ,
+ AC_MSG_ERROR([ *** Unable to find OpenGL library]))
+ fi
else
LDFLAGS="$LDFLAGS -lGLESv1_CM -lEGL"
fi
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index a429ac765..22850848d 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -31,6 +31,8 @@
#ifndef USE_SDL2
#include <SDL_android.h>
#endif // USE_SDL2
+#elif defined(__native_client__)
+#include <GL/Regal.h>
#else // ANDROID
#include <GL/glx.h>
#endif // ANDROID
diff --git a/src/localconsts.h b/src/localconsts.h
index 9367cb015..c005e47d8 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -179,7 +179,7 @@
// #define ANDROID_LOG 1
// nacl logging
-// #define NACL_LOG 1
+#define NACL_LOG 1
// profiler
// #define USE_PROFILER 1
diff --git a/src/render/mglfunctions.h b/src/render/mglfunctions.h
index 8be722b98..cc9c95c6f 100644
--- a/src/render/mglfunctions.h
+++ b/src/render/mglfunctions.h
@@ -31,6 +31,8 @@
#define getFunction(name) eglGetProcAddress(name)
#elif defined __APPLE__
#define getFunction(name) nullptr
+#elif defined __native_client__
+#define getFunction(name) SDL_GL_GetProcAddress(name)
#else
#define getFunction(name) glXGetProcAddress(\
reinterpret_cast<const GLubyte*>(name))
diff --git a/src/render/mgltypes.h b/src/render/mgltypes.h
index 330524232..5d033abf3 100644
--- a/src/render/mgltypes.h
+++ b/src/render/mgltypes.h
@@ -36,8 +36,12 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifdef __native_client__
+#include <GL/Regal.h>
+#else
#include <GL/glext.h>
#endif
+#endif
#if defined(__GXX_EXPERIMENTAL_CXX0X__)
#include <cstdint>
diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h
index 16442bbc3..6ae2c4d08 100644
--- a/src/render/mobileopenglgraphics.h
+++ b/src/render/mobileopenglgraphics.h
@@ -39,8 +39,10 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
class OpenGLGraphicsVertexes;
diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h
index 792c4224c..b1ee15a8f 100644
--- a/src/render/modernopenglgraphics.h
+++ b/src/render/modernopenglgraphics.h
@@ -39,8 +39,10 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
class OpenGLGraphicsVertexes;
class ShaderProgram;
diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h
index 54ab4df99..7d73223b6 100644
--- a/src/render/normalopenglgraphics.h
+++ b/src/render/normalopenglgraphics.h
@@ -39,8 +39,10 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
class OpenGLGraphicsVertexes;
diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h
index 10853adec..abd73a117 100644
--- a/src/render/nullopenglgraphics.h
+++ b/src/render/nullopenglgraphics.h
@@ -39,8 +39,10 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
class OpenGLGraphicsVertexes;
diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h
index 440ba7a39..8a162e8d6 100644
--- a/src/render/safeopenglgraphics.h
+++ b/src/render/safeopenglgraphics.h
@@ -37,8 +37,10 @@
#define GL_GLEXT_PROTOTYPES 1
#endif
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
class SafeOpenGLGraphics final : public Graphics
{
diff --git a/src/resources/fboinfo.h b/src/resources/fboinfo.h
index 0898666e5..a6caaaddb 100644
--- a/src/resources/fboinfo.h
+++ b/src/resources/fboinfo.h
@@ -30,8 +30,10 @@
#include <GLES/glext.h>
#else
#include <SDL_opengl.h>
+#ifndef __native_client__
#include <GL/glext.h>
#endif
+#endif
struct FBOInfo final
{
diff --git a/src/test/testlauncher.h b/src/test/testlauncher.h
index 76fb801c3..dc8c5024d 100644
--- a/src/test/testlauncher.h
+++ b/src/test/testlauncher.h
@@ -30,6 +30,10 @@
#include <sys/time.h>
#endif
+#ifdef __native_client__
+#include <sys/time.h>
+#endif
+
#include "localconsts.h"
class TestLauncher final