annotate src/video/uikit/SDL_uikitopenglview.h @ 2405:3d0b3a7d3bea gsoc2008_iphone

Added keyboard support in view initialization and proper deallocation of keyboard in -(void)dealloc, if keyboard is enabled
author Holmes Futrell <hfutrell@umail.ucsb.edu>
date Tue, 29 Jul 2008 17:19:23 +0000
parents e9a1eed243c9
children 907b96da7969
rev   line source
2403
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
1 /*
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
2 SDL - Simple DirectMedia Layer
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
3 Copyright (C) 1997-2006 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
4
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
5 This library is free software; you can redistribute it and/or
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
6 modify it under the terms of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
7 License as published by the Free Software Foundation; either
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
9
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
10 This library is distributed in the hope that it will be useful,
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
13 Lesser General Public License for more details.
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
14
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
15 You should have received a copy of the GNU Lesser General Public
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
16 License along with this library; if not, write to the Free Software
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
18
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
19 Sam Lantinga
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
20 slouken@libsdl.org
e9a1eed243c9 Added standard SDL header comments
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents: 2351
diff changeset
21 */
2351
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
22
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
23 #import <UIKit/UIKit.h>
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
24 #import <OpenGLES/EAGL.h>
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
25 #import <OpenGLES/ES1/gl.h>
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
26 #import <OpenGLES/ES1/glext.h>
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
27 #import "SDL_uikitview.h"
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
28 /*
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
29 This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
30 The view content is basically an EAGL surface you render your OpenGL scene into.
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
31 Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
32 */
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
33 @interface SDL_uikitopenglview : SDL_uikitview {
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
34
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
35 @private
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
36 /* The pixel dimensions of the backbuffer */
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
37 GLint backingWidth;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
38 GLint backingHeight;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
39
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
40 EAGLContext *context;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
41
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
42 /* OpenGL names for the renderbuffer and framebuffers used to render to this view */
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
43 GLuint viewRenderbuffer, viewFramebuffer;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
44
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
45 /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
46 GLuint depthRenderbuffer;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
47
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
48 }
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
49
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
50 @property (nonatomic, retain, readonly) EAGLContext *context;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
51
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
52 - (void)swapBuffers;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
53 - (void)setCurrentContext;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
54
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
55 - (id)initWithFrame:(CGRect)frame
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
56 retainBacking:(BOOL)retained \
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
57 rBits:(int)rBits \
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
58 gBits:(int)gBits \
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
59 bBits:(int)bBits \
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
60 aBits:(int)aBits \
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
61 depthBits:(int)depthBits;
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
62
d2a519d2cc57 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.
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
diff changeset
63 @end