Shader

Represents an OpenGL shader. The shader source and type must be set with {@link #setSource(ShaderSource)}.

Members

Functions

compile
void compile()

Compiles the shader.

destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
getAttributeLayouts
uint[string] getAttributeLayouts()

Returns the attribute layouts parsed from the tokens in the shader source.

getID
uint getID()

Gets the ID for this shader as assigned by OpenGL.

getTextureLayouts
string[uint] getTextureLayouts()

Returns the texture layouts parsed from the tokens in the shader source.

getType
ShaderType getType()

Gets the shader type.

setAttributeLayout
void setAttributeLayout(string attribute, uint layout)

Sets an attribute layout.

setSource
void setSource(ShaderSource source)

Sets the shader source.

setTextureLayout
void setTextureLayout(uint unit, string sampler)

Sets a texture layout.

Variables

id
uint id;
Undocumented in source.

Inherited Members

From Creatable

create
void create()

Creates the resources. It can now be used.

destroy
void destroy()

Releases the resource. It can not longer be used.

isCreated
bool isCreated()

Returns true if the resource was created and is ready for use, false if otherwise.

checkCreated
void checkCreated()

Throws an exception if the resource hasn't been created yet.

checkNotCreated
void checkNotCreated()

Throws an exception if the resource has been created already.

From GLVersioned

getGLVersion
GLVersion getGLVersion()

Returns the lowest OpenGL version required by this object's implementation.

Meta