MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
GlobalGraphicsInfo.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace MayaFlux::Core {
6
7//==============================================================================
8// GRAPHICS BACKEND CONFIGURATION (Vulkan/OpenGL/etc.)
9//==============================================================================
10
11/**
12 * @struct GraphicsBackendInfo
13 * @brief Configuration for graphics API backend (Vulkan/OpenGL/etc.)
14 *
15 * Separate from windowing - this is GPU/rendering configuration.
16 * GraphicsSurfaceInfo handles windows, this handles the graphics API.
17 */
18struct MAYAFLUX_API GraphicsBackendInfo {
19 /** @brief Enable validation layers (debug builds) */
20 bool enable_validation = true;
21
22 /** @brief Enable GPU debug markers (for profiling tools) */
23 bool enable_debug_markers = false;
24
25 /** @brief Required device features (Vulkan-specific) */
26 struct {
27 bool compute_shaders = true;
28 bool geometry_shaders = false;
29 bool tessellation_shaders = false;
30 bool multi_viewport = false;
31 bool sampler_anisotropy = true;
32 bool fill_mode_non_solid = false;
33 } required_features;
34
35 /**
36 * @brief Preferred physical device class when no explicit selector matches.
37 *
38 * AUTO scores discrete above integrated above virtual above everything
39 * else. The other values pin the class; if no device of that class
40 * survives the presentation and extension filters, selection falls back
41 * to AUTO ordering unless strict_device_selection is set.
42 *
43 * EXTERNAL is a heuristic, not a device type. Vulkan reports an external GPU
44 * as DISCRETE GPU, indistinguishable from a built-in one. EXTERNAL therefore
45 * means DISCRETE plus a preference for the highest PCI bus number, since
46 * a Thunderbolt-attached device sits behind a PCIe switch well above the
47 * root complex. It requires VK_EXT_pci_bus_info; without that extension
48 * EXTERNAL behaves as DISCRETE and says so in the log.
49 */
50 enum class DevicePreference : uint8_t {
51 AUTO,
52 DISCRETE,
53 INTEGRATED,
54 VIRTUAL,
55 EXTERNAL
56 } device_preference = DevicePreference::AUTO;
57
58 /** @brief Index into enumeration order; negative disables. Debugging escape hatch, prefer device_uuid. */
59 int32_t device_index = -1;
60
61 /** @brief Device UUID as 32 lowercase hex chars, no separators; empty disables. Read it from the startup candidate table. */
62 std::string device_uuid;
63
64 /** @brief Case-insensitive substring of the device name; empty disables. Ambiguous matches take the highest scoring one. */
65 std::string device_name;
66
67 /** @brief Require the graphics queue family to support presentation. Set false for headless or compute-only. */
68 bool require_presentation = true;
69
70 /** @brief Treat an unmatched selector as fatal rather than falling back to scoring. */
71 bool strict_device_selection = false;
72
73 /** @brief Memory allocation strategy */
74 enum class MemoryStrategy : uint8_t {
75 CONSERVATIVE, ///< Minimize allocations
76 BALANCED, ///< Balance speed and memory
77 AGGRESSIVE ///< Maximize performance
78 } memory_strategy = MemoryStrategy::BALANCED;
79
80 /** @brief Command buffer pooling strategy */
81 enum class CommandPooling : uint8_t {
82 PER_THREAD, ///< One pool per thread
83 SHARED, ///< Shared pool
84 PER_QUEUE ///< One pool per queue family
85 } command_pooling = CommandPooling::PER_THREAD;
86
87 /** @brief Maximum number of frames in flight (GPU pipelining) */
88 uint32_t max_frames_in_flight = 2;
89
90 /** @brief Enable compute queue (separate from graphics) */
91 bool enable_compute_queue = true;
92
93 /** @brief Enable transfer queue (separate from graphics) */
94 bool enable_transfer_queue = false;
95
96 /** @brief Shader compilation strategy */
97 enum class ShaderCompilation : uint8_t {
98 RUNTIME, ///< Compile at runtime
99 PRECOMPILED, ///< Use pre-compiled SPIR-V
100 CACHED ///< Cache compiled shaders
101 } shader_compilation = ShaderCompilation::CACHED;
102
103 /** @brief Shader cache directory (if caching enabled) */
104 std::filesystem::path shader_cache_dir = "cache/shaders";
105
106 /** @brief Backend-specific extensions to request */
107 std::vector<std::string> required_extensions;
108 std::vector<std::string> optional_extensions;
109
110 static constexpr auto describe()
111 {
112 return std::make_tuple(
113 Reflect::member("enable_validation", &GraphicsBackendInfo::enable_validation),
114 Reflect::member("enable_debug_markers", &GraphicsBackendInfo::enable_debug_markers),
115 Reflect::member("device_preference", &GraphicsBackendInfo::device_preference),
116 Reflect::member("device_index", &GraphicsBackendInfo::device_index),
117 Reflect::member("device_uuid", &GraphicsBackendInfo::device_uuid),
118 Reflect::member("device_name", &GraphicsBackendInfo::device_name),
119 Reflect::member("require_presentation", &GraphicsBackendInfo::require_presentation),
120 Reflect::member("strict_device_selection", &GraphicsBackendInfo::strict_device_selection),
121 // Reflect::member("required_features", &GraphicsBackendInfo::required_features),
122 Reflect::member("memory_strategy", &GraphicsBackendInfo::memory_strategy),
123 Reflect::member("command_pooling", &GraphicsBackendInfo::command_pooling),
124 Reflect::member("max_frames_in_flight", &GraphicsBackendInfo::max_frames_in_flight),
125 Reflect::member("enable_compute_queue", &GraphicsBackendInfo::enable_compute_queue),
126 Reflect::member("enable_transfer_queue", &GraphicsBackendInfo::enable_transfer_queue),
127 Reflect::member("shader_compilation", &GraphicsBackendInfo::shader_compilation),
128 Reflect::member("shader_cache_dir", &GraphicsBackendInfo::shader_cache_dir),
129 Reflect::member("required_extensions", &GraphicsBackendInfo::required_extensions),
130 Reflect::member("optional_extensions", &GraphicsBackendInfo::optional_extensions));
131 }
132};
133
134/**
135 * @struct GraphicsResourceLimits
136 * @brief Resource limits and budgets for graphics subsystem
137 *
138 * Prevents runaway resource usage, similar to audio buffer limits.
139 */
140struct MAYAFLUX_API GraphicsResourceLimits {
141 /** @brief Maximum number of concurrent windows */
142 uint32_t max_windows = 16;
143
144 /** @brief Maximum staging buffer size (MB) */
145 uint32_t max_staging_buffer_mb = 256;
146
147 /** @brief Maximum compute buffer size (MB) */
148 uint32_t max_compute_buffer_mb = 1024;
149
150 /** @brief Maximum texture cache size (MB) */
151 uint32_t max_texture_cache_mb = 2048;
152
153 /** @brief Maximum number of descriptor sets */
154 uint32_t max_descriptor_sets = 1024;
155
156 /** @brief Maximum number of pipeline state objects */
157 uint32_t max_pipelines = 256;
158
159 static constexpr auto describe()
160 {
161 return std::make_tuple(
162 Reflect::member("max_windows", &GraphicsResourceLimits::max_windows),
163 Reflect::member("max_staging_buffer_mb", &GraphicsResourceLimits::max_staging_buffer_mb),
164 Reflect::member("max_compute_buffer_mb", &GraphicsResourceLimits::max_compute_buffer_mb),
165 Reflect::member("max_texture_cache_mb", &GraphicsResourceLimits::max_texture_cache_mb),
166 Reflect::member("max_descriptor_sets", &GraphicsResourceLimits::max_descriptor_sets),
167 Reflect::member("max_pipelines", &GraphicsResourceLimits::max_pipelines));
168 }
169};
170
171//==============================================================================
172// GLOBAL VISUAL STREAM INFO (Parallel to GlobalStreamInfo)
173//==============================================================================
174
175/**
176 * @struct GraphicsSurfaceInfo
177 * @brief System-wide configuration for visual stream processing
178 *
179 * Defines technical parameters for ALL windows/visual streams in the system.
180 * This is set once at subsystem initialization, similar to audio sample rate.
181 * Individual windows inherit these defaults but can override specific params.
182 */
183struct MAYAFLUX_API GraphicsSurfaceInfo {
184
185 /**
186 * @enum SurfaceFormat
187 * @brief Default pixel format for window surfaces (Vulkan-compatible)
188 */
189 enum class SurfaceFormat : uint8_t {
190 B8G8R8A8_SRGB, ///< Most common - 8-bit SRGB
191 R8G8B8A8_SRGB, ///< Alternative 8-bit SRGB
192 B8G8R8A8_UNORM, ///< 8-bit linear
193 R8G8B8A8_UNORM, ///< 8-bit linear
194 R16G16B16A16_SFLOAT, ///< 16-bit float HDR
195 A2B10G10R10_UNORM, ///< 10-bit HDR
196 R32G32B32A32_SFLOAT, ///< 32-bit float
197 };
198
199 /** @brief Default surface format for new windows */
200 SurfaceFormat format = SurfaceFormat::B8G8R8A8_SRGB;
201
202 /**
203 * @enum ColorSpace
204 * @brief Default color space for window surfaces
205 */
206 enum class ColorSpace : uint8_t {
207 SRGB_NONLINEAR, ///< Standard sRGB
208 EXTENDED_SRGB, ///< Extended sRGB for HDR
209 HDR10_ST2084, ///< HDR10 PQ
210 DISPLAY_P3, ///< DCI-P3
211 };
212
213 /** @brief Default color space for new windows */
214 ColorSpace color_space = ColorSpace::SRGB_NONLINEAR;
215
216 /**
217 * @enum PresentMode
218 * @brief Frame presentation strategy
219 */
220 enum class PresentMode : uint8_t {
221 IMMEDIATE, ///< No vsync, tear possible
222 MAILBOX, ///< Triple buffering, no tear
223 FIFO, ///< Vsync, no tear
224 FIFO_RELAXED, ///< Vsync, tear if late
225 };
226
227 /** @brief Default presentation mode for new windows */
228 PresentMode present_mode = PresentMode::FIFO;
229
230 /** @brief Default number of swapchain images (double/triple buffering) */
231 uint32_t image_count = 3;
232
233 /** @brief Enable region-based processing by default */
234 bool enable_regions = true;
235
236 /** @brief Maximum regions per window container */
237 uint32_t max_regions_per_window = 256;
238
239 /** @brief Enable HDR output if available */
240 bool enable_hdr {};
241
242 /** @brief Measure and report actual frame times */
243 bool measure_frame_time {};
244
245 /** @brief Backend-specific configuration parameters */
246 std::unordered_map<std::string, std::any> backend_options;
247
248 static constexpr auto describe()
249 {
250 return std::make_tuple(
251 Reflect::member("format", &GraphicsSurfaceInfo::format),
252 Reflect::member("color_space", &GraphicsSurfaceInfo::color_space),
253 Reflect::member("present_mode", &GraphicsSurfaceInfo::present_mode),
254 Reflect::member("image_count", &GraphicsSurfaceInfo::image_count),
255 Reflect::member("enable_regions", &GraphicsSurfaceInfo::enable_regions),
256 Reflect::member("max_regions_per_window", &GraphicsSurfaceInfo::max_regions_per_window),
257 Reflect::member("enable_hdr", &GraphicsSurfaceInfo::enable_hdr),
258 Reflect::member("measure_frame_time", &GraphicsSurfaceInfo::measure_frame_time));
259 }
260};
261
262#ifdef MAYAFLUX_PLATFORM_MACOS
263
264/**
265 * @struct GlfwPreInitConfig
266 * @brief Configuration hints for GLFW initialization
267 *
268 * Set before initializing the GLFW library. These affect how GLFW sets up
269 * its internal state and platform integration.
270 */
271struct GlfwPreInitConfig {
272 bool cocoa_chdir_resources = true;
273 bool cocoa_menubar = true;
274
275 /** @brief Request OpenGL debug context (if using OpenGL backend) */
276 bool headless {};
277
278 static constexpr auto describe()
279 {
280 return std::make_tuple(
281 Reflect::member("cocoa_chdir_resources", &GlfwPreInitConfig::cocoa_chdir_resources),
282 Reflect::member("cocoa_menubar", &GlfwPreInitConfig::cocoa_menubar),
283 Reflect::member("headless", &GlfwPreInitConfig::headless));
284 }
285};
286#endif // MAYAFLUX_PLATFORM_MACOS
287
288/**
289 * @struct KeyRepeatConfig
290 * @brief Key repeat timing for native window backends.
291 *
292 * Wayland and Win32 backends implement client-side repeat using these values.
293 * GLFW backend ignores this; OS repeat settings apply there.
294 */
296 /** @brief Delay before repeat starts in milliseconds. */
297 uint32_t initial_delay_ms { 90 };
298
299 /** @brief Interval between repeat events in milliseconds. */
300 uint32_t interval_ms { 16 };
301
302 /** @brief If true, compositor-reported repeat_info overrides these values. */
304
305 static constexpr auto describe()
306 {
307 return std::make_tuple(
310 Reflect::member("allow_compositor_override", &KeyRepeatConfig::allow_compositor_override));
311 }
312};
313
314/**
315 * @struct TextConfig
316 * @brief Default font configuration for Portal::Text.
317 *
318 * When present, GraphicsSubsystem initializes Portal::Text and attempts to
319 * load the specified font as the system default. Users may call
320 * Portal::Text::set_default_font() at any time after initialization to
321 * replace or augment this.
322 *
323 * When absent, Portal::Text is still initialized but no default atlas is
324 * created; any call to InkPress that requires a default atlas will log an
325 * error until the user sets one explicitly.
326 */
328 /** @brief Font family name forwarded to Platform::find_font(). */
329 std::string family;
330
331 /** @brief Optional style hint (e.g. "Regular", "Bold"). */
332 std::string style;
333
334 /** @brief Glyph rasterization height in pixels. */
335 uint32_t pixel_size { 24 };
336
337 /** @brief Atlas texture dimension (power of two). */
338 uint32_t atlas_size { 512 };
339
340 static constexpr auto describe()
341 {
342 return std::make_tuple(
347 }
348};
349
350struct MAYAFLUX_API GlobalGraphicsConfig {
351#ifdef MAYAFLUX_PLATFORM_MACOS
352 /** @brief Pre-initialization configuration for GLFW */
353 GlfwPreInitConfig glfw_preinit_config;
354#endif // MAYAFLUX_PLATFORM_MACOS
355
356 /** @brief Key repeat timing for native Wayland and Win32 backends. */
358
359 /** @brief System-wide configuration for visual stream processing */
361
362 /** @brief Graphics backend configuration */
364
365 /** @brief Resource limits */
367
368 /**
369 * @enum WindowingBackend
370 * @brief Windowing library selection
371 */
372 enum class WindowingBackend : uint8_t {
373 GLFW, ///< GLFW3 (default, cross-platform)
374 WINDOWS, ///< Native Win32
375 WAYLAND, ///< Native Wayland
376 NONE ///< No windowing (offscreen rendering only)
377 };
378
379 /**
380 * @enum VisualApi
381 * @brief Supported graphics APIs (backend selection)
382 */
383 enum class GraphicsApi : uint8_t {
384 VULKAN,
385 OPENGL,
386 METAL,
387 DIRECTX12
388 };
389
390 /** @brief Target frame rate for visual processing (Hz) */
391 uint32_t target_frame_rate = 60;
392
393#if defined(MAYAFLUX_PLATFORM_WINDOWS)
394#ifndef WIN32_BACKEND
395#error "Windows builds require WIN32_BACKEND"
396#endif // WIN32_BACKEND
397 /** @brief Selected windowing backend */
398 WindowingBackend windowing_backend = WindowingBackend::WINDOWS;
399#elif defined(WAYLAND_BACKEND)
400 /** @brief Selected windowing backend */
401 WindowingBackend windowing_backend = WindowingBackend::WAYLAND;
402#else
403 /** @brief Selected windowing backend */
404 WindowingBackend windowing_backend = WindowingBackend::GLFW;
405#endif // defined(MAYAFLUX_PLATFORM_WINDOWS) && defined (WIN32_BACKEND)
406
407 /** @brief Selected graphics API for rendering */
408 GraphicsApi requested_api = GraphicsApi::VULKAN;
409
410 /** @brief Default font for Portal::Text. */
411 TextConfig text_config {
412#if defined(MAYAFLUX_PLATFORM_LINUX)
413 "sans-serif", "", 24, 512
414#elif defined(MAYAFLUX_PLATFORM_MACOS)
415 "Helvetica Neue", "", 24, 512
416#elif defined(MAYAFLUX_PLATFORM_WINDOWS)
417 "Segoe UI", "", 24, 512
418#else
419 "sans-serif", "", 24, 512
420#endif
421 };
422
423#ifdef MAYAFLUX_PLATFORM_MACOS
424 static constexpr auto describe()
425 {
426 return std::make_tuple(
427 Reflect::member("glfw_preinit_config", &GlobalGraphicsConfig::glfw_preinit_config),
428 Reflect::member("key_repeat_config", &GlobalGraphicsConfig::key_repeat_config),
429 Reflect::member("surface_info", &GlobalGraphicsConfig::surface_info),
430 Reflect::member("backend_info", &GlobalGraphicsConfig::backend_info),
431 Reflect::member("resource_limits", &GlobalGraphicsConfig::resource_limits),
432 Reflect::member("target_frame_rate", &GlobalGraphicsConfig::target_frame_rate),
433 Reflect::member("windowing_backend", &GlobalGraphicsConfig::windowing_backend),
434 Reflect::member("requested_api", &GlobalGraphicsConfig::requested_api),
435 Reflect::member("text_config", &GlobalGraphicsConfig::text_config));
436 }
437#else
438 static constexpr auto describe()
439 {
440 return std::make_tuple(
441 Reflect::member("key_repeat_config", &GlobalGraphicsConfig::key_repeat_config),
442 Reflect::member("surface_info", &GlobalGraphicsConfig::surface_info),
443 Reflect::member("backend_info", &GlobalGraphicsConfig::backend_info),
444 Reflect::member("resource_limits", &GlobalGraphicsConfig::resource_limits),
445 Reflect::member("target_frame_rate", &GlobalGraphicsConfig::target_frame_rate),
446 Reflect::member("windowing_backend", &GlobalGraphicsConfig::windowing_backend),
447 Reflect::member("requested_api", &GlobalGraphicsConfig::requested_api),
448 Reflect::member("text_config", &GlobalGraphicsConfig::text_config));
449 }
450
451#endif // #ifdef MAYAFLUX_PLATFORM_MACOS
452};
453
454//==============================================================================
455// PER-WINDOW CREATION INFO (Parallel to audio ChannelConfig)
456//==============================================================================
457
458/**
459 * @struct WindowCreateInfo
460 * @brief Configuration for creating a single window instance
461 *
462 * Lightweight per-window parameters. Most settings inherited from
463 * GraphicsSurfaceInfo. This is like creating a new audio channel - you specify
464 * only what differs from global defaults.
465 */
466struct MAYAFLUX_API WindowCreateInfo {
467 /** @brief Window title/identifier */
468 std::string title { "MayaFlux Window" };
469
470 /** @brief Initial window dimensions */
471 uint32_t width { 1920 };
472 uint32_t height { 1080 };
473
474 /** @brief Target monitor ID (-1 = primary monitor) */
475 int32_t monitor_id { -1 };
476
477 /** @brief Start in fullscreen mode */
478 bool fullscreen {};
479
480 /** @brief Window can be resized by user */
481 bool resizable { true };
482
483 /** @brief Show OS window decorations (title bar, borders) */
484 bool decorated { true };
485
486 /** @brief Transparent framebuffer (compositing) */
487 bool transparent {};
488
489 /** @brief Window always on top */
490 bool floating {};
491
492 /** @brief Register this window for processing (if false, no grpahics API handles visuals) */
493 bool register_for_processing { true };
494
495 /** @brief Override global surface format (nullopt = use global default) */
496 std::optional<GraphicsSurfaceInfo::SurfaceFormat> surface_format;
497
498 /** @brief Override global present mode (nullopt = use global default) */
499 std::optional<GraphicsSurfaceInfo::PresentMode> present_mode;
500
501 /** @brief Container dimensions (channels) */
502 struct {
503 uint32_t color_channels { 4 };
504 bool has_depth {};
505 bool has_stencil {};
506 } container_format;
507
508 std::array<float, 4> clear_color { { 0.0F, 0.0F, 0.0F, 1.0F } };
509};
510
511//==============================================================================
512// WINDOW RUNTIME STATE (Read-only, updated by subsystem)
513//==============================================================================
514
515/**
516 * @struct WindowState
517 * @brief Runtime state of a window (mutable by system, read by user)
518 *
519 * You don't set these - the windowing subsystem updates them as events occur.
520 */
522 uint32_t current_width = 0;
523 uint32_t current_height = 0;
524
525 bool is_visible = true;
526 bool is_focused = false;
527 bool is_minimized = false;
528 bool is_maximized = false;
529 bool is_hovered = false;
530
531 uint64_t frame_count = 0;
532 double last_present_time = 0.0;
533 double average_frame_time = 0.0;
534};
535
536//==============================================================================
537// INPUT CONFIGURATION (Runtime mutable)
538//==============================================================================
539
540/**
541 * @enum CursorMode
542 * @brief Cursor visibility and behavior
543 */
544enum class CursorMode : uint8_t {
545 NORMAL, ///< Visible and movable
546 HIDDEN, ///< Invisible but movable
547 DISABLED, ///< Invisible and locked (FPS camera)
548 CAPTURED, ///< Invisible, locked, raw motion
549};
550
551/**
552 * @struct InputConfig
553 * @brief Input configuration for a window
554 *
555 * Can be changed at runtime via window->set_input_config()
556 */
566
567//==============================================================================
568// WINDOW EVENTS
569//==============================================================================
570
571/**
572 * @enum WindowEventType
573 * @brief Types of window and input events
574 */
602
603/**
604 * @struct WindowEvent
605 * @brief Event data for window and input events
606 */
609 double timestamp;
610
611 struct ResizeData {
612 uint32_t width, height;
613 };
614 struct KeyData {
615 int16_t key;
616 int32_t scancode, mods;
617 };
619 double x, y;
620 };
622 int8_t button;
623 int32_t mods;
624 };
625 struct ScrollData {
627 };
628
629 using EventData = std::variant<
630 std::monostate,
632 KeyData,
636 std::any>;
637
639
640 WindowEvent() = default;
641 WindowEvent(const WindowEvent&) = default;
642 WindowEvent(WindowEvent&&) noexcept = default;
643 WindowEvent& operator=(const WindowEvent&) = default;
644 WindowEvent& operator=(WindowEvent&&) noexcept = default;
645 ~WindowEvent() = default;
646};
647
648using WindowEventCallback = std::function<void(const WindowEvent&)>;
649
650//==============================================================================
651// MONITOR INFORMATION (System query, not per-window config)
652//==============================================================================
653
654/**
655 * @struct VideoMode
656 * @brief Monitor video mode
657 */
658struct VideoMode {
659 uint32_t width, height;
660 uint32_t refresh_rate;
661 uint8_t red_bits, green_bits, blue_bits;
662
663 bool operator==(const VideoMode& other) const
664 {
665 return width == other.width && height == other.height && refresh_rate == other.refresh_rate;
666 }
667};
668
669/**
670 * @struct MonitorInfo
671 * @brief Information about a physical display
672 */
674 int32_t id;
675 std::string name;
676 int32_t width_mm, height_mm;
678 bool is_primary = false;
679};
680
681} // namespace MayaFlux::Core
uint32_t width
uint32_t height
CursorMode
Cursor visibility and behavior.
@ DISABLED
Invisible and locked (FPS camera)
@ NORMAL
Visible and movable.
@ CAPTURED
Invisible, locked, raw motion.
@ HIDDEN
Invisible but movable.
WindowEventType
Types of window and input events.
std::function< void(const WindowEvent &)> WindowEventCallback
constexpr auto member(std::string_view key, T Class::*ptr)
Definition Mirror.hpp:37
GraphicsSurfaceInfo surface_info
System-wide configuration for visual stream processing.
WindowingBackend
Windowing library selection.
GraphicsResourceLimits resource_limits
Resource limits.
GraphicsBackendInfo backend_info
Graphics backend configuration.
KeyRepeatConfig key_repeat_config
Key repeat timing for native Wayland and Win32 backends.
std::vector< std::string > required_extensions
Backend-specific extensions to request.
MemoryStrategy
Memory allocation strategy.
DevicePreference
Preferred physical device class when no explicit selector matches.
std::vector< std::string > optional_extensions
std::string device_name
Case-insensitive substring of the device name; empty disables.
CommandPooling
Command buffer pooling strategy.
ShaderCompilation
Shader compilation strategy.
std::string device_uuid
Device UUID as 32 lowercase hex chars, no separators; empty disables.
Configuration for graphics API backend (Vulkan/OpenGL/etc.)
Resource limits and budgets for graphics subsystem.
ColorSpace
Default color space for window surfaces.
SurfaceFormat
Default pixel format for window surfaces (Vulkan-compatible)
PresentMode
Frame presentation strategy.
std::unordered_map< std::string, std::any > backend_options
Backend-specific configuration parameters.
System-wide configuration for visual stream processing.
Input configuration for a window.
uint32_t interval_ms
Interval between repeat events in milliseconds.
uint32_t initial_delay_ms
Delay before repeat starts in milliseconds.
bool allow_compositor_override
If true, compositor-reported repeat_info overrides these values.
Key repeat timing for native window backends.
Information about a physical display.
std::string style
Optional style hint (e.g.
static constexpr auto describe()
uint32_t atlas_size
Atlas texture dimension (power of two).
uint32_t pixel_size
Glyph rasterization height in pixels.
std::string family
Font family name forwarded to Platform::find_font().
Default font configuration for Portal::Text.
bool operator==(const VideoMode &other) const
std::optional< GraphicsSurfaceInfo::PresentMode > present_mode
Override global present mode (nullopt = use global default)
std::optional< GraphicsSurfaceInfo::SurfaceFormat > surface_format
Override global surface format (nullopt = use global default)
Configuration for creating a single window instance.
std::variant< std::monostate, ResizeData, KeyData, MousePosData, MouseButtonData, ScrollData, std::any > EventData
WindowEvent(const WindowEvent &)=default
WindowEvent(WindowEvent &&) noexcept=default
Event data for window and input events.
Runtime state of a window (mutable by system, read by user)