Shader

*

Constructors

this
this(string id)

* Create a new shader program with empty map and id.

Members

Functions

addCustomRenderMethod
typeof(this) addCustomRenderMethod(void delegate(ShaderProgram, typeof(this) self) dg)

* Add custom render delegate so it can be called every render tick. * If this is not null, then globalRender and perEntityRender are useless. * Returns reference to this so it can be used in a stream.

addFragmentCode
typeof(this) addFragmentCode(string code)

* Add fragment code. * Returns reference to this so it can be used in a stream.

addGlobalRenderMethod
typeof(this) addGlobalRenderMethod(void delegate(ShaderProgram) dg)

* Add global render delegate so it can be called every render tick once for all map entities. * Returns reference to this so it can be used in a stream.

addPerEntityRenderMethod
typeof(this) addPerEntityRenderMethod(void delegate(ShaderProgram) dg)

* Add per entity render delegate so it can be called every render tick for every map entity. * Returns reference to this so it can be used in a stream.

addVertexCode
typeof(this) addVertexCode(string code)

* Add vertex code. * Returns reference to this so it can be used in a stream.

build
typeof(this) build()

* Build shader data, compile and link. * Returns reference to this so it can be used in a stream.

getEntityById
Entity getEntityById(string id)

* Returns the entity in the map that has the given id.

getMap
Entity[string] getMap()

* Returns all entities in the map.

getProgram
ShaderProgram getProgram()

* Returns the shader program from the map.

hasFragmentProgram
bool hasFragmentProgram()

* Returns true if fragement code exists.

hasVertexProgram
bool hasVertexProgram()

* Returns true if vertex code exists.

isViewMatrixEnabled
bool isViewMatrixEnabled()

* Returns true if view matrix is enabled on this shader.

registerEntity
typeof(this) registerEntity(Entity entity)

* Register a entity to the renderer. * Returns reference to this so it can be used in a stream.

removeEntity
typeof(this) removeEntity(Entity entity)

* Remove the given entity from the map. * Returns reference to this so it can be used in a stream.

removeEntityById
typeof(this) removeEntityById(string id)

* Remove the entity that has the given id from the map. * Returns reference to this so it can be used in a stream.

render
void render(Scene scene)

* Render all map entities to the screen.

setViewMatrixEnabled
typeof(this) setViewMatrixEnabled(bool enabled)

* Set if view matrix is enabled on this shader. * Returns reference to this so it can be used in a stream.

Variables

id
string id;

Inherited Members

From IShaderFactory

exists
bool exists(string id)

*

getOrCreate
Shader getOrCreate(string id, void delegate(Shader) createDg)

*

From IRenderable

render
void render(Scene scene)

* Called every frame to render the scene entity.

Meta