Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-05-16 14:42:32 +0300
committerGitHub <noreply@github.com>2017-05-16 14:42:32 +0300
commitd2f79bd2c7004af2d1459e8d5b7748763f241a54 (patch)
tree64300bccb750e59f7c3a05800eafcd5c3b3f89cb /android/jni/com/mapswithme/opengl/androidoglcontext.cpp
parentaa6703383e8d4c2ff8445e8b3c27728846cdab4b (diff)
parent086d6f9cf247cea07cff6bc33d5567dc7c64806b (diff)
Merge pull request #6040 from rokuz/es3-supportbeta-810
Added OpenGL ES3 support
Diffstat (limited to 'android/jni/com/mapswithme/opengl/androidoglcontext.cpp')
-rw-r--r--android/jni/com/mapswithme/opengl/androidoglcontext.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/android/jni/com/mapswithme/opengl/androidoglcontext.cpp b/android/jni/com/mapswithme/opengl/androidoglcontext.cpp
index 040f7a73c1..09fd588b81 100644
--- a/android/jni/com/mapswithme/opengl/androidoglcontext.cpp
+++ b/android/jni/com/mapswithme/opengl/androidoglcontext.cpp
@@ -1,21 +1,28 @@
#include "androidoglcontext.hpp"
#include "android_gl_utils.hpp"
+
#include "base/assert.hpp"
#include "base/logging.hpp"
+#include "base/src_point.hpp"
namespace android
{
-static EGLint * getContextAttributesList()
+static EGLint * getContextAttributesList(bool supportedES3)
{
static EGLint contextAttrList[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
- return contextAttrList;
+ static EGLint contextAttrListES3[] = {
+ EGL_CONTEXT_CLIENT_VERSION, 3,
+ EGL_NONE
+ };
+ return supportedES3 ? contextAttrListES3 : contextAttrList;
}
-AndroidOGLContext::AndroidOGLContext(EGLDisplay display, EGLSurface surface, EGLConfig config, AndroidOGLContext * contextToShareWith)
+AndroidOGLContext::AndroidOGLContext(bool supportedES3, EGLDisplay display, EGLSurface surface,
+ EGLConfig config, AndroidOGLContext * contextToShareWith)
: m_nativeContext(EGL_NO_CONTEXT)
, m_surface(surface)
, m_display(display)
@@ -24,7 +31,7 @@ AndroidOGLContext::AndroidOGLContext(EGLDisplay display, EGLSurface surface, EGL
ASSERT(m_display != EGL_NO_DISPLAY, ());
EGLContext sharedContext = (contextToShareWith == NULL) ? EGL_NO_CONTEXT : contextToShareWith->m_nativeContext;
- m_nativeContext = eglCreateContext(m_display, config, sharedContext, getContextAttributesList());
+ m_nativeContext = eglCreateContext(m_display, config, sharedContext, getContextAttributesList(supportedES3));
CHECK(m_nativeContext != EGL_NO_CONTEXT, ());
}