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 'iphone/Maps/Classes/EAGLView.mm')
-rw-r--r--iphone/Maps/Classes/EAGLView.mm16
1 files changed, 15 insertions, 1 deletions
diff --git a/iphone/Maps/Classes/EAGLView.mm b/iphone/Maps/Classes/EAGLView.mm
index 0a498b13b6..beac617528 100644
--- a/iphone/Maps/Classes/EAGLView.mm
+++ b/iphone/Maps/Classes/EAGLView.mm
@@ -59,9 +59,22 @@ double getExactDPI(double contentScaleFactor)
return self;
}
+- (dp::ApiVersion)getSupportedApiVersion
+{
+ dp::ApiVersion apiVersion = dp::ApiVersion::OpenGLES2;
+ EAGLContext * tempContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
+ if (tempContext != nil)
+ {
+ tempContext = nil;
+ apiVersion = dp::ApiVersion::OpenGLES3;
+ }
+ return apiVersion;
+}
+
- (void)initialize
{
lastViewSize = CGRectZero;
+ m_apiVersion = [self getSupportedApiVersion];
// Setup Layer Properties
CAEAGLLayer * eaglLayer = (CAEAGLLayer *)self.layer;
@@ -73,7 +86,7 @@ double getExactDPI(double contentScaleFactor)
// Correct retina display support in opengl renderbuffer
self.contentScaleFactor = [[UIScreen mainScreen] nativeScale];
- m_factory = make_unique_dp<dp::ThreadSafeFactory>(new iosOGLContextFactory(eaglLayer));
+ m_factory = make_unique_dp<dp::ThreadSafeFactory>(new iosOGLContextFactory(eaglLayer, m_apiVersion));
}
- (void)createDrapeEngineWithWidth:(int)width height:(int)height
@@ -81,6 +94,7 @@ double getExactDPI(double contentScaleFactor)
LOG(LINFO, ("EAGLView createDrapeEngine Started"));
Framework::DrapeCreationParams p;
+ p.m_apiVersion = m_apiVersion;
p.m_surfaceWidth = width;
p.m_surfaceHeight = height;
p.m_visualScale = dp::VisualScale(getExactDPI(self.contentScaleFactor));