view src/video/uikit/SDL_uikitopenglview.h @ 2353:07acabba25d9 gsoc2008_iphone

SDL_uikitview is just a generic view class which SDL_uikitopenglview inherits from. The functionality found in this class relates to (right now) mouse/touch input support. The reason for putting it here is that if someone wanted to write a render driver for iPhone based around CoreGraphics rather than OpenGL ES, they could make their Core Graphics view inherit from this class as well.
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Thu, 17 Jul 2008 22:43:09 +0000
parents d2a519d2cc57
children e9a1eed243c9
line wrap: on
line source

//
//  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