parent
dc114fa2ef
commit
29bde8cd74
|
@ -340,6 +340,7 @@ static void clear_touches() {
|
||||||
[EAGLContext setCurrentContext:context];
|
[EAGLContext setCurrentContext:context];
|
||||||
[self destroyFramebuffer];
|
[self destroyFramebuffer];
|
||||||
[self createFramebuffer];
|
[self createFramebuffer];
|
||||||
|
[self drawView];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)createFramebuffer {
|
- (BOOL)createFramebuffer {
|
||||||
|
@ -455,22 +456,22 @@ static void clear_touches() {
|
||||||
|
|
||||||
// Updates the OpenGL view when the timer fires
|
// Updates the OpenGL view when the timer fires
|
||||||
- (void)drawView {
|
- (void)drawView {
|
||||||
if (useCADisplayLink) {
|
|
||||||
// Pause the CADisplayLink to avoid recursion
|
|
||||||
[displayLink setPaused:YES];
|
|
||||||
|
|
||||||
// Process all input events
|
|
||||||
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource)
|
|
||||||
;
|
|
||||||
|
|
||||||
// We are good to go, resume the CADisplayLink
|
|
||||||
[displayLink setPaused:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!active) {
|
if (!active) {
|
||||||
printf("draw view not active!\n");
|
printf("draw view not active!\n");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
if (useCADisplayLink) {
|
||||||
|
// Pause the CADisplayLink to avoid recursion
|
||||||
|
[displayLink setPaused:YES];
|
||||||
|
|
||||||
|
// Process all input events
|
||||||
|
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, TRUE) == kCFRunLoopRunHandledSource)
|
||||||
|
;
|
||||||
|
|
||||||
|
// We are good to go, resume the CADisplayLink
|
||||||
|
[displayLink setPaused:NO];
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure that you are drawing to the current context
|
// Make sure that you are drawing to the current context
|
||||||
[EAGLContext setCurrentContext:context];
|
[EAGLContext setCurrentContext:context];
|
||||||
|
|
Loading…
Reference in New Issue