SPProgram Class Reference
Inherits from | NSObject |
Declared in | SPProgram.h |
Overview
An SPProgram wraps a GLSL program (containing the source code for both vertex and fragment shader) into an object.
Use the uniformByName:
and attributeByName:
properties to query the index of the respective
variables.
Tasks
Initialization
-
– initWithVertexShader:fragmentShader:
Initializes a GLSL program by compiling vertex and fragment shaders from source. In debug mode, compilation erros are logged into the console. Designated Initializer.
Methods
-
– uniformByName:
Returns the index of a uniform with a certain name.
-
– attributeByName:
Returns the index of an attribute with a certain name.
Properties
-
name
The handle of the program object needed.
property -
vertexShader
The source code of the vertex shader.
property -
fragmentShader
The source code of the fragment shader.
property
Properties
fragmentShader
The source code of the fragment shader.
@property (nonatomic, readonly) NSString *fragmentShader
Discussion
The source code of the fragment shader.
Declared In
SPProgram.h
Instance Methods
attributeByName:
Returns the index of an attribute with a certain name.
- (int)attributeByName:(NSString *)name
Discussion
Returns the index of an attribute with a certain name.
Declared In
SPProgram.h
initWithVertexShader:fragmentShader:
Initializes a GLSL program by compiling vertex and fragment shaders from source. In debug mode, compilation erros are logged into the console. Designated Initializer.
- (instancetype)initWithVertexShader:(NSString *)vertexShader fragmentShader:(NSString *)fragmentShader
Discussion
Initializes a GLSL program by compiling vertex and fragment shaders from source. In debug mode, compilation erros are logged into the console. Designated Initializer.
Declared In
SPProgram.h