diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 2ac158e6d374..4e6b8e1ada1c 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -340,6 +340,7 @@ - (void)layoutSubviews { [EAGLContext setCurrentContext:context]; [self destroyFramebuffer]; [self createFramebuffer]; + [self drawView]; } - (BOOL)createFramebuffer { @@ -455,23 +456,23 @@ - (void)setAnimationInterval:(NSTimeInterval)interval { // Updates the OpenGL view when the timer fires - (void)drawView { + + if (!active) { + printf("draw view not active!\n"); + return; + }; if (useCADisplayLink) { // Pause the CADisplayLink to avoid recursion [displayLink setPaused:YES]; // Process all input events - while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource) + while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, TRUE) == kCFRunLoopRunHandledSource) ; // We are good to go, resume the CADisplayLink [displayLink setPaused:NO]; } - if (!active) { - printf("draw view not active!\n"); - return; - }; - // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context];