Table of Contents

Class Shader

Namespace
Axolotl2D.Shaders
Assembly
Axolotl2D.dll

Represents a shader in the game. Do note that this class is not meant to be used directly. This wil change in the future as I figure out how to implement userland shaders.

public class Shader
Inheritance
Shader
Inherited Members

Constructors

Shader(string, ShaderType, Game)

Initialize a new Shader object.

public Shader(string glslSourceCode, ShaderType shaderType, Game game)

Parameters

glslSourceCode string

GLSL code for this shader

shaderType ShaderType

Type of this shader

game Game

Game to initialize shader on

Methods

AttachToProgram()

Attach the shader to the program.

public void AttachToProgram()

Exceptions

ShaderNotCompiledException

Shader was not compiled yet

Compile()

Compile the shader.

public void Compile()

Exceptions

ShaderCompileException

Shader failed to compile

CreateBasicFragment(Game)

Create a basic fragment shader.

public static Shader CreateBasicFragment(Game game)

Parameters

game Game

Game to create the shader on.

Returns

Shader

A basic fragment shader

CreateBasicVertex(Game)

Create a basic vertex shader.

public static Shader CreateBasicVertex(Game game)

Parameters

game Game

Game to create the shader on.

Returns

Shader

A basic vertex shader

DetachFromProgram()

Detach the shader from the program.

public void DetachFromProgram()

Exceptions

ShaderNotCompiledException

Shader was not compiled yet

GetPointer()

Get the pointer to the shader.

public uint GetPointer()

Returns

uint

Pointer to the shader

Exceptions

ShaderNotCompiledException

Shader was not compiled yet