src/video/uikit/SDL_uikitopenglview.h
author Alex Szpakowski <slime73@gmail.com>
Wed, 23 Jul 2014 03:05:31 -0300
branchiOS-improvements
changeset 9501 574db299498f
parent 9498 d02c27e3f698
child 9510 e19faa3b5d88
permissions -rw-r--r--
More cleanup of the iOS Objective-C code.
slouken@2765
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@8149
     3
  Copyright (C) 1997-2014 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
 */
slime73@9501
    32
@interface SDL_uikitopenglview : SDL_uikitview
slouken@2765
    33
slouken@2765
    34
- (id)initWithFrame:(CGRect)frame
slime73@9498
    35
              scale:(CGFloat)scale
slime73@9498
    36
      retainBacking:(BOOL)retained
slime73@9498
    37
              rBits:(int)rBits
slime73@9498
    38
              gBits:(int)gBits
slime73@9498
    39
              bBits:(int)bBits
slime73@9498
    40
              aBits:(int)aBits
slime73@9498
    41
          depthBits:(int)depthBits
slime73@9498
    42
        stencilBits:(int)stencilBits
slime73@9498
    43
               sRGB:(BOOL)sRGB
slime73@9498
    44
       majorVersion:(int)majorVersion
slime73@9498
    45
         shareGroup:(EAGLSharegroup*)shareGroup;
slouken@2765
    46
slime73@9501
    47
@property (nonatomic, retain, readonly) EAGLContext *context;
slime73@9501
    48
slime73@9501
    49
/* The width and height of the drawable in pixels (as opposed to points.) */
slime73@9501
    50
@property (nonatomic, readonly) int backingWidth;
slime73@9501
    51
@property (nonatomic, readonly) int backingHeight;
slime73@9501
    52
slime73@9501
    53
- (void)swapBuffers;
slime73@9501
    54
- (void)setCurrentContext;
slime73@9501
    55
icculus@5527
    56
- (void)updateFrame;
icculus@5527
    57
slouken@6342
    58
- (void)setAnimationCallback:(int)interval
slime73@9501
    59
                    callback:(void (*)(void*))callback
slime73@9501
    60
               callbackParam:(void*)callbackParam;
slouken@6342
    61
slouken@6342
    62
- (void)startAnimation;
slouken@6342
    63
- (void)stopAnimation;
slouken@6342
    64
slouken@8891
    65
- (void)doLoop:(CADisplayLink*)sender;
slouken@6342
    66
slouken@2765
    67
@end
slouken@5133
    68
slouken@5133
    69
/* vi: set ts=4 sw=4 expandtab: */