picofuse

Enumerations

This module provides a device-level API for SDL-based displays. More...

Collaboration diagram for SDL:

Enumerations

enum  dev_sdl_flags_t {
  dev_sdl_none = 0, dev_sdl_fullscreen = 1 << 0, dev_sdl_borderless = 1 << 1, dev_sdl_centered = 1 << 2,
  dev_sdl_hidden = 1 << 3
}
 Flags for SDL display creation. More...
 

Lifecycle

pix_display_tdev_sdl_init (const char *title, pix_size_t size, pix_format_t format, dev_sdl_flags_t flags, uint16_t interval_ms)
 Initialize an SDL-backed display. More...
 

Detailed Description

This module provides a device-level API for SDL-based displays.

Enumeration Type Documentation

◆ dev_sdl_flags_t

Flags for SDL display creation.

Enumerator
dev_sdl_none 

No flags.

dev_sdl_fullscreen 

Open the window fullscreen.

dev_sdl_borderless 

Create the window without a title bar or borders.

dev_sdl_centered 

Center the window - the default position is otherwise platform-defined.

dev_sdl_hidden 

Create the window without showing it - for exercising this backend headlessly (CI, no display server) with a real window/event loop behind it.

Definition at line 20 of file sdl.h.

20  {
21  dev_sdl_none = 0,
22  dev_sdl_fullscreen = 1 << 0,
23  dev_sdl_borderless = 1 << 1,
24  dev_sdl_centered = 1 << 2,
26  dev_sdl_hidden = 1 << 3,
Create the window without a title bar or borders.
Definition: sdl.h:23
No flags.
Definition: sdl.h:21
Create the window without showing it - for exercising this backend headlessly (CI, no display server) with a real window/event loop behind it.
Definition: sdl.h:27
dev_sdl_flags_t
Flags for SDL display creation.
Definition: sdl.h:20
Open the window fullscreen.
Definition: sdl.h:22
Center the window - the default position is otherwise platform-defined.
Definition: sdl.h:25

Function Documentation

◆ dev_sdl_init()

pix_display_t* dev_sdl_init ( const char *  title,
pix_size_t  size,
pix_format_t  format,
dev_sdl_flags_t  flags,
uint16_t  interval_ms 
)

Initialize an SDL-backed display.

Parameters
titleThe window title. NULL falls back to the program's own name.
sizeThe display size, in pixels.
formatThe pixel format the display's bitmap should use.
flagsWindow creation flags - see dev_sdl_flags_t.
interval_msMinimum time between flushes, in ms - 0 for no rate limit ("as often as possible").
Returns
A display handle bound to a real SDL window, or NULL on failure (SDL2 unavailable on this build, an unsupported format, or the underlying SDL_CreateWindow()/SDL_CreateRenderer()/ SDL_CreateTexture() call failing).