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:
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, ());
}