GlSpriteBatch

OpenGL implementation of a sprite batcher.

Members

Functions

Begin
void Begin(SpriteSorting sort_mode, Blending blend_state, Sampling sample_state, ProjectionState pstate, Shader s, Camera camera)

Begin begins the spritebatch, setting up sorting modes, blend states and sampling. Begin also attaches a custom shader (if chosen) and sets the camera/view matrix.

Begin
void Begin(SpriteSorting sort_mode, Blending blend_state, Sampling sample_state, Shader s, Camera camera)

Begin begins the spritebatch, setting up sorting modes, blend states and sampling. Begin also attaches a custom shader (if chosen) and sets the camera/view matrix.

Begin
void Begin(SpriteSorting sort_mode, Blending blend_state, Sampling sample_state, Shader s, Matrix4x4 matrix)

Begin begins the spritebatch, setting up sorting modes, blend states and sampling. Begin also attaches a custom shader (if chosen) and sets the camera/view matrix.

Draw
void Draw(Texture2D texture, Rectangle pos, Rectangle cutout, float rotation, Vector2 Origin, Color color, SpriteFlip flip = SpriteFlip.None, float zlayer = 0)

Draw draws a texture.

Draw
void Draw(Texture2D texture, Rectangle pos, Rectangle cutout, Color color, SpriteFlip flip = SpriteFlip.None, float zlayer = 0f)

Draw draws a texture.

DrawAABB
void DrawAABB(Texture2D texture, Rectangle pos_top, Rectangle pos_bottom, Rectangle cutout, Vector2 Origin, Color color, SpriteFlip flip = SpriteFlip.None, float zlayer = 0)

Draw draws a texture. Rectangle pos will act like an AABB rectangle instead.

End
void End()

End ends the sprite batching, allowing you to start a new batch.

Flush
void Flush()

Flush flushes the spritebatch, drawing whatever that has been batched to the screen. End() will automatically call this.

SwapChain
void SwapChain()

Swaps the draw chain (double buffering)

Meta