Skip to content

ludus::platform::NativeWindowInfo

Ludus Wiki · API overview · Browse API

Struct

Borrowed handles. The platform window must outlive its RHI connection.

Declared in modules/platform/include/ludus/platform/native_window.h

#include <ludus/platform/native_window.h>
struct ludus::platform::NativeWindowInfo final

Fields

System

WindowSystem ludus::platform::NativeWindowInfo::System = WindowSystem::Headless

Related types: WindowSystem

Declared in modules/platform/include/ludus/platform/native_window.h

Display

::wl_display* ludus::platform::NativeWindowInfo::Display = nullptr

Declared in modules/platform/include/ludus/platform/native_window.h

Surface

::wl_surface* ludus::platform::NativeWindowInfo::Surface = nullptr

Declared in modules/platform/include/ludus/platform/native_window.h

Width

ludus::foundation::uint32 ludus::platform::NativeWindowInfo::Width = 800

Related types: ludus::foundation::uint32

Declared in modules/platform/include/ludus/platform/native_window.h

Height

ludus::foundation::uint32 ludus::platform::NativeWindowInfo::Height = 600

Related types: ludus::foundation::uint32

Declared in modules/platform/include/ludus/platform/native_window.h

CanvasSelector

const char* ludus::platform::NativeWindowInfo::CanvasSelector = nullptr
WebCanvas: borrowed selector owned by the platform window.
The matching DOM canvas and window must both outlive the RHI connection. Keep the selector identifying that same canvas until window destruction. No GPU handle.

Declared in modules/platform/include/ludus/platform/native_window.h

CocoaWindow

void* ludus::platform::NativeWindowInfo::CocoaWindow = nullptr
Borrowed NSWindow on macOS; nullptr for other backends or a closed window. Access only on the main thread while the owning Ludus window remains alive.

Declared in modules/platform/include/ludus/platform/native_window.h

CocoaView

void* ludus::platform::NativeWindowInfo::CocoaView = nullptr
Borrowed NSView for attaching the Metal presentation layer; no GPU object is created here. Main-thread access only; lifetime matches CocoaWindow. Cocoa Width/Height are backing pixels.

Declared in modules/platform/include/ludus/platform/native_window.h

Win32WindowOrNull

void* ludus::platform::NativeWindowInfo::Win32WindowOrNull = nullptr
Borrowed HWND of a Win32 window; nullptr for other backends or a closed window.
Use it only on the thread that created and pumps the owning Ludus window, while that window remains alive. No GPU object is created here.

Declared in modules/platform/include/ludus/platform/native_window.h

Scale

ludus::foundation::float32 ludus::platform::NativeWindowInfo::Scale = 1.0F
Backing pixels per logical point.
Hosted windows publish the scale their host sent with each resize, and Win32 windows publish their monitor DPI over 96. Other native backends do not observe a scale yet and publish 1.

Related types: ludus::foundation::float32

Declared in modules/platform/include/ludus/platform/native_window.h

HostedSurfaceOrNull

HostedSurfaceChannel* ludus::platform::NativeWindowInfo::HostedSurfaceOrNull = nullptr
Hosted only: the window's surface channel, borrowed from the hosted window.
Valid while that window lives; null for every other backend. RHI publishes its hosted images and frames through it. Use it on the thread that pumps the window.

Related types: HostedSurfaceChannel

Declared in modules/platform/include/ludus/platform/native_window.h