Inherits from UIView
Declared in CCGLView.h

Overview

CCGLView Class. 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.

Tasks

Other Methods

Other Methods

Properties

context

OpenGL context

@property (nonatomic, readonly) EAGLContext *context

Declared In

CCGLView.h

depthFormat

depth format of the render buffer: 0, 16 or 24 bits

@property (nonatomic, readonly) GLuint depthFormat

Declared In

CCGLView.h

eventDelegate

Event delegate

@property (nonatomic, readwrite, assign) id<CCEventDelegate> eventDelegate

Declared In

CCGLView.h

multiSampling

pixelFormat

pixel format: it could be RGBA8 (32-bit) or RGB565 (16-bit)

@property (nonatomic, readonly) NSString *pixelFormat

Declared In

CCGLView.h

surfaceSize

returns surface size in pixels

@property (nonatomic, readonly) CGSize surfaceSize

Declared In

CCGLView.h

touchDelegate

touch delegate

@property (nonatomic, readwrite, assign) id<CCTouchDelegate> touchDelegate

Declared In

CCGLView.h

Class Methods

load_

viewWithFrame:

creates an initializes an CCGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer.

+ (id)viewWithFrame:(CGRect)frame

Declared In

CCGLView.h

viewWithFrame:pixelFormat:

creates an initializes an CCGLView with a frame, a color buffer format, and 0-bit depth buffer.

+ (id)viewWithFrame:(CGRect)frame pixelFormat:(NSString *)format

Declared In

CCGLView.h

viewWithFrame:pixelFormat:depthFormat:

creates an initializes an CCGLView with a frame, a color buffer format, and a depth buffer.

+ (id)viewWithFrame:(CGRect)frame pixelFormat:(NSString *)format depthFormat:(GLuint)depth

Declared In

CCGLView.h

viewWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:

creates an initializes an CCGLView with a frame, a color buffer format, a depth buffer format, a sharegroup, and multisamping

+ (id)viewWithFrame:(CGRect)frame pixelFormat:(NSString *)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup *)sharegroup multiSampling:(BOOL)multisampling numberOfSamples:(unsigned int)samples

Declared In

CCGLView.h

Instance Methods

convertPointFromViewToSurface:

convertRectFromViewToSurface:

initWithFrame:

Initializes an CCGLView with a frame and 0-bit depth buffer, and a RGB565 color buffer

- (id)initWithFrame:(CGRect)frame

Declared In

CCGLView.h

initWithFrame:pixelFormat:

Initializes an CCGLView with a frame, a color buffer format, and 0-bit depth buffer

- (id)initWithFrame:(CGRect)frame pixelFormat:(NSString *)format

Declared In

CCGLView.h

initWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:

Initializes an CCGLView with a frame, a color buffer format, a depth buffer format, a sharegroup and multisampling support

- (id)initWithFrame:(CGRect)frame pixelFormat:(NSString *)format depthFormat:(GLuint)depth preserveBackbuffer:(BOOL)retained sharegroup:(EAGLSharegroup *)sharegroup multiSampling:(BOOL)sampling numberOfSamples:(unsigned int)nSamples

Declared In

CCGLView.h

initWithFrame:shareContext:

initializes the CCGLView with a frame rect and an OpenGL context

- (id)initWithFrame:(NSRect)frameRect shareContext:(NSOpenGLContext *)context

Declared In

CCGLView.h

lockOpenGLContext

uses and locks the OpenGL context

- (void)lockOpenGLContext

Declared In

CCGLView.h

swapBuffers

CCGLView uses double-buffer. This method swaps the buffers

- (void)swapBuffers

Declared In

CCGLView.h

unlockOpenGLContext

unlocks the openGL context

- (void)unlockOpenGLContext

Declared In

CCGLView.h