IRenderer is an abstract base class for rendering systems. It defines methods for initializing, drawing, and managing graphics resources, which must be implemented by specific renderer classes (e.g., OpenGL, SDL).
More...
#include <IRenderer.h>
|
enum class | Flip { None = SDL_FLIP_NONE
, Horizontal = SDL_FLIP_HORIZONTAL
, Vertical = SDL_FLIP_VERTICAL
} |
| Enum to represent the different flipping modes for rendering sprites. This allows flipping a sprite horizontally or vertically, or no flipping at all. More...
|
|
enum class | RendererType { SDL
, OPENGL
} |
| Enum representing the type of renderer (either SDL or OpenGL). This helps identify which underlying rendering system is being used. More...
|
|
IRenderer is an abstract base class for rendering systems. It defines methods for initializing, drawing, and managing graphics resources, which must be implemented by specific renderer classes (e.g., OpenGL, SDL).
◆ Flip
Enum to represent the different flipping modes for rendering sprites. This allows flipping a sprite horizontally or vertically, or no flipping at all.
Enumerator |
---|
None | |
Horizontal | |
Vertical | |
◆ RendererType
Enum representing the type of renderer (either SDL or OpenGL). This helps identify which underlying rendering system is being used.
◆ ~IRenderer()
virtual IRenderer::~IRenderer |
( |
| ) |
|
|
virtualdefault |
◆ AddDebugRender()
Adds a debug render component to the renderer.
- Parameters
-
pDebugRender | The debug render interface to be added. |
◆ AddRenderComponent()
Adds a render component to the list of components to be rendered.
- Parameters
-
pRenderComponent | The render component to be added. |
◆ BeginDraw()
virtual void IRenderer::BeginDraw |
( |
| ) |
|
|
pure virtual |
◆ Close()
virtual void IRenderer::Close |
( |
| ) |
|
|
pure virtual |
◆ Draw()
virtual void IRenderer::Draw |
( |
| ) |
|
|
pure virtual |
Draws the rendered objects to the screen. This should be called after all draw calls have been issued.
Implemented in RendererGL, and RendererSDL.
◆ DrawMesh()
Draws a mesh with a specific texture index and transformation.
- Parameters
-
pMesh | The mesh to be drawn. |
pTextureIndex | Index of the mesh's texture to use. |
transform | World transformation matrix. |
tiling | Texture tiling to apply. |
Reimplemented in RendererGL.
◆ DrawRect()
virtual void IRenderer::DrawRect |
( |
const Rectangle & | rRect, |
|
|
Color | pColor ) |
|
pure virtual |
Draws a filled rectangle on the screen.
- Parameters
-
rRect | The rectangle defining the position and size of the rectangle. |
pColor | The color of the rectangle. |
Implemented in RendererGL, and RendererSDL.
◆ DrawRectLine()
virtual void IRenderer::DrawRectLine |
( |
const Rectangle & | rRect, |
|
|
Color | pColor ) |
|
pure virtual |
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. |
Implemented in RendererGL, and RendererSDL.
◆ DrawSprite()
Draws a 2D sprite on the screen using the provided texture and rectangle.
- Parameters
-
rOwner | The owning actor of the sprite (used for context, not directly here). |
rTexture | Pointer to the texture to render. |
rec | Defines the position and size of the sprite on screen. |
flip | Specifies sprite flipping (horizontal, vertical, etc.). |
Implemented in RendererGL, and RendererSDL.
◆ EndDraw()
virtual void IRenderer::EndDraw |
( |
| ) |
|
|
pure virtual |
◆ GetType()
Gets the type of the renderer being used.
- Returns
- The renderer type (SDL or OpenGL).
Implemented in RendererGL, and RendererSDL.
◆ Initialize()
virtual bool IRenderer::Initialize |
( |
Window & | rWindow | ) |
|
|
pure virtual |
Initializes the renderer with the provided window.
- Parameters
-
rWindow | The window that the renderer will be associated with. |
- Returns
- True if the initialization was successful, false otherwise.
Implemented in RendererGL, and RendererSDL.
◆ RemoveDebugRender()
Removes a debug render component from the renderer.
- Parameters
-
pDebugRender | The debug render interface to be removed. |
◆ RemoveRenderComponent()
void IRenderer::RemoveRenderComponent |
( |
RenderComponent * | pRenderComponent | ) |
|
Removes a render component from the list of components to be rendered.
- Parameters
-
pRenderComponent | The render component to be removed. |
◆ SetViewMatrix()
virtual void IRenderer::SetViewMatrix |
( |
const Matrix4 & | pView | ) |
|
|
inlinevirtual |
Sets the view matrix for the renderer. This is usually used for camera transformations.
- Parameters
-
pView | The view transformation matrix (e.g., camera position and orientation). |
Reimplemented in RendererGL.
◆ mDebugRenders
List of debug render components.
◆ mViewportRenderComponents
List of render components associated with the viewport.
◆ mWorldRenderComponents
List of render components associated with the world (3D space)
The documentation for this class was generated from the following files: