Shader

A baseclass of shader.

Constructors

this
this()

Destructor

~this
~this()

Members

Functions

applyMatrix
void applyMatrix()

Applies the matrix.

dispose
void dispose()

Deletes all programs and shaders.

drawElementsFan
void drawElementsFan(ElementArrayBuffer buf, size_t polyCnt)

Calls glDrawElements with GL_TRIANGLE_FAN.

drawElementsStrip
void drawElementsStrip(ElementArrayBuffer buf, size_t polyCnt)

Calls glDrawElements with GL_TRIANGLE_STRIP.

drawFan
void drawFan(size_t polyCnt)

Calls glDrawArrays with GL_TRIANGLE_FAN.

drawStrip
void drawStrip(size_t polyCnt)

Calls glDrawArrays with GL_TRIANGLE_STRIP.

getAttribLoc
GLint getAttribLoc(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
getUniformLoc
GLint getUniformLoc(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
initFragShader
void initFragShader()
Undocumented in source.
initVertexShader
void initVertexShader()
Undocumented in source.
uploadMatrix
void uploadMatrix(mat4 )

Uploads matrix.

uploadPositionBuffer
void uploadPositionBuffer(ArrayBuffer )

Uploads position buffer.

uploadTexture
void uploadTexture(Texture )

Uploads texture.

uploadUvBuffer
void uploadUvBuffer(ArrayBuffer )

Uploads uv buffer.

use
void use()

Sets the shader binded.

Manifest constants

NullId
enum NullId;

Invalid shader program id.

Properties

disposed
disposed [@property getter]

Checks if the shader is disposed.

fragSource
string fragSource [@property getter]

GLSL source code of fragment shader.

matrix
ref matrix [@property getter]

Data of translation, rotation and transformation.

textureSupport
bool textureSupport [@property getter]

Checks the shader supports texture.

vertexSource
string vertexSource [@property getter]

GLSL source code of vertex shader.

Static functions

compileShader
GLuint compileShader(GLenum shaderType, string src)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_fragment
GLuint _fragment;
Undocumented in source.
_matrix
ShaderMatrix _matrix;
Undocumented in source.
_program
GLuint _program;
Undocumented in source.
_vao
GLuint _vao;
Undocumented in source.
_vertex
GLuint _vertex;
Undocumented in source.

Meta