Building Game Engines
|
#include <Sprite.hpp>
Public Member Functions | |
Sprite (SDL_Texture *texture, TransformComponent *transform, int img_w, int img_h) | |
~Sprite () | |
virtual void | Update () |
virtual void | Render (SDL_Renderer *ren) |
![]() | |
Component () | |
virtual | ~Component ()=0 |
Stores the sprite for a game object, acts as a component
Sprite::Sprite | ( | SDL_Texture * | texture, |
TransformComponent * | transform, | ||
int | img_w, | ||
int | img_h | ||
) |
Constructor Texture is the texture to be rendered. Transform is a reference to the transform of the GameObject this Component belongs to. img_w and img_h are the width and height of the sprite.
Sprite::~Sprite | ( | ) |
Destructor
|
virtual |
|
virtual |
Update the sprite to the next frame.
Implements Component.