gpmark

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/ios/glview.h	Wed Jun 05 22:33:37 2013 +0300
     1.3 @@ -0,0 +1,34 @@
     1.4 +#import <UIKit/UIKit.h>
     1.5 +#import <QuartzCore/QuartzCore.h>
     1.6 +
     1.7 +#import <OpenGLES/ES2/gl.h>
     1.8 +#import <OpenGLES/ES2/glext.h>
     1.9 +
    1.10 +@interface GLView : UIView
    1.11 +{
    1.12 +@private
    1.13 +	int xsz, ysz;
    1.14 +	EAGLContext *context;
    1.15 +
    1.16 +	unsigned int fbo, rbuf_color, rbuf_depth;
    1.17 +
    1.18 +	BOOL animating;
    1.19 +	BOOL display_link_supported;
    1.20 +	NSInteger anim_frame_interval;
    1.21 +	// Use of the CADisplayLink class is the preferred method for controlling your animation timing.
    1.22 +	// CADisplayLink will link to the main display and fire every vsync when added to a given run-loop.
    1.23 +	// The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink
    1.24 +	// isn't available.
    1.25 +	id display_link;
    1.26 +	NSTimer *anim_timer;
    1.27 +}
    1.28 +
    1.29 +@property (readonly, nonatomic, getter=isAnimating) BOOL animating;
    1.30 +@property (nonatomic) NSInteger anim_frame_interval;
    1.31 +
    1.32 +- (void)startAnimation;
    1.33 +- (void)stopAnimation;
    1.34 +- (void)drawView: (id)sender;
    1.35 +- (void)swap_buffers;
    1.36 +
    1.37 +@end