diff options
author | Rhody Lugo <rhodylugo@gmail.com> | 2015-02-10 15:24:22 -0430 |
---|---|---|
committer | Rhody Lugo <rhodylugo@gmail.com> | 2015-02-10 22:10:10 -0430 |
commit | d67e8667886329ad4717178e8e09ceef1a42af34 (patch) | |
tree | 97d908691ccb57337f268e2577e02e16c90abb39 /platform/iphone/gl_view.h | |
parent | 66d32b75b3d8b32033936c12b9585f519316035a (diff) |
add support for CADisplayLink
Diffstat (limited to 'platform/iphone/gl_view.h')
-rwxr-xr-x | platform/iphone/gl_view.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/iphone/gl_view.h b/platform/iphone/gl_view.h index 8ae7c2f87d..a5b1b8731f 100755 --- a/platform/iphone/gl_view.h +++ b/platform/iphone/gl_view.h @@ -34,6 +34,8 @@ #import <MediaPlayer/MediaPlayer.h> #import <AVFoundation/AVFoundation.h> +#define USE_CADISPLAYLINK 1 //iOS version 3.1+ is required + @protocol GLViewDelegate; @interface GLView : UIView<UIKeyInput> @@ -51,8 +53,14 @@ // OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) GLuint depthRenderbuffer; +#if USE_CADISPLAYLINK + // CADisplayLink available on 3.1+ synchronizes the animation timer & drawing with the refresh rate of the display, only supports animation intervals of 1/60 1/30 & 1/15 + CADisplayLink *displayLink; +#else // An animation timer that, when animation is started, will periodically call -drawView at the given rate. NSTimer *animationTimer; +#endif + NSTimeInterval animationInterval; // Delegate to do our drawing, called by -drawView, which can be called manually or via the animation timer. |