Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Singleton providing current render context for scene view. More...

#include <SceneView.h>

Public Member Functions

float GetScreenX () const
 Screen X position of object center.
float GetScreenY () const
 Screen Y position of object center.
float GetWorldX () const
 World X position.
float GetWorldY () const
 World Y position.
float GetScaleX () const
 World scale X.
float GetScaleY () const
 World scale Y.
float GetRotation () const
 Rotation in radians (engine convention).
float GetZoom () const
 View zoom level (editor wheel zoom * dpi only — no PPM).
float GetPixelsPerMeter () const
 Pixels per meter for the active project camera (world scale).
float GetWorldToScreenScale () const
 World meters to screen pixels (= zoom * pixelsPerMeter).
float GetDisplayWidth () const
 Display width (for current component).
float GetDisplayHeight () const
 Display height (for current component).
bool IsCurrentObjectSelected () const
 Whether current object is selected.
DekiObjectGetCurrentObject () const
 Get current object being rendered.
int GetTargetWidth () const
 Project render target width in pixels (DisplaySettings.targetWidth).
int GetTargetHeight () const
 Project render target height in pixels (DisplaySettings.targetHeight).
void SetTargetSize (int width, int height)
 Set project render target size (called by SceneViewPanel).
void DrawLine (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f)
void DrawRect (float x0, float y0, float x1, float y1, uint32_t rgba, float thickness=1.0f, float rounding=0.0f)
void DrawRectFilled (float x0, float y0, float x1, float y1, uint32_t rgba, float rounding=0.0f)
void DrawCircle (float cx, float cy, float radius, uint32_t rgba, float thickness=1.0f)
void DrawCircleFilled (float cx, float cy, float radius, uint32_t rgba)
void BeginObject (const SceneViewContext &ctx)
 Begin rendering an object (called by SceneObjectRenderer).
void EndObject ()
 End rendering an object.

Static Public Member Functions

static SceneView & Get ()
 Get singleton instance.
static uint32_t Rgba (uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)
 Pack an RGBA color (components 0-255) for the Draw* methods.

Detailed Description

Singleton providing current render context for scene view.

Unity-like static access for gizmo implementations: auto& view = SceneView::Get(); float halfW = sprite->width * view.GetScaleX() * view.GetZoom() * 0.5f;

The SceneViewPanel calls BeginObject/EndObject to set up context for gizmo rendering. Visual content is rendered via DekiRenderSystem.

Member Function Documentation

◆ Get()

SceneView & DekiEditor::SceneView::Get ( )
static

Get singleton instance.

◆ GetScreenX()

float DekiEditor::SceneView::GetScreenX ( ) const
inline

Screen X position of object center.

◆ GetScreenY()

float DekiEditor::SceneView::GetScreenY ( ) const
inline

Screen Y position of object center.

◆ GetWorldX()

float DekiEditor::SceneView::GetWorldX ( ) const
inline

World X position.

◆ GetWorldY()

float DekiEditor::SceneView::GetWorldY ( ) const
inline

World Y position.

◆ GetScaleX()

float DekiEditor::SceneView::GetScaleX ( ) const
inline

World scale X.

◆ GetScaleY()

float DekiEditor::SceneView::GetScaleY ( ) const
inline

World scale Y.

◆ GetRotation()

float DekiEditor::SceneView::GetRotation ( ) const
inline

Rotation in radians (engine convention).

◆ GetZoom()

float DekiEditor::SceneView::GetZoom ( ) const
inline

View zoom level (editor wheel zoom * dpi only — no PPM).

◆ GetPixelsPerMeter()

float DekiEditor::SceneView::GetPixelsPerMeter ( ) const
inline

Pixels per meter for the active project camera (world scale).

◆ GetWorldToScreenScale()

float DekiEditor::SceneView::GetWorldToScreenScale ( ) const
inline

World meters to screen pixels (= zoom * pixelsPerMeter).

Use this for any gizmo dimension that originates in world units (e.g. CameraComponent::GetVisibleWidth, or an emission shape's radius). For fixed-screen-size accents (crosshairs, handle dots) use GetZoom().

◆ GetDisplayWidth()

float DekiEditor::SceneView::GetDisplayWidth ( ) const
inline

Display width (for current component).

◆ GetDisplayHeight()

float DekiEditor::SceneView::GetDisplayHeight ( ) const
inline

Display height (for current component).

◆ IsCurrentObjectSelected()

bool DekiEditor::SceneView::IsCurrentObjectSelected ( ) const
inline

Whether current object is selected.

◆ GetCurrentObject()

DekiObject * DekiEditor::SceneView::GetCurrentObject ( ) const
inline

Get current object being rendered.

◆ GetTargetWidth()

int DekiEditor::SceneView::GetTargetWidth ( ) const
inline

Project render target width in pixels (DisplaySettings.targetWidth).

◆ GetTargetHeight()

int DekiEditor::SceneView::GetTargetHeight ( ) const
inline

Project render target height in pixels (DisplaySettings.targetHeight).

◆ SetTargetSize()

void DekiEditor::SceneView::SetTargetSize ( int width,
int height )
inline

Set project render target size (called by SceneViewPanel).

◆ Rgba()

uint32_t DekiEditor::SceneView::Rgba ( uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a = 255 )
inlinestatic

Pack an RGBA color (components 0-255) for the Draw* methods.

◆ DrawLine()

void DekiEditor::SceneView::DrawLine ( float x0,
float y0,
float x1,
float y1,
uint32_t rgba,
float thickness = 1.0f )

◆ DrawRect()

void DekiEditor::SceneView::DrawRect ( float x0,
float y0,
float x1,
float y1,
uint32_t rgba,
float thickness = 1.0f,
float rounding = 0.0f )

◆ DrawRectFilled()

void DekiEditor::SceneView::DrawRectFilled ( float x0,
float y0,
float x1,
float y1,
uint32_t rgba,
float rounding = 0.0f )

◆ DrawCircle()

void DekiEditor::SceneView::DrawCircle ( float cx,
float cy,
float radius,
uint32_t rgba,
float thickness = 1.0f )

◆ DrawCircleFilled()

void DekiEditor::SceneView::DrawCircleFilled ( float cx,
float cy,
float radius,
uint32_t rgba )

◆ BeginObject()

void DekiEditor::SceneView::BeginObject ( const SceneViewContext & ctx)

Begin rendering an object (called by SceneObjectRenderer).

Parameters
ctxContext containing all render parameters

◆ EndObject()

void DekiEditor::SceneView::EndObject ( )

End rendering an object.


The documentation for this class was generated from the following file: