gpmark

view src/ios/glview.h @ 0:5019d031b485

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 05 Jun 2013 22:33:37 +0300
parents
children
line source
1 #import <UIKit/UIKit.h>
2 #import <QuartzCore/QuartzCore.h>
4 #import <OpenGLES/ES2/gl.h>
5 #import <OpenGLES/ES2/glext.h>
7 @interface GLView : UIView
8 {
9 @private
10 int xsz, ysz;
11 EAGLContext *context;
13 unsigned int fbo, rbuf_color, rbuf_depth;
15 BOOL animating;
16 BOOL display_link_supported;
17 NSInteger anim_frame_interval;
18 // Use of the CADisplayLink class is the preferred method for controlling your animation timing.
19 // CADisplayLink will link to the main display and fire every vsync when added to a given run-loop.
20 // The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink
21 // isn't available.
22 id display_link;
23 NSTimer *anim_timer;
24 }
26 @property (readonly, nonatomic, getter=isAnimating) BOOL animating;
27 @property (nonatomic) NSInteger anim_frame_interval;
29 - (void)startAnimation;
30 - (void)stopAnimation;
31 - (void)drawView: (id)sender;
32 - (void)swap_buffers;
34 @end