summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-12-12 00:31:20 +0300
committerAndrei Karas <akaras@inbox.ru>2015-12-12 00:32:02 +0300
commit045180991b473e03e3283cc1a440dced876cf23a (patch)
tree914e9916f33e3004336050b5d422c463529452a7 /src
parent789b5f52993e4074bb8fd0f883e8a852fe60c733 (diff)
downloadmanaverse-045180991b473e03e3283cc1a440dced876cf23a.tar.gz
manaverse-045180991b473e03e3283cc1a440dced876cf23a.tar.bz2
manaverse-045180991b473e03e3283cc1a440dced876cf23a.tar.xz
manaverse-045180991b473e03e3283cc1a440dced876cf23a.zip
Replace glGetString into mglGetString.
Diffstat (limited to 'src')
-rw-r--r--src/graphicsmanager.cpp9
-rw-r--r--src/render/graphics.cpp7
-rw-r--r--src/render/mgl.hpp2
-rw-r--r--src/render/naclglfunctions.h2
4 files changed, 15 insertions, 5 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 7bf483ce8..a5ae02872 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -33,7 +33,7 @@
#endif // USE_SDL2
#elif defined(__native_client__)
#include <GL/Regal.h>
-#include "render/naclgles.h"
+#include "render/naclglfunctions.h"
#else // ANDROID
#include <GL/glx.h>
#endif // ANDROID
@@ -577,7 +577,7 @@ void GraphicsManager::updateExtensions()
else
{ // get extensions in old way
char const *extensions = reinterpret_cast<char const *>(
- glGetString(GL_EXTENSIONS));
+ mglGetString(GL_EXTENSIONS));
if (extensions)
{
logger->log1(extensions);
@@ -768,7 +768,7 @@ void GraphicsManager::updateTextureFormat() const
void GraphicsManager::logString(const char *const format, const int num)
{
- const char *str = reinterpret_cast<const char*>(glGetString(num));
+ const char *str = reinterpret_cast<const char*>(mglGetString(num));
if (!str)
logger->log(format, "?");
else
@@ -777,7 +777,7 @@ void GraphicsManager::logString(const char *const format, const int num)
std::string GraphicsManager::getGLString(const int num)
{
- const char *str = reinterpret_cast<const char*>(glGetString(num));
+ const char *str = reinterpret_cast<const char*>(mglGetString(num));
return str ? str : "";
}
@@ -895,7 +895,6 @@ void GraphicsManager::deleteFBO(FBOInfo *const fbo)
void GraphicsManager::initOpenGLFunctions()
{
#ifdef __native_client__
- NaclGles::initGles();
emulateFunction(glTextureSubImage2D);
#else
const bool is10 = checkGLVersion(1, 0);
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index dd1dab84d..ca97e86ee 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -77,6 +77,9 @@
#include "resources/imagehelper.h"
#ifdef USE_OPENGL
#include "resources/openglimagehelper.h"
+#if defined(__native_client__)
+#include "render/naclgles.h"
+#endif
#endif
#ifdef USE_OPENGL
@@ -266,6 +269,10 @@ bool Graphics::setOpenGLMode()
#if defined(USE_X11)
Glx::initFunctions();
#endif
+#ifdef __native_client__
+ NaclGles::initGles();
+#endif
+
#ifdef USE_SDL2
int w1 = 0;
int h1 = 0;
diff --git a/src/render/mgl.hpp b/src/render/mgl.hpp
index 50c1f8648..7da8ebabb 100644
--- a/src/render/mgl.hpp
+++ b/src/render/mgl.hpp
@@ -93,6 +93,8 @@ defName(glActiveTexture);
glGetIntegerv(__VA_ARGS__)
#define mglClear(...) \
glClear(__VA_ARGS__)
+#define mglGetString(...) \
+ glGetString(__VA_ARGS__)
#endif
defName(glGetAttribLocation);
diff --git a/src/render/naclglfunctions.h b/src/render/naclglfunctions.h
index 83757f07c..7d8810ec3 100644
--- a/src/render/naclglfunctions.h
+++ b/src/render/naclglfunctions.h
@@ -98,6 +98,8 @@ extern PP_Resource gles2Context;
gles2Interface->Enable(gles2Context, __VA_ARGS__)
#define mglGetIntegerv(...) \
gles2Interface->GetIntegerv(gles2Context, __VA_ARGS__)
+#define mglGetString(...) \
+ gles2Interface->GetString(gles2Context, __VA_ARGS__)
#endif // defined(__native_client__) && defined(USE_OPENGL)
#endif // RENDER_NACLGLFUNCTIONS_H