Building Game Engines
Public Member Functions | List of all members
Sprite Class Reference

#include <Sprite.hpp>

Inheritance diagram for Sprite:
Inheritance graph
Collaboration diagram for Sprite:
Collaboration graph

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)
 
- Public Member Functions inherited from Component
 Component ()
 
virtual ~Component ()=0
 

Detailed Description

Stores the sprite for a game object, acts as a component

Constructor & Destructor Documentation

◆ Sprite()

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::~Sprite ( )

Destructor

Member Function Documentation

◆ Render()

void Sprite::Render ( SDL_Renderer *  ren)
virtual

Renders the sprite

Implements Component.

Here is the call graph for this function:

◆ Update()

void Sprite::Update ( )
virtual

Update the sprite to the next frame.

Implements Component.

Here is the call graph for this function:

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