6 #ifndef GRAPHICSCOMPONENT_HPP
7 #define GRAPHICSCOMPONENT_HPP
16 #include <SDL2_image/SDL_image.h>
47 void LoadImage(std::string filepath, SDL_Renderer* ren);
50 SDL_Renderer* renderer;
52 SDL_Surface* m_spritesheet;
53 SDL_Texture* m_texture;
54 std::map<int, std::vector<int>> map;
59 int widthImg, heightImg, row, col, tempWidth, tempHeight;
60 int tileHeight, tileWidth;
The interface class for different components to inherit.
Definition: Component.hpp:16
Represents an interactable entity in the game that includes Main Character, NPC, Tiles ,...
Definition: GameEntity.hpp:22
GraphicsComponent class used to flip through frames for a GameEntity.
Definition: GraphicsComponent.hpp:21
void ShutDown()
Constructor for GraphicsComponent.
Definition: GraphicsComponent.cpp:25
void LoadImage(std::string filepath, SDL_Renderer *ren)
Loads image to use for graphics.
Definition: GraphicsComponent.cpp:68
void StartUp()
Initializes attributes for GraphicsComponent.
Definition: GraphicsComponent.cpp:21
void Update(GameEntity &entity)
Selects graphic to render depending on frame.
Definition: GraphicsComponent.cpp:40
GraphicsComponent(SDL_Renderer *ren)
Constructor for GraphicsComponent.
Definition: GraphicsComponent.cpp:8
~GraphicsComponent()
Destructor for GraphicsComponent.
Definition: GraphicsComponent.cpp:17
void Render(GameEntity &entity)
Renders graphic.
Definition: GraphicsComponent.cpp:32
The resource manager is responsible for handling and managing resources regarding the game.
Definition: ResourceManager.hpp:23
static ResourceManager & getInstance()
Method used to get instance of ResourceManager class.
Definition: ResourceManager.cpp:8