18 Renderer(std::shared_ptr<Game> game);
58 void drawLine(
int x0,
int y0,
int x1,
int y1);
78 void drawRectangle(
int x,
int y,
int w,
int h, glm::vec3 color = {0, 0, 0});
105 void setPixel(
int x,
int y,
int r,
int g,
int b);
Contains the declaration of the Game class, representing the game environment.
A class for rendering graphics in a game.
Definition: Renderer.hpp:11
uint32_t _width
The width of the rendering area.
Definition: Renderer.hpp:109
~Renderer()
Destructor for the Renderer class.
Definition: Renderer.cpp:20
void draw()
Render the graphics.
Definition: Renderer.cpp:22
Renderer(std::shared_ptr< Game > game)
Constructor for the Renderer class.
Definition: Renderer.cpp:19
uint32_t _height
The height of the rendering area.
Definition: Renderer.hpp:110
void drawLineLow(int x0, int y0, int x1, int y1)
Draw a line with a low slope.
Definition: Renderer.cpp:93
uint8_t * _data
A pointer to the pixel data.
Definition: Renderer.hpp:107
void setPixel(int x, int y, int r, int g, int b)
Set the color of a pixel at (x, y).
Definition: Renderer.cpp:148
void drawRectangle(int x, int y, int w, int h, glm::vec3 color={0, 0, 0})
Draw a rectangle at (x, y) with (w, h) size.
Definition: Renderer.cpp:70
uint8_t * _deployData
A pointer to the deployed pixel data.
Definition: Renderer.hpp:108
void clear()
Clear the rendering area by setting all pixels to white.
Definition: Renderer.cpp:34
uint32_t getTextureId() const
Get the texture ID associated with the renderer.
Definition: Renderer.cpp:32
void drawLine(int x0, int y0, int x1, int y1)
Draw a line from (x0, y0) to (x1, y1).
Definition: Renderer.cpp:79
void drawCircle(int x, int y, int r)
Draw a circle at (x, y) with radius r.
Definition: Renderer.cpp:54
void initializeTexture()
Initialize the texture used for rendering.
Definition: Renderer.cpp:146
void drawLineHigh(int x0, int y0, int x1, int y1)
Draw a line with a high slope.
Definition: Renderer.cpp:120
std::shared_ptr< Game > _game
A shared pointer to the associated Game instance.
Definition: Renderer.hpp:112
void setDimension(uint32_t width, uint32_t height)
Set the dimensions of the rendering area.
Definition: Renderer.cpp:36
uint32_t _textureId
The texture ID used for rendering.
Definition: Renderer.hpp:113