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

Abstract interface for display package operations. More...

#include <IDekiDisplay.h>

Inherited by EditorDisplay.

Public Member Functions

virtual ~IDekiDisplay ()=default
virtual bool Initialize (int32_t width, int32_t height)=0
 Initialize the platform display.
virtual void Shutdown ()=0
 Shutdown the display and cleanup resources.
virtual void Present (const uint8_t *framebuffer, int width, int height, int format)=0
 Present the frame buffer to the display.
virtual bool SupportsPartialPresent () const
 True when PresentRegions() pushes only the rectangles it is given.
virtual void PresentRegions (const uint8_t *framebuffer, int width, int height, int format, const DekiRect *rects, int32_t count)
 Present only rects of the framebuffer.
virtual void GetDisplaySize (int32_t *width, int32_t *height) const =0
 Get the display dimensions.
virtual bool IsInitialized () const =0
 Check if the display is initialized.
virtual void RequestFullRefresh ()=0
 Request a full display refresh.
virtual bool ProcessEvents ()=0
 Process platform events (window close, resize, etc.).
virtual void * CreateUIOverlay (int32_t width, int32_t height)=0
virtual bool UpdateUIOverlay (void *overlay, int32_t x, int32_t y, int32_t width, int32_t height, const uint32_t *pixels)=0
virtual bool UpdateUIOverlayRGB565A8 (void *overlay, int32_t x, int32_t y, int32_t width, int32_t height, const uint8_t *rgb565a8_pixels)=0
virtual void DestroyUIOverlay (void *overlay)=0
virtual void SetActiveUIOverlay (void *overlay)=0
virtual void ClearActiveUIOverlay ()=0
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

Abstract interface for display package operations.

This interface defines the contract that display packages must implement to work with the Deki engine. It abstracts display initialization, buffer management, and rendering operations.

Whichever platform integration package is loaded at runtime registers its concrete display via DekiEngine::SetDisplay(this, name). Engine-core owns no concrete display logic — only the IDekiDisplay* pointer and the lifecycle coordination around it.

Constructor & Destructor Documentation

◆ ~IDekiDisplay()

virtual IDekiDisplay::~IDekiDisplay ( )
virtualdefault

Member Function Documentation

◆ Initialize()

virtual bool IDekiDisplay::Initialize ( int32_t width,
int32_t height )
pure virtual

Initialize the platform display.

Implemented in EditorDisplay.

◆ Shutdown()

virtual void IDekiDisplay::Shutdown ( )
pure virtual

Shutdown the display and cleanup resources.

Implemented in EditorDisplay.

◆ Present()

virtual void IDekiDisplay::Present ( const uint8_t * framebuffer,
int width,
int height,
int format )
pure virtual

Present the frame buffer to the display.

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

Implemented in EditorDisplay.

◆ SupportsPartialPresent()

virtual bool IDekiDisplay::SupportsPartialPresent ( ) const
inlinevirtual

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 in EditorDisplay.

◆ PresentRegions()

virtual void IDekiDisplay::PresentRegions ( const uint8_t * framebuffer,
int width,
int height,
int format,
const DekiRect * rects,
int32_t count )
inlinevirtual

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 in EditorDisplay.

◆ GetDisplaySize()

virtual void IDekiDisplay::GetDisplaySize ( int32_t * width,
int32_t * height ) const
pure virtual

Get the display dimensions.

Implemented in EditorDisplay.

◆ IsInitialized()

virtual bool IDekiDisplay::IsInitialized ( ) const
pure virtual

Check if the display is initialized.

Implemented in EditorDisplay.

◆ RequestFullRefresh()

virtual void IDekiDisplay::RequestFullRefresh ( )
pure virtual

Request a full display refresh.

Implemented in EditorDisplay.

◆ ProcessEvents()

virtual bool IDekiDisplay::ProcessEvents ( )
pure virtual

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

Returns
true if application should continue running, false to exit

Implemented in EditorDisplay.

◆ CreateUIOverlay()

virtual void * IDekiDisplay::CreateUIOverlay ( int32_t width,
int32_t height )
pure virtual

Implemented in EditorDisplay.

◆ UpdateUIOverlay()

virtual bool IDekiDisplay::UpdateUIOverlay ( void * overlay,
int32_t x,
int32_t y,
int32_t width,
int32_t height,
const uint32_t * pixels )
pure virtual

Implemented in EditorDisplay.

◆ UpdateUIOverlayRGB565A8()

virtual bool IDekiDisplay::UpdateUIOverlayRGB565A8 ( void * overlay,
int32_t x,
int32_t y,
int32_t width,
int32_t height,
const uint8_t * rgb565a8_pixels )
pure virtual

Implemented in EditorDisplay.

◆ DestroyUIOverlay()

virtual void IDekiDisplay::DestroyUIOverlay ( void * overlay)
pure virtual

Implemented in EditorDisplay.

◆ SetActiveUIOverlay()

virtual void IDekiDisplay::SetActiveUIOverlay ( void * overlay)
pure virtual

Implemented in EditorDisplay.

◆ ClearActiveUIOverlay()

virtual void IDekiDisplay::ClearActiveUIOverlay ( )
pure virtual

Implemented in EditorDisplay.

◆ GetRenderBuffer()

virtual uint8_t * IDekiDisplay::GetRenderBuffer ( int32_t * width,
int32_t * height )
inlinevirtual

Get a display-owned buffer suitable for direct rendering.

If the display has an internal DMA-aligned buffer (e.g. in fast internal RAM), DekiRenderSystem can render directly into it, avoiding a memcpy during Present.

◆ SetBacklight()

virtual void IDekiDisplay::SetBacklight ( bool on)
inlinevirtual

Turn the display backlight on or off.

Called by IDekiPower around sleep transitions: off in OnBeforeSleep so the panel doesn't burn current while the CPU is paused, on in OnScreenOn after wake. Displays without controllable backlight (desktop windows) leave the default no-op.


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