istereo
diff src/EAGLView.h @ 0:1bb950d0976b
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 06 Sep 2011 08:07:14 +0300 |
parents | |
children | 23e5d274b2a2 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/EAGLView.h Tue Sep 06 08:07:14 2011 +0300 1.3 @@ -0,0 +1,40 @@ 1.4 +// 1.5 +// EAGLView.h 1.6 +// istereo 1.7 +// 1.8 +// Created by nuclear on 9/6/11. 1.9 +// Copyright __MyCompanyName__ 2011. All rights reserved. 1.10 +// 1.11 + 1.12 +#import <UIKit/UIKit.h> 1.13 +#import <QuartzCore/QuartzCore.h> 1.14 + 1.15 +#import "ESRenderer.h" 1.16 + 1.17 +// This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. 1.18 +// The view content is basically an EAGL surface you render your OpenGL scene into. 1.19 +// Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. 1.20 +@interface EAGLView : UIView 1.21 +{ 1.22 +@private 1.23 + id <ESRenderer> renderer; 1.24 + 1.25 + BOOL animating; 1.26 + BOOL displayLinkSupported; 1.27 + NSInteger animationFrameInterval; 1.28 + // Use of the CADisplayLink class is the preferred method for controlling your animation timing. 1.29 + // CADisplayLink will link to the main display and fire every vsync when added to a given run-loop. 1.30 + // The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink 1.31 + // isn't available. 1.32 + id displayLink; 1.33 + NSTimer *animationTimer; 1.34 +} 1.35 + 1.36 +@property (readonly, nonatomic, getter=isAnimating) BOOL animating; 1.37 +@property (nonatomic) NSInteger animationFrameInterval; 1.38 + 1.39 +- (void)startAnimation; 1.40 +- (void)stopAnimation; 1.41 +- (void)drawView:(id)sender; 1.42 + 1.43 +@end