Skip to content
Henryk Wollik edited this page Jul 28, 2014 · 1 revision

Class: Program

Program

new Program(vertexShader, fragmentShader)

GLSL shader program wrapper.

Parameters:
Name Type Argument Description
vertexShader String <optional>

The vertex shader or mixed vertex/fragment shader string

fragmentShader String <optional>

The fragment shader string

Source:

Members

<static> ATTRIB_TEXCOORD :string

The default shader texcoord attribute. (reassignable)

Type:
  • string
Source:

<static> ATTRIB_VERTEX_COLOR :string

The default shader vertex color attribute. (reassignable)

Type:
  • string
Source:

<static> ATTRIB_VERTEX_NORMAL :string

The default shader vertex normal attribute. (reassignable)

Type:
  • string
Source:

<static> ATTRIB_VERTEX_POSITION :string

The default shader vertex position attribute. (reassignable)

Type:
  • string
Source:

<static> UNIFORM_COLOR :string

The default shader color uniform. (reassignable)

Type:
  • string
Source:

<static> UNIFORM_MODELVIEW_MATRIX :string

The default shader modelview matrix uniform. (reassignable)

Type:
  • string
Source:

<static> UNIFORM_POINT_SIZE :string

The default shader point size uniform. (reassignable)

Type:
  • string
Source:

<static> UNIFORM_PROJECTION_MATRIX :string

The default shader projection matrix uniform. (reassignable)

Type:
  • string
Source:

<static> UNIFORM_TEXTURE :string

The default shader sampler2d uniform. (reassignable)

Type:
  • string
Source:

Methods

<static> getCurrentProgram() → {null|Progam}

Return the currently bound program.

Source:
Returns:
Type
null | Progam

bind()

Activate the program.

Source:

delete()

Delete the program.

Source:

getNumAttributes() → {Number}

Get the number of active attributes.

Source:
Returns:
Type
Number

getNumUniforms() → {Number}

Get the number of active uniforms

Source:
Returns:
Type
Number

load(vertexShader, fragmentShader)

Reload the program

Parameters:
Name Type Argument Description
vertexShader String

The vertex shader or mixed vertex/fragment shader string

fragmentShader String <optional>

The fragment shader string

Source:

unbind()

Deactivate the program.

Source:

Generated with wicked.
Clone this wiki locally