Lums
Public Member Functions | Protected Attributes | List of all members
lm::StaticSpriteBatch Class Reference

A class representing a static batch of bidimensional graphical elements. More...

#include <StaticSpriteBatch.hpp>

Inheritance diagram for lm::StaticSpriteBatch:
lm::SpriteBatch

Public Member Functions

 StaticSpriteBatch ()
 
LUMS_EXPORTED void draw (const Texture &texture, int atlas=0, Vector2f pos={0.f, 0.f}, Vector2f scale={1.f, 1.f}, Vector4f color={1.f, 1.f, 1.f, 1.f}, Vector2b flip={false, false})
 
LUMS_EXPORTED void draw (const Sprite &sprite)
 
LUMS_EXPORTED void draw (const Font &font, const char *text, Vector2f pos={0.f, 0.f}, Vector4f color={1.f, 1.f, 1.f, 1.f})
 
LUMS_EXPORTED void setTexture (const Texture *texture)
 
LUMS_EXPORTED void send ()
 
LUMS_EXPORTED void flush ()
 
LUMS_EXPORTED void render ()
 
 ~StaticSpriteBatch ()
 

Protected Attributes

VertexBufferP2T2C4 vbo
 
const Texturetexture
 

Detailed Description

A class representing a static batch of bidimensional graphical elements.

Constructor & Destructor Documentation

lm::StaticSpriteBatch::StaticSpriteBatch ( )

Create a static sprite batch

lm::StaticSpriteBatch::~StaticSpriteBatch ( )

Sprite batch dtor

Member Function Documentation

LUMS_EXPORTED void lm::StaticSpriteBatch::draw ( const Texture texture,
int  atlas = 0,
Vector2f  pos = {0.f, 0.f},
Vector2f  scale = {1.f, 1.f},
Vector4f  color = {1.f, 1.f, 1.f, 1.f},
Vector2b  flip = {false, false} 
)

Draw a texture into the batch

Parameters
textureThe texture to be drawn
atlasThe atlas
posThe screen position
scaleThe scale
colorThe color
flipThe flip values
LUMS_EXPORTED void lm::StaticSpriteBatch::draw ( const Sprite sprite)

Draw a sprite into the batch

Parameters
spriteThe sprite
LUMS_EXPORTED void lm::StaticSpriteBatch::draw ( const Font font,
const char *  text,
Vector2f  pos = {0.f, 0.f},
Vector4f  color = {1.f, 1.f, 1.f, 1.f} 
)

Draw text into the batch

Parameters
fontThe font
textThe text to be rendererd
posThe text position
colorThe text color
LUMS_EXPORTED void lm::StaticSpriteBatch::flush ( )

Flush the batch

LUMS_EXPORTED void lm::StaticSpriteBatch::render ( )

Render the batch

LUMS_EXPORTED void lm::StaticSpriteBatch::send ( )

Send the batch to the GPU

LUMS_EXPORTED void lm::StaticSpriteBatch::setTexture ( const Texture texture)

Set the batch texture

Parameters
textureThe texture

Member Data Documentation

const Texture* lm::StaticSpriteBatch::texture
protected

A texture

VertexBufferP2T2C4 lm::StaticSpriteBatch::vbo
protected

A vertex buffer object


The documentation for this class was generated from the following file: