summaryrefslogtreecommitdiff
path: root/platform/iphone/gl_view.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/iphone/gl_view.mm')
-rw-r--r--platform/iphone/gl_view.mm26
1 files changed, 18 insertions, 8 deletions
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm
index 6f4d0ddb57..004f53b280 100644
--- a/platform/iphone/gl_view.mm
+++ b/platform/iphone/gl_view.mm
@@ -285,16 +285,26 @@ static void clear_touches() {
kEAGLDrawablePropertyColorFormat,
nil];
- // Create our EAGLContext, and if successful make it current and create our framebuffer.
- context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
-
- if (!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer]) {
+ // Create a context based on the gl driver from project settings
+ if (GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3") {
+ context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
+ NSLog(@"Setting up an OpenGL ES 3 context. Based on Project Settings \"rendering/quality/driver/driver_name\"");
+ } else if (GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES2") {
context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
gles3_available = false;
- if (!context || ![EAGLContext setCurrentContext:context] || ![self createFramebuffer]) {
- [self release];
- return nil;
- }
+ NSLog(@"Setting up an OpenGL ES 2 context. Based on Project Settings \"rendering/quality/driver/driver_name\"");
+ }
+ if (!context) {
+ NSLog(@"Failed to create OpenGL ES context!");
+ return nil;
+ }
+ if (![EAGLContext setCurrentContext:context]) {
+ NSLog(@"Failed to set EAGLContext!");
+ return nil;
+ }
+ if (![self createFramebuffer]) {
+ NSLog(@"Failed to create frame buffer!");
+ return nil;
}
// Default the animation interval to 1/60th of a second.