What a display package implements: setup, presenting frames, events and UI overlays.
More...
#include <deki/providers/IDisplay.h>
|
| virtual | ~IDisplay ()=default |
| virtual bool | Initialize (int32_t width, int32_t height)=0 |
| virtual void | Shutdown ()=0 |
| virtual void | Present (const uint8_t *framebuffer, int width, int height, ColorFormat format)=0 |
| | Shows the whole framebuffer.
|
| virtual bool | SupportsPartialPresent () const |
| | True when PresentRegions() sends only the rectangles it is given.
|
| virtual void | PresentRegions (const uint8_t *framebuffer, int width, int height, ColorFormat format, const Rect *rects, int32_t count) |
| | Shows only rects of the framebuffer: framebuffer pixels, half-open, already clipped, possibly overlapping.
|
| virtual void | GetDisplaySize (int32_t *width, int32_t *height) const =0 |
| virtual ColorFormat | GetColorFormat () const =0 |
| | The pixel format this display takes.
|
| virtual bool | IsInitialized () const =0 |
| virtual void | RequestFullRefresh ()=0 |
| | Makes the next present redraw the whole screen.
|
| virtual bool | ProcessEvents ()=0 |
| | Handles platform events (window close, resize, ...).
|
| 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 *rgb565a8Pixels)=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) |
| | A buffer the display owns that the renderer can draw into directly, such as a DMA-capable buffer in fast internal RAM, saving a copy in Present.
|
| virtual void | SetBacklight (bool on) |
| | Turns the backlight on or off.
|
What a display package implements: setup, presenting frames, events and UI overlays.
The platform package loaded at runtime registers its display with Engine::SetDisplay(this, name); the engine holds only the pointer.
◆ ~IDisplay()
| virtual Deki::IDisplay::~IDisplay |
( |
| ) |
|
|
virtualdefault |
◆ Initialize()
| virtual bool Deki::IDisplay::Initialize |
( |
int32_t | width, |
|
|
int32_t | height ) |
|
pure virtual |
◆ Shutdown()
| virtual void Deki::IDisplay::Shutdown |
( |
| ) |
|
|
pure virtual |
◆ Present()
| virtual void Deki::IDisplay::Present |
( |
const uint8_t * | framebuffer, |
|
|
int | width, |
|
|
int | height, |
|
|
ColorFormat | format ) |
|
pure virtual |
Shows the whole framebuffer.
Use FrameBufferBytes(format, ...) for its size rather than working out bytes per pixel.
◆ SupportsPartialPresent()
| virtual bool Deki::IDisplay::SupportsPartialPresent |
( |
| ) |
const |
|
inlinevirtual |
True when PresentRegions() sends only the rectangles it is given.
A display that can address part of its panel or texture returns true and implements PresentRegions; otherwise the engine never calls it.
◆ PresentRegions()
| virtual void Deki::IDisplay::PresentRegions |
( |
const uint8_t * | framebuffer, |
|
|
int | width, |
|
|
int | height, |
|
|
ColorFormat | format, |
|
|
const Rect * | rects, |
|
|
int32_t | count ) |
|
inlinevirtual |
Shows only rects of the framebuffer: framebuffer pixels, half-open, already clipped, possibly overlapping.
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 sends the whole frame.
◆ GetDisplaySize()
| virtual void Deki::IDisplay::GetDisplaySize |
( |
int32_t * | width, |
|
|
int32_t * | height ) const |
|
pure virtual |
◆ GetColorFormat()
| virtual ColorFormat Deki::IDisplay::GetColorFormat |
( |
| ) |
const |
|
pure virtual |
The pixel format this display takes.
With GetDisplaySize, it sets the framebuffer's size and format when the display is registered, so every target renders in its own screen's format and Present never converts.
◆ IsInitialized()
| virtual bool Deki::IDisplay::IsInitialized |
( |
| ) |
const |
|
pure virtual |
◆ RequestFullRefresh()
| virtual void Deki::IDisplay::RequestFullRefresh |
( |
| ) |
|
|
pure virtual |
Makes the next present redraw the whole screen.
◆ ProcessEvents()
| virtual bool Deki::IDisplay::ProcessEvents |
( |
| ) |
|
|
pure virtual |
Handles platform events (window close, resize, ...).
Returns false when the application should exit.
◆ CreateUIOverlay()
| virtual void * Deki::IDisplay::CreateUIOverlay |
( |
int32_t | width, |
|
|
int32_t | height ) |
|
pure virtual |
◆ UpdateUIOverlay()
| virtual bool Deki::IDisplay::UpdateUIOverlay |
( |
void * | overlay, |
|
|
int32_t | x, |
|
|
int32_t | y, |
|
|
int32_t | width, |
|
|
int32_t | height, |
|
|
const uint32_t * | pixels ) |
|
pure virtual |
◆ UpdateUIOverlayRGB565A8()
| virtual bool Deki::IDisplay::UpdateUIOverlayRGB565A8 |
( |
void * | overlay, |
|
|
int32_t | x, |
|
|
int32_t | y, |
|
|
int32_t | width, |
|
|
int32_t | height, |
|
|
const uint8_t * | rgb565a8Pixels ) |
|
pure virtual |
◆ DestroyUIOverlay()
| virtual void Deki::IDisplay::DestroyUIOverlay |
( |
void * | overlay | ) |
|
|
pure virtual |
◆ SetActiveUIOverlay()
| virtual void Deki::IDisplay::SetActiveUIOverlay |
( |
void * | overlay | ) |
|
|
pure virtual |
◆ ClearActiveUIOverlay()
| virtual void Deki::IDisplay::ClearActiveUIOverlay |
( |
| ) |
|
|
pure virtual |
◆ GetRenderBuffer()
| virtual uint8_t * Deki::IDisplay::GetRenderBuffer |
( |
int32_t * | width, |
|
|
int32_t * | height ) |
|
inlinevirtual |
A buffer the display owns that the renderer can draw into directly, such as a DMA-capable buffer in fast internal RAM, saving a copy in Present.
nullptr when there is none.
◆ SetBacklight()
| virtual void Deki::IDisplay::SetBacklight |
( |
bool | on | ) |
|
|
inlinevirtual |
Turns the backlight on or off.
IPower calls it around sleep: off in OnBeforeSleep so the panel draws no current while the CPU is paused, on in OnScreenOn after waking. Displays without one (desktop windows) keep the default, which does nothing.
The documentation for this class was generated from the following file: