src/video/uikit/SDL_uikitopenglview.h
author Kees Bakker <kees@ijzerbout.nl>
Tue, 27 Sep 2011 21:07:09 +0200
changeset 6002 0c0aaaa1e5ed
parent 6001 3ae3d1e58d59
child 6003 fddf81967e2d
permissions -rw-r--r--
Remove INDENT-ON INDENT-OFF comments in src/video/uikit

These comments are only useful for running indent which we are
probably not going to use in Objective-C context.
slouken@2765
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@5535
     3
  Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
slouken@2765
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@2765
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@2765
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@2765
    20
*/
slouken@2765
    21
slouken@2765
    22
#import <UIKit/UIKit.h>
slouken@2765
    23
#import <OpenGLES/EAGL.h>
slouken@2765
    24
#import <OpenGLES/ES1/gl.h>
slouken@2765
    25
#import <OpenGLES/ES1/glext.h>
slouken@2765
    26
#import "SDL_uikitview.h"
slouken@2765
    27
/*
slouken@5209
    28
    This class wraps the CAEAGLLayer from CoreAnimation into a convenient UIView subclass.
slouken@5209
    29
    The view content is basically an EAGL surface you render your OpenGL scene into.
slouken@5209
    30
    Note that setting the view non-opaque will only work if the EAGL surface has an alpha channel.
slouken@2765
    31
 */
slouken@2765
    32
@interface SDL_uikitopenglview : SDL_uikitview {
kees@6001
    33
slouken@2765
    34
@private
slouken@5209
    35
    /* The pixel dimensions of the backbuffer */
slouken@5209
    36
    GLint backingWidth;
slouken@5209
    37
    GLint backingHeight;
kees@6001
    38
slouken@5209
    39
    EAGLContext *context;
kees@6001
    40
slouken@5209
    41
    /* OpenGL names for the renderbuffer and framebuffers used to render to this view */
slouken@5209
    42
    GLuint viewRenderbuffer, viewFramebuffer;
kees@6001
    43
slouken@5209
    44
    /* OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist) */
slouken@5209
    45
    GLuint depthRenderbuffer;
icculus@5527
    46
icculus@5527
    47
    /* format of depthRenderbuffer */
icculus@5527
    48
    GLenum depthBufferFormat;
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@5209
    57
    retainBacking:(BOOL)retained \
slouken@5209
    58
    rBits:(int)rBits \
slouken@5209
    59
    gBits:(int)gBits \
slouken@5209
    60
    bBits:(int)bBits \
slouken@5209
    61
    aBits:(int)aBits \
slouken@5209
    62
    depthBits:(int)depthBits \
slouken@5209
    63
    majorVersion:(int)majorVersion;
slouken@2765
    64
icculus@5527
    65
- (void)updateFrame;
icculus@5527
    66
slouken@2765
    67
@end
slouken@5133
    68
slouken@5133
    69
/* vi: set ts=4 sw=4 expandtab: */