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
-
nameThe handle of the program object needed.
property -
vertexShaderThe source code of the vertex shader.
property -
fragmentShaderThe source code of the fragment shader.
property
Properties
fragmentShader
The source code of the fragment shader.
@property (nonatomic, readonly) NSString *fragmentShaderDiscussion
The source code of the fragment shader.
Declared In
SPProgram.hInstance Methods
attributeByName:
Returns the index of an attribute with a certain name.
- (int)attributeByName:(NSString *)nameDiscussion
Returns the index of an attribute with a certain name.
Declared In
SPProgram.hinitWithVertexShader: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 *)fragmentShaderDiscussion
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