RendererSDL is an SDL-based renderer that implements IRenderer. It manages the SDL rendering context, handles drawing 2D primitives (like rectangles), and textures (like sprites) using SDL's rendering functions.
More...
#include <RendererSDL.h>
RendererSDL is an SDL-based renderer that implements IRenderer. It manages the SDL rendering context, handles drawing 2D primitives (like rectangles), and textures (like sprites) using SDL's rendering functions.
◆ RendererSDL() [1/2]
RendererSDL::RendererSDL |
( |
| ) |
|
Constructor for RendererSDL. Initializes the SDL_Renderer to a nullptr.
◆ RendererSDL() [2/2]
RendererSDL::RendererSDL |
( |
const IRenderer & | | ) |
|
|
delete |
◆ BeginDraw()
void RendererSDL::BeginDraw |
( |
| ) |
|
|
overridevirtual |
Begins the drawing process by setting the background color and clearing the screen.
Implements IRenderer.
◆ Close()
void RendererSDL::Close |
( |
| ) |
|
|
overridevirtual |
Closes the SDL renderer and cleans up resources.
Implements IRenderer.
◆ Draw()
void RendererSDL::Draw |
( |
| ) |
|
|
overridevirtual |
Draws all render components to the screen.
Implements IRenderer.
◆ DrawRect()
Draws a filled rectangle on the screen with the specified color.
- Parameters
-
rRect | The rectangle to be drawn. |
pColor | The color of the rectangle. |
Implements IRenderer.
◆ DrawRectLine()
void RendererSDL::DrawRectLine |
( |
const Rectangle & | rRect, |
|
|
Color | pColor ) |
|
overridevirtual |
Draws only the outline (border) of a rectangle on the screen.
- Parameters
-
rRect | The rectangle defining the position and size of the rectangle. |
pColor | The color of the rectangle's border. |
Implements IRenderer.
◆ DrawSprite()
Draws a sprite on the screen using the specified texture and transformation.
- Parameters
-
rOwner | The actor owning the sprite (used for context, not directly here). |
rTexture | Pointer to the texture to render. |
rec | The rectangle that defines the position and size of the sprite on screen. |
flip | Specifies sprite flipping (horizontal, vertical, etc.). |
Implements IRenderer.
◆ EndDraw()
void RendererSDL::EndDraw |
( |
| ) |
|
|
overridevirtual |
Ends the drawing process by presenting the rendered frame to the screen.
Implements IRenderer.
◆ GetSDLRender()
SDL_Renderer * RendererSDL::GetSDLRender |
( |
| ) |
|
Gets the SDL_Renderer instance used by this renderer.
- Returns
- The SDL_Renderer object.
◆ GetType()
◆ Initialize()
bool RendererSDL::Initialize |
( |
Window & | rWindow | ) |
|
|
virtual |
Initializes the SDL renderer with the specified window.
- Parameters
-
rWindow | The window to render the graphics onto. |
- Returns
- Returns true if initialization is successful, false otherwise.
Implements IRenderer.
◆ operator=()
The documentation for this class was generated from the following files: