Inherits from NSObject
Declared in SPContext.h

Overview

An SPContext object manages the state information, commands, and resources needed to draw using OpenGL. All OpenGL commands are executed in relation to a context. SPContext wraps the native context and provides additional functionality.

Tasks

Initialization

Methods

Properties

  •   sharegroup

    The receiver’s sharegroup object.

    property
  •   nativeContext

    The receiver’s native context object.

    property
  •   viewport

    The current OpenGL viewport rectangle in pixels.

    property
  •   scissorBox

    The current OpenGL scissor rectangle in pixels.

    property
  •   renderTarget

    The specified texture as the rendering target or nil if rendering to the default framebuffer.

    property

Properties

nativeContext

The receiver’s native context object.

@property (atomic, readonly) id nativeContext

Discussion

The receiver’s native context object.

Declared In

SPContext.h

renderTarget

The specified texture as the rendering target or nil if rendering to the default framebuffer.

@property (nonatomic, retain) SPTexture *renderTarget

Discussion

The specified texture as the rendering target or nil if rendering to the default framebuffer.

Declared In

SPContext.h

scissorBox

The current OpenGL scissor rectangle in pixels.

@property (nonatomic, assign) SPRectangle *scissorBox

Discussion

The current OpenGL scissor rectangle in pixels.

Declared In

SPContext.h

sharegroup

The receiver’s sharegroup object.

@property (atomic, readonly) id sharegroup

Discussion

The receiver’s sharegroup object.

Declared In

SPContext.h

viewport

The current OpenGL viewport rectangle in pixels.

@property (nonatomic, assign) SPRectangle *viewport

Discussion

The current OpenGL viewport rectangle in pixels.

Declared In

SPContext.h

Class Methods

currentContext

Returns the current rendering context for the calling thread.

+ (SPContext *)currentContext

Discussion

Returns the current rendering context for the calling thread.

Declared In

SPContext.h

deviceSupportsOpenGLExtension:

Returns YES if the current devices supports the extension.

+ (BOOL)deviceSupportsOpenGLExtension:(NSString *)extensionName

Discussion

Returns YES if the current devices supports the extension.

Declared In

SPContext.h

setCurrentContext:

Makes the specified context the current rendering context for the calling thread.

+ (BOOL)setCurrentContext:(SPContext *)context

Discussion

Makes the specified context the current rendering context for the calling thread.

Declared In

SPContext.h

Instance Methods

initWithSharegroup:

Initializes and returns a rendering context with the specified sharegroup.

- (instancetype)initWithSharegroup:(id)sharegroup

Discussion

Initializes and returns a rendering context with the specified sharegroup.

Declared In

SPContext.h

makeCurrentContext

Makes the receiver the current current rendering context.

- (BOOL)makeCurrentContext

Discussion

Makes the receiver the current current rendering context.

Declared In

SPContext.h

presentBufferForDisplay

Displays a renderbuffer’s contents on screen.

- (void)presentBufferForDisplay

Discussion

Displays a renderbuffer’s contents on screen.

Declared In

SPContext.h

renderToBackBuffer

Sets the back rendering buffer as the render target.

- (void)renderToBackBuffer

Discussion

Sets the back rendering buffer as the render target.

Declared In

SPContext.h