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/androidoglcontextfactory.hpp')
-rw-r--r--android/jni/com/mapswithme/opengl/androidoglcontextfactory.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/android/jni/com/mapswithme/opengl/androidoglcontextfactory.hpp b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.hpp
new file mode 100644
index 0000000000..5f9a6ab0c1
--- /dev/null
+++ b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.hpp
@@ -0,0 +1,48 @@
+#pragma once
+
+#include "../core/jni_helper.hpp"
+#include "androidoglcontext.hpp"
+#include "../../../drape/oglcontextfactory.hpp"
+
+namespace android
+{
+
+class AndroidOGLContextFactory : public dp::OGLContextFactory
+{
+public:
+ AndroidOGLContextFactory(JNIEnv * env, jobject jsurface);
+ ~AndroidOGLContextFactory();
+
+ bool IsValid() const;
+
+ virtual dp::OGLContext * getDrawContext();
+ virtual dp::OGLContext * getResourcesUploadContext();
+
+ int GetWidth() const;
+ int GetHeight() const;
+ void UpdateSurfaceSize();
+
+private:
+ bool QuerySurfaceSize();
+
+private:
+ bool createWindowSurface();
+ bool createPixelbufferSurface();
+
+ AndroidOGLContext * m_drawContext;
+ AndroidOGLContext * m_uploadContext;
+
+ EGLSurface m_windowSurface;
+ EGLSurface m_pixelbufferSurface;
+ EGLConfig m_config;
+
+ ANativeWindow * m_nativeWindow;
+ EGLDisplay m_display;
+
+ int m_surfaceWidth;
+ int m_surfaceHeight;
+
+ bool m_valid;
+};
+
+} // namespace android