SPContext Class Reference
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
-
– initWithSharegroup:
Initializes and returns a rendering context with the specified sharegroup.
Methods
-
– renderToBackBuffer
Sets the back rendering buffer as the render target.
-
– presentBufferForDisplay
Displays a renderbuffer’s contents on screen.
-
– makeCurrentContext
Makes the receiver the current current rendering context.
-
+ setCurrentContext:
Makes the specified context the current rendering context for the calling thread.
-
+ currentContext
Returns the current rendering context for the calling thread.
-
+ deviceSupportsOpenGLExtension:
Returns YES if the current devices supports the extension.
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
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
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