Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
Loading...
Searching...
No Matches
graphics.hpp
Go to the documentation of this file.
1#pragma once
2#include <SDL3/SDL.h>
3#include <SDL3_ttf/SDL_ttf.h>
4#include <string>
5#include "../../core/definitions.hpp"
6#include "../../core/node/components.hpp"
7#include "../../core/ui/definitions.hpp"
8#include "../physics/definitions.hpp"
9#include "definitions.hpp"
10
11class Label; //forward declare
12
26{
27public:
28 Graphics();
29 SDL_Texture *loadTexture(const std::string &path, Window *window, TextureScaling scaling = TextureScaling::NEAREST) const;
30
31 void exit();
32
33 // renderComponent is a general function that renders different components based on different function overloads.
34 void renderComponent(const Sprite &sprite, Window *window) const;
35 void renderComponent(const ShapeSprite &sprite, Window *window) const;
36 void renderComponent(const Label &label, Window *window) const;
37 void renderComponent(const AnimatedSprite &sprite, Window *window) const;
38 void renderComponent(const Tilemap &tilemap, Window *window) const;
39
40 TTF_TextEngine *getTextEngine() const;
41private:
42 TTF_TextEngine *textEngine;
43};
Definition components.hpp:195
Definition graphics.hpp:26
void renderComponent(const Sprite &sprite, Window *window) const
Definition graphics.cpp:61
TTF_TextEngine * getTextEngine() const
Definition graphics.cpp:346
void exit()
Definition graphics.cpp:351
SDL_Texture * loadTexture(const std::string &path, Window *window, TextureScaling scaling=TextureScaling::NEAREST) const
Definition graphics.cpp:37
Graphics()
Definition graphics.cpp:19
Definition label.hpp:45
Definition definitions.hpp:253
Definition components.hpp:96
Definition components.hpp:289
Definition definitions.hpp:64
TextureScaling
Definition definitions.hpp:122