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
-
– renderToBackBufferSets the back rendering buffer as the render target.
-
– presentBufferForDisplayDisplays a renderbuffer’s contents on screen.
-
– makeCurrentContextMakes the receiver the current current rendering context.
-
+ setCurrentContext:Makes the specified context the current rendering context for the calling thread.
-
+ currentContextReturns the current rendering context for the calling thread.
-
+ deviceSupportsOpenGLExtension:Returns YES if the current devices supports the extension.
Properties
-
sharegroupThe receiver’s sharegroup object.
property -
nativeContextThe receiver’s native context object.
property -
viewportThe current OpenGL viewport rectangle in pixels.
property -
scissorBoxThe current OpenGL scissor rectangle in pixels.
property -
renderTargetThe 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 nativeContextDiscussion
The receiver’s native context object.
Declared In
SPContext.hrenderTarget
The specified texture as the rendering target or nil if rendering to the default framebuffer.
@property (nonatomic, retain) SPTexture *renderTargetDiscussion
The specified texture as the rendering target or nil if rendering to the default framebuffer.
Declared In
SPContext.hscissorBox
The current OpenGL scissor rectangle in pixels.
@property (nonatomic, assign) SPRectangle *scissorBoxDiscussion
The current OpenGL scissor rectangle in pixels.
Declared In
SPContext.hClass Methods
currentContext
Returns the current rendering context for the calling thread.
+ (SPContext *)currentContextDiscussion
Returns the current rendering context for the calling thread.
Declared In
SPContext.hInstance Methods
initWithSharegroup:
Initializes and returns a rendering context with the specified sharegroup.
- (instancetype)initWithSharegroup:(id)sharegroupDiscussion
Initializes and returns a rendering context with the specified sharegroup.
Declared In
SPContext.hmakeCurrentContext
Makes the receiver the current current rendering context.
- (BOOL)makeCurrentContextDiscussion
Makes the receiver the current current rendering context.
Declared In
SPContext.h