00001
00002 #ifdef RT_IOS
00003 #ifdef __OBJC__
00004
00005 #include "Types.h"
00006
00007 void rendergroupEAGLViewStartTimer( void );
00008 void rendergroupEAGLViewStopTimer( void );
00009 void rendergroupEAGLViewDrawView( void );
00010 void rendergroupEAGLViewSetNeedsDisplay( void );
00011 void rendergroupEAGLViewSetContext( void );
00012 UIImage * rendergroupEAGLViewGetFramebufferImage( void );
00013 void rendergroupEAGLViewSaveFramebufferToPhotosAlbum( void );
00014 void rendergroupEAGLViewSaveFramebuffer( void );
00015
00016 GLuint rendergroupEAGLViewGetDefaultFramebufferID( void );
00017 GLuint rendergroupEAGLViewGetDefaultRenderbufferID( void );
00018
00019 #ifdef GL_APPLE_framebuffer_multisample
00020 # define USE_MULTISAMPLING
00021 #endif
00022
00024 #undef USE_MULTISAMPLING
00025
00026 #import "RendergroupIOSGLView.h"
00027
00028 @interface RendergroupEAGLView : UIView {
00029
00030 @private
00031
00032 EAGLContext * m_context;
00033 BOOL m_animating;
00034 BOOL m_displayLinkSupported;
00035 id m_displayLink;
00036 NSTimer * m_animationTimer;
00037 NSInteger m_animationFrameInterval;
00038
00039 GLuint m_defaultFramebuffer;
00040 GLuint m_defaultRenderbuffer;
00041 #ifdef USE_MULTISAMPLING
00042 GLuint m_msaaFramebuffer;
00043 GLuint m_msaaRenderbuffer;
00044 GLuint m_msaaDepthbuffer;
00045 #endif
00046 GLint m_framebufferWidth;
00047 GLint m_framebufferHeight;
00048
00049 NSMutableArray * m_holdingTouches;
00050 }
00051
00052 @property(readonly, nonatomic, getter=isAnimating) BOOL m_animating;
00053 @property(nonatomic, assign) NSTimer * m_animationTimer;
00054 @property(nonatomic) NSInteger m_animationFrameInterval;
00055 @property(nonatomic, readwrite) GLuint m_defaultFramebuffer;
00056 @property(nonatomic, readwrite) GLuint m_defaultRenderbuffer;
00057 @property(nonatomic, readwrite) GLint m_framebufferWidth;
00058 @property(nonatomic, readwrite) GLint m_framebufferHeight;
00059 @property(nonatomic, retain) EAGLContext * m_context;
00060
00061 - (void)startAnimation;
00062 - (void)stopAnimation;
00063 - (void)drawView;
00064 - (void)quit;
00065
00066 - (UIImage *) createFramebufferImage;
00067 - (void) imageSaved:( UIImage * ) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo;
00068 - (void) saveFramebufferToPhotosAlbum;
00069 - (void) saveFramebufferToDefault;
00070 - (BOOL) shouldAutorotateToInterfaceOrientation:( UIInterfaceOrientation ) interfaceOrientation;
00071 - (void) loadImage:( NSString * )url;
00072
00073 @end
00074
00075 RendergroupEAGLView * getRendergroupEAGLView( void );
00076
00077 #endif
00078
00079 #endif