Represents the renderer of an Application.
More...
#include <renderer.hpp>
|
| Renderer (void) |
| Constructs a Renderer object.
|
|
virtual | ~Renderer (void)=default |
| Destroys the Renderer object.
|
|
virtual void | clear (void) |
| Clears the rendering target.
|
|
virtual void | present (void) |
| Presents the rendered content to the display.
|
|
virtual void | draw (std::shared_ptr< Primitive > primitive) |
| Draws a primitive to the screen.
|
|
virtual void | drawText (std::shared_ptr< Text > text) |
| Draws a text primitive in 3D space.
|
|
virtual void | drawRectangle (std::shared_ptr< Rectangle > rectangle) |
| Draws a rectangle primitive in 3D space.
|
|
virtual void | drawTriangle (std::shared_ptr< Triangle > triangle) |
| Draws a triangle primitive in 3D space.
|
|
virtual void | drawPolygon (std::shared_ptr< Polygon > polygon) |
| Draws a polygon primitive in 3D space.
|
|
Represents the renderer of an Application.
The Renderer is responsible for rendering components to the screen. It can be extended to support different rendering backends (e.g., terminal, GUI, web).
◆ clear()
virtual void Renderer::clear |
( |
void |
| ) |
|
|
inlinevirtual |
Clears the rendering target.
This method is called to clear the current rendering target (e.g., the screen or a texture) before drawing new content.
◆ draw()
virtual void Renderer::draw |
( |
std::shared_ptr< Primitive > |
primitive | ) |
|
|
virtual |
Draws a primitive to the screen.
This method dispatches to the appropriate specific draw method based on the primitive type. Derived classes can override either this method or the specific draw methods (drawText, drawRectangle, etc.).
- Parameters
-
primitive | The primitive to render |
◆ drawPolygon()
virtual void Renderer::drawPolygon |
( |
std::shared_ptr< Polygon > |
polygon | ) |
|
|
inlinevirtual |
Draws a polygon primitive in 3D space.
This is a virtual method that can be overridden by derived classes to implement specific 3D polygon rendering logic for different backends. The polygon includes surface normal calculation and centroid computation.
- Parameters
-
polygon | The polygon primitive to render in 3D space |
◆ drawRectangle()
virtual void Renderer::drawRectangle |
( |
std::shared_ptr< Rectangle > |
rectangle | ) |
|
|
inlinevirtual |
Draws a rectangle primitive in 3D space.
This is a virtual method that can be overridden by derived classes to implement specific 3D rectangle rendering logic for different backends. The rectangle maintains full 3D positioning for all corners.
- Parameters
-
rectangle | The rectangle primitive to render in 3D space |
◆ drawText()
virtual void Renderer::drawText |
( |
std::shared_ptr< Text > |
text | ) |
|
|
inlinevirtual |
Draws a text primitive in 3D space.
This is a virtual method that can be overridden by derived classes to implement specific 3D text rendering logic for different backends. The text includes 3D position, rotation, and scale information.
- Parameters
-
text | The text primitive to render in 3D space |
◆ drawTriangle()
virtual void Renderer::drawTriangle |
( |
std::shared_ptr< Triangle > |
triangle | ) |
|
|
inlinevirtual |
Draws a triangle primitive in 3D space.
This is a virtual method that can be overridden by derived classes to implement specific 3D triangle rendering logic for different backends. The triangle includes surface normal calculation and area computation.
- Parameters
-
triangle | The triangle primitive to render in 3D space |
◆ present()
virtual void Renderer::present |
( |
void |
| ) |
|
|
inlinevirtual |
Presents the rendered content to the display.
This method is called after all drawing commands have been issued to present the final rendered content to the screen.
The documentation for this class was generated from the following file: