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

Properties

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

name

The handle of the program object needed.

@property (nonatomic, readonly) uint name

Discussion

The handle of the program object needed.

Declared In

SPProgram.h

vertexShader

The source code of the vertex shader.

@property (nonatomic, readonly) NSString *vertexShader

Discussion

The source code of the vertex 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

uniformByName:

Returns the index of a uniform with a certain name.

- (int)uniformByName:(NSString *)name

Discussion

Returns the index of a uniform with a certain name.

Declared In

SPProgram.h