nuclear@0: // nuclear@0: // EAGLView.h nuclear@0: // istereo nuclear@0: // nuclear@0: // Created by nuclear on 9/6/11. nuclear@0: // Copyright __MyCompanyName__ 2011. All rights reserved. nuclear@0: // nuclear@0: nuclear@0: #import nuclear@0: #import nuclear@0: nuclear@0: #import "ESRenderer.h" nuclear@0: nuclear@0: // This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass. nuclear@0: // The view content is basically an EAGL surface you render your OpenGL scene into. nuclear@0: // Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel. nuclear@0: @interface EAGLView : UIView nuclear@0: { nuclear@0: @private nuclear@0: id renderer; nuclear@0: nuclear@0: BOOL animating; nuclear@0: BOOL displayLinkSupported; nuclear@0: NSInteger animationFrameInterval; nuclear@0: // Use of the CADisplayLink class is the preferred method for controlling your animation timing. nuclear@0: // CADisplayLink will link to the main display and fire every vsync when added to a given run-loop. nuclear@0: // The NSTimer class is used only as fallback when running on a pre 3.1 device where CADisplayLink nuclear@0: // isn't available. nuclear@0: id displayLink; nuclear@0: NSTimer *animationTimer; nuclear@0: } nuclear@0: nuclear@0: @property (readonly, nonatomic, getter=isAnimating) BOOL animating; nuclear@0: @property (nonatomic) NSInteger animationFrameInterval; nuclear@0: nuclear@0: - (void)startAnimation; nuclear@0: - (void)stopAnimation; nuclear@0: - (void)drawView:(id)sender; nuclear@0: nuclear@0: @end