diff src/video/uikit/SDL_uikitopenglview.h @ 2351:d2a519d2cc57 gsoc2008_iphone

SDL_uikitopenglview is an OpenGL ES View class based on the one found in Apple's OpenGL ES based application template. It's created from SDL_uikitopengles.m, normally.
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Thu, 17 Jul 2008 22:35:59 +0000
parents
children e9a1eed243c9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/video/uikit/SDL_uikitopenglview.h	Thu Jul 17 22:35:59 2008 +0000
@@ -0,0 +1,50 @@
+//
+//  EAGLView.h
+//  test2
+//
+//  Created by Holmes Futrell on 7/11/08.
+//  Copyright __MyCompanyName__ 2008. All rights reserved.
+//
+
+
+#import <UIKit/UIKit.h>
+#import <OpenGLES/EAGL.h>
+#import <OpenGLES/ES1/gl.h>
+#import <OpenGLES/ES1/glext.h>
+#import "SDL_uikitview.h"
+/*
+ This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
+ The view content is basically an EAGL surface you render your OpenGL scene into.
+ Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
+ */
+@interface SDL_uikitopenglview : SDL_uikitview {
+	
+@private
+	/* The pixel dimensions of the backbuffer */
+	GLint backingWidth;
+	GLint backingHeight;
+	
+	EAGLContext *context;
+	
+	/* OpenGL names for the renderbuffer and framebuffers used to render to this view */
+	GLuint viewRenderbuffer, viewFramebuffer;
+	
+	/* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
+	GLuint depthRenderbuffer;
+	
+}
+
+@property (nonatomic, retain, readonly) EAGLContext *context;
+
+- (void)swapBuffers;
+- (void)setCurrentContext;
+
+- (id)initWithFrame:(CGRect)frame
+	retainBacking:(BOOL)retained \
+	rBits:(int)rBits \
+	gBits:(int)gBits \
+	bBits:(int)bBits \
+	aBits:(int)aBits \
+	depthBits:(int)depthBits;
+
+@end
\ No newline at end of file