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

Editor implementation of display interface. More...

#include <EditorDisplay.h>

Inherits IDekiDisplay.

Public Member Functions

 EditorDisplay ()
virtual ~EditorDisplay ()
bool Initialize (int32_t width, int32_t height) override
 Initialize the platform display.
void Shutdown () override
 Shutdown the display and cleanup resources.
void Present (const uint8_t *framebuffer, int width, int height, int format) override
 Present the frame buffer to the display.
bool SupportsPartialPresent () const override
 True when PresentRegions() pushes only the rectangles it is given.
void PresentRegions (const uint8_t *framebuffer, int width, int height, int format, const DekiRect *rects, int32_t count) override
 Present only rects of the framebuffer.
void GetDisplaySize (int32_t *width, int32_t *height) const override
 Get the display dimensions.
bool IsInitialized () const override
 Check if the display is initialized.
void RequestFullRefresh () override
 Request a full display refresh.
bool ProcessEvents () override
 Process platform events (window close, resize, etc.).
void * CreateUIOverlay (int32_t width, int32_t height) override
bool UpdateUIOverlay (void *overlay, int32_t x, int32_t y, int32_t width, int32_t height, const uint32_t *pixels) override
bool UpdateUIOverlayRGB565A8 (void *overlay, int32_t x, int32_t y, int32_t width, int32_t height, const uint8_t *rgb565a8_pixels) override
void DestroyUIOverlay (void *overlay) override
void SetActiveUIOverlay (void *overlay) override
void ClearActiveUIOverlay () override
uint32_t GetTextureId () const
Public Member Functions inherited from IDekiDisplay
virtual ~IDekiDisplay ()=default
virtual uint8_t * GetRenderBuffer (int32_t *width, int32_t *height)
 Get a display-owned buffer suitable for direct rendering.
virtual void SetBacklight (bool on)
 Turn the display backlight on or off.

Detailed Description

Editor implementation of display interface.

This display renders to an OpenGL texture that can be displayed in ImGui. It doesn't create its own window - the editor manages the window.

Constructor & Destructor Documentation

◆ EditorDisplay()

EditorDisplay::EditorDisplay ( )

◆ ~EditorDisplay()

virtual EditorDisplay::~EditorDisplay ( )
virtual

Member Function Documentation

◆ Initialize()

bool EditorDisplay::Initialize ( int32_t width,
int32_t height )
overridevirtual

Initialize the platform display.

Implements IDekiDisplay.

◆ Shutdown()

void EditorDisplay::Shutdown ( )
overridevirtual

Shutdown the display and cleanup resources.

Implements IDekiDisplay.

◆ Present()

void EditorDisplay::Present ( const uint8_t * framebuffer,
int width,
int height,
int format )
overridevirtual

Present the frame buffer to the display.

Parameters
format0=RGB565, 1=RGB888, 2=ARGB8888

Implements IDekiDisplay.

◆ SupportsPartialPresent()

bool EditorDisplay::SupportsPartialPresent ( ) const
inlineoverridevirtual

True when PresentRegions() pushes only the rectangles it is given.

The default display presents whole frames, and the engine then never calls PresentRegions. A display that can address a sub-rectangle of its panel or texture returns true and implements PresentRegions.

Reimplemented from IDekiDisplay.

◆ PresentRegions()

void EditorDisplay::PresentRegions ( const uint8_t * framebuffer,
int width,
int height,
int format,
const DekiRect * rects,
int32_t count )
overridevirtual

Present only rects of the framebuffer.

Rectangles are framebuffer pixels, half-open, already clipped to the buffer; they may overlap. count 0 means nothing changed since the last present: a windowed display still redraws its window from the texture it holds, an LCD does nothing. The default pushes the whole frame, so a display that does not override this behaves exactly as before.

Reimplemented from IDekiDisplay.

◆ GetDisplaySize()

void EditorDisplay::GetDisplaySize ( int32_t * width,
int32_t * height ) const
overridevirtual

Get the display dimensions.

Implements IDekiDisplay.

◆ IsInitialized()

bool EditorDisplay::IsInitialized ( ) const
overridevirtual

Check if the display is initialized.

Implements IDekiDisplay.

◆ RequestFullRefresh()

void EditorDisplay::RequestFullRefresh ( )
overridevirtual

Request a full display refresh.

Implements IDekiDisplay.

◆ ProcessEvents()

bool EditorDisplay::ProcessEvents ( )
overridevirtual

Process platform events (window close, resize, etc.).

Returns
true if application should continue running, false to exit

Implements IDekiDisplay.

◆ CreateUIOverlay()

void * EditorDisplay::CreateUIOverlay ( int32_t width,
int32_t height )
overridevirtual

Implements IDekiDisplay.

◆ UpdateUIOverlay()

bool EditorDisplay::UpdateUIOverlay ( void * overlay,
int32_t x,
int32_t y,
int32_t width,
int32_t height,
const uint32_t * pixels )
overridevirtual

Implements IDekiDisplay.

◆ UpdateUIOverlayRGB565A8()

bool EditorDisplay::UpdateUIOverlayRGB565A8 ( void * overlay,
int32_t x,
int32_t y,
int32_t width,
int32_t height,
const uint8_t * rgb565a8_pixels )
overridevirtual

Implements IDekiDisplay.

◆ DestroyUIOverlay()

void EditorDisplay::DestroyUIOverlay ( void * overlay)
overridevirtual

Implements IDekiDisplay.

◆ SetActiveUIOverlay()

void EditorDisplay::SetActiveUIOverlay ( void * overlay)
overridevirtual

Implements IDekiDisplay.

◆ ClearActiveUIOverlay()

void EditorDisplay::ClearActiveUIOverlay ( )
overridevirtual

Implements IDekiDisplay.

◆ GetTextureId()

uint32_t EditorDisplay::GetTextureId ( ) const
inline

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