1 #ifndef RENDER_MANAGER_HPP 2 #define RENDER_MANAGER_HPP 5 #include <SDL2/SDL_image.h> 6 #include <SDL2/SDL_ttf.h> 8 #include "ImageRenderComponent.hpp" 9 #include "TextRenderComponent.hpp" 50 static std::shared_ptr<CameraComponent>
GetCamera();
54 std::shared_ptr<CameraComponent> camera);
int screenWidth_
The width of the screen.
Definition: RenderManager.hpp:82
static int getWidth()
Gets the screen width.
Definition: RenderManager.cpp:92
static RenderManager & instance()
The singleton instance of the RenderManager.
Definition: RenderManager.cpp:12
static SDL_Renderer * GetRenderer()
Gets the SDL_Renderer.
Definition: RenderManager.cpp:96
void Render()
Render the game.
Definition: RenderManager.cpp:106
RenderManager & operator=(const RenderManager &)=delete
Stop the compiler from generating methods to copy the object.
~RenderManager()
Destructs a RenderManager.
Definition: RenderManager.cpp:10
SDL_Window * gWindow
The window we'll be rendering to.
Definition: RenderManager.hpp:88
static int getHeight()
Gets the screen height.
Definition: RenderManager.cpp:94
SDL_Renderer * gRenderer
The SDL_Renderer for this instance.
Definition: RenderManager.hpp:91
RenderManager()
Constructs a RenderManager.
Definition: RenderManager.cpp:9
std::shared_ptr< CameraComponent > camera_
The Camera to use to render game objects.
Definition: RenderManager.hpp:94
This class manages the rendering of images in our game as a singleton.
Definition: RenderManager.hpp:15
bool init(int screenWidth, int screenHeight)
Initializes the render manager, SDL, and TTF, and creates the SDL_Window and SDL_Renderer.
Definition: RenderManager.cpp:18
int screenHeight_
The height of the screen.
Definition: RenderManager.hpp:85
static void SetActiveCamera(std::shared_ptr< CameraComponent > camera)
Sets the current active camera.
Definition: RenderManager.cpp:101
static std::shared_ptr< CameraComponent > GetCamera()
Gets the current active camera.
Definition: RenderManager.cpp:98
void shutdown()
Shuts down the render manager, SDL, and TTF.
Definition: RenderManager.cpp:79