src/video/uikit/SDL_uikitopenglview.h
author Sam Lantinga <slouken@libsdl.org>
Tue, 01 Feb 2011 09:02:53 -0800
changeset 5133 b915b3181cc2
parent 3697 f7b03b6838cb
child 5209 115fff0641ee
permissions -rw-r--r--
Fixed spacing, adding vim spacing hints
slouken@2765
     1
/*
slouken@2765
     2
    SDL - Simple DirectMedia Layer
slouken@3697
     3
    Copyright (C) 1997-2010 Sam Lantinga
slouken@2765
     4
slouken@2765
     5
    This library is free software; you can redistribute it and/or
slouken@2765
     6
    modify it under the terms of the GNU Lesser General Public
slouken@2765
     7
    License as published by the Free Software Foundation; either
slouken@2765
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@2765
     9
slouken@2765
    10
    This library is distributed in the hope that it will be useful,
slouken@2765
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@2765
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@2765
    13
    Lesser General Public License for more details.
slouken@2765
    14
slouken@2765
    15
    You should have received a copy of the GNU Lesser General Public
slouken@2765
    16
    License along with this library; if not, write to the Free Software
slouken@2765
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@2765
    18
slouken@2765
    19
    Sam Lantinga
slouken@2765
    20
    slouken@libsdl.org
slouken@2765
    21
*/
slouken@2765
    22
slouken@2765
    23
#import <UIKit/UIKit.h>
slouken@2765
    24
#import <OpenGLES/EAGL.h>
slouken@2765
    25
#import <OpenGLES/ES1/gl.h>
slouken@2765
    26
#import <OpenGLES/ES1/glext.h>
slouken@2765
    27
#import "SDL_uikitview.h"
slouken@2765
    28
/*
slouken@2765
    29
	This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
slouken@2765
    30
	The view content is basically an EAGL surface you render your OpenGL scene into.
slouken@2765
    31
	Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
slouken@2765
    32
 */
slouken@2765
    33
/* *INDENT-OFF* */
slouken@2765
    34
@interface SDL_uikitopenglview : SDL_uikitview {
slouken@2765
    35
	
slouken@2765
    36
@private
slouken@2765
    37
	/* The pixel dimensions of the backbuffer */
slouken@2765
    38
	GLint backingWidth;
slouken@2765
    39
	GLint backingHeight;
slouken@2765
    40
	
slouken@2765
    41
	EAGLContext *context;
slouken@2765
    42
	
slouken@2765
    43
	/* OpenGL names for the renderbuffer and framebuffers used to render to this view */
slouken@2765
    44
	GLuint viewRenderbuffer, viewFramebuffer;
slouken@2765
    45
	
slouken@2765
    46
	/* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
slouken@2765
    47
	GLuint depthRenderbuffer;
slouken@2765
    48
	
slouken@2765
    49
}
slouken@2765
    50
slouken@2765
    51
@property (nonatomic, retain, readonly) EAGLContext *context;
slouken@2765
    52
slouken@2765
    53
- (void)swapBuffers;
slouken@2765
    54
- (void)setCurrentContext;
slouken@2765
    55
slouken@2765
    56
- (id)initWithFrame:(CGRect)frame
slouken@2765
    57
	retainBacking:(BOOL)retained \
slouken@2765
    58
	rBits:(int)rBits \
slouken@2765
    59
	gBits:(int)gBits \
slouken@2765
    60
	bBits:(int)bBits \
slouken@2765
    61
	aBits:(int)aBits \
slouken@2765
    62
	depthBits:(int)depthBits;
slouken@2765
    63
slouken@2765
    64
@end
slouken@2765
    65
/* *INDENT-ON* */
slouken@5133
    66
slouken@5133
    67
/* vi: set ts=4 sw=4 expandtab: */