Table of Contents

Class Shader

Namespace
Bonsai.Shaders
Assembly
Bonsai.Shaders.dll

Provides common functionality for executing and updating the state of compiled shader programs.

public abstract class Shader : IDisposable
Inheritance
Shader
Implements
Derived
Inherited Members

Properties

Name

Gets the name of the shader.

Program

Gets the handle to the shader program object.

Window

Gets the window containing the graphics context on which to render the shader program.

Methods

CreateShader()

When overridden in a derived class, compiles the shader program and returns the program object handle.

CreateShaderState(IEnumerable<StateConfiguration>, IEnumerable<UniformConfiguration>, IEnumerable<BufferBindingConfiguration>, FramebufferConfiguration)

Initializes the shader state object used to specify the render state, uniform values, buffer bindings and framebuffer configuration to use when running the shader program.

Dispatch()

Loads the shader program into the current render state and dispatches all pending render operations.

Dispose()

Releases all resources used by the Shader class.

Dispose(bool)

Releases all resources used by the Shader class.

OnDispatch()

Returns any actions that should be executed before running the shader program.

Update(Action)

Schedules an action for execution when running the shader program. Any render operations called as part of the action will execute in the context of this shader program.