C# Class Sparrow.Core.BaseEffect

BaseEffect simplifies the rendering of colored and/or textured polygons. Configure a base effect by updating its state properties. When you call 'prepareToDraw', it will choose the optimal shader program for the given settings and will activate that program. Alpha and matrix uniforms will be passed to the program automatically, and the texture will be bound.
Mostrar archivo Open project: fmotagarcia/sparrow-sharp Class Usage Examples

Public Methods

Method Description
PrepareToDraw ( Matrix mvpMatrix, bool premultipliedAlpha, float alpha, bool useTinting, Texture texture = null ) : void

Activates the optimal shader program for the current settings; alpha and matrix uniforms are passed to the program right away, and the texture (if available) is bound. Parameters: mvpMatrix: The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. premultipliedAlpha: Indicates if the color values of texture and vertices use premultiplied alpha. alpha: The alpha value with which every vertex color will be multiplied. useTinting: Set to true if you dont use textures or want to use alpha. texture: The texture that's projected onto the quad, or 'null' if there is none.

Private Methods

Method Description
FragmentShaderString ( bool hasTexture, bool useTinting ) : string
VertexShaderString ( bool hasTexture, bool useTinting ) : string

Method Details

PrepareToDraw() public method

Activates the optimal shader program for the current settings; alpha and matrix uniforms are passed to the program right away, and the texture (if available) is bound. Parameters: mvpMatrix: The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. premultipliedAlpha: Indicates if the color values of texture and vertices use premultiplied alpha. alpha: The alpha value with which every vertex color will be multiplied. useTinting: Set to true if you dont use textures or want to use alpha. texture: The texture that's projected onto the quad, or 'null' if there is none.
public PrepareToDraw ( Matrix mvpMatrix, bool premultipliedAlpha, float alpha, bool useTinting, Texture texture = null ) : void
mvpMatrix Matrix
premultipliedAlpha bool
alpha float
useTinting bool
texture Sparrow.Textures.Texture
return void