![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton to track the currently active camera during rendering This allows drawing functions to automatically apply camera transforms without requiring CameraTransform parameters in every function call. More...
#include <RenderContext.h>
Collaboration diagram for RenderContext:Public Member Functions | |
| void | SetActiveCamera (const CameraTransform &cam) |
| Set the active camera for the current rendering pass Call this at the start of rendering for each player/viewport. | |
| const CameraTransform & | GetActiveCamera () const |
| Get the currently active camera Returns identity transform (no transformation) if none is set. | |
| bool | HasActiveCamera () const |
| Check if a camera is currently active. | |
| void | ClearActiveCamera () |
| Clear the active camera (e.g., at end of rendering pass) | |
Static Public Member Functions | |
| static RenderContext & | Get () |
Private Member Functions | |
| RenderContext () | |
| ~RenderContext ()=default | |
| RenderContext (const RenderContext &)=delete | |
| RenderContext & | operator= (const RenderContext &)=delete |
Private Attributes | |
| CameraTransform | activeCamera_ |
| CameraTransform | identityCamera_ |
| bool | hasCameraSet_ |
Singleton to track the currently active camera during rendering This allows drawing functions to automatically apply camera transforms without requiring CameraTransform parameters in every function call.
Definition at line 19 of file RenderContext.h.
|
inlineprivate |
Definition at line 55 of file RenderContext.h.
References identityCamera_, CameraTransform::isActive, CameraTransform::rotation, CameraTransform::screenOffset, CameraTransform::viewport, CameraTransform::worldPosition, and CameraTransform::zoom.
|
privatedefault |
|
privatedelete |
|
inline |
Clear the active camera (e.g., at end of rendering pass)
Definition at line 50 of file RenderContext.h.
References hasCameraSet_.
Referenced by RenderingSystem::Render().
Here is the caller graph for this function:
|
inlinestatic |
Definition at line 22 of file RenderContext.h.
References GetComponentTypeID_Static().
Referenced by Draw_Circle(), Draw_FilledCircle(), Draw_FilledHexagon(), Draw_FilledTriangle(), Draw_Hexagon(), Draw_Rectangle(), Draw_Text(), Draw_Triangle(), and RenderingSystem::Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Get the currently active camera Returns identity transform (no transformation) if none is set.
Definition at line 36 of file RenderContext.h.
References activeCamera_, hasCameraSet_, and identityCamera_.
Referenced by Draw_Circle(), Draw_FilledCircle(), Draw_FilledHexagon(), Draw_FilledTriangle(), Draw_Hexagon(), Draw_Rectangle(), Draw_Text(), and Draw_Triangle().
Here is the caller graph for this function:
|
inline |
Check if a camera is currently active.
Definition at line 45 of file RenderContext.h.
References hasCameraSet_.
|
privatedelete |
|
inline |
Set the active camera for the current rendering pass Call this at the start of rendering for each player/viewport.
Definition at line 29 of file RenderContext.h.
References activeCamera_, GetComponentTypeID_Static(), and hasCameraSet_.
Referenced by RenderingSystem::Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 66 of file RenderContext.h.
Referenced by GetActiveCamera(), and SetActiveCamera().
|
private |
Definition at line 68 of file RenderContext.h.
Referenced by ClearActiveCamera(), GetActiveCamera(), HasActiveCamera(), and SetActiveCamera().
|
private |
Definition at line 67 of file RenderContext.h.
Referenced by GetActiveCamera(), and RenderContext().