Skip to content

ludus::runtime::game_host

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

Enumerations

GameplaySource

enum class GameplaySource : uint32
How the host obtains the gameplay implementation.
The same game source has one implementation; selecting static dispatch replaces only the module lookup (design 2). A shipping build links the module statically; a dev/editor build loads an immutable module generation by path.

Related types: uint32

DynamicModule

DynamicModule = 0

Static

Static = 1

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

Presentation

enum class Presentation : uint32
How the host presents frames.
A real windowed session drives the platform window + RHI; a headless session runs the full lifecycle without a surface so loader/reload/property behavior is testable where no GPU/display exists. A headless session is NOT proof of rendered-window behavior (requirement L15).

Related types: uint32

Windowed

Windowed = 0

Headless

Headless = 1

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

RunResult

enum class RunResult : int32
Terminal reason a host run loop ended.
Distinct from any module-returned status: a crash/hang is handled by the supervisor, not reported here.

Related types: int32

Ok

Ok = 0

BadArguments

BadArguments = 1

ModuleLoadFailed

ModuleLoadFailed = 2

IncompatibleModule

IncompatibleModule = 3

WindowUnavailable

WindowUnavailable = 4

RenderingUnavailable

RenderingUnavailable = 5

ProtocolError

ProtocolError = 6

Internal

Internal = 7

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

Aliases

StaticEntryFn

using ludus::runtime::game_host::StaticEntryFn = game_api::GetGameApiFn
Entry signature of a statically linked gameplay implementation.
A shipping build passes its in-process LudusGetGameApi here; selecting static dispatch replaces only the module lookup (design 2) — the same host run loop drives it.

Related types: game_api::GetGameApiFn

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

int32

using ludus::foundation::core::int32 = std::int32_t
Exact 32-bit signed integer for explicit-width values.

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

uint32

using ludus::foundation::core::uint32 = std::uint32_t
Exact 32-bit unsigned integer for explicit-width values.

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

uint64

using ludus::foundation::core::uint64 = std::uint64_t
Exact 64-bit unsigned integer for explicit-width values.

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

Functions

Run

RunResult ludus::runtime::game_host::Run(const HostConfig &config) noexcept
Run one host session to completion.
Owns engine init/shutdown, window + RHI (for Windowed), the gameplay module lifecycle and, when a ControlFd is set, the play protocol loop. On Windows, dynamic module runs return ModuleLoadFailed.

Related types: RunResult · HostConfig

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

RunMain

int32 ludus::runtime::game_host::RunMain(int32 argc, const char *const *argv, StaticEntryFn entry=nullptr) noexcept
Shared executable entry.
Native argv/cwd remain owned by the process; selecting a static entry changes only gameplay lookup, never frame behavior.

Related types: int32 · StaticEntryFn

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

RunStatic

RunResult ludus::runtime::game_host::RunStatic(const HostConfig &config, StaticEntryFn entry) noexcept
Run one host session against a statically linked gameplay implementation.
No dlopen, no module path, no reload (a shipping build does not hot reload). entry is the project's LudusGetGameApi reinterpreted to StaticEntryFn. Windows sessions require standalone operation (ControlFd = -1 and AwaitLoad = false). A control channel request on Windows returns ProtocolError before invoking entry.

Related types: RunResult · StaticEntryFn · HostConfig

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

InspectModule

RunResult ludus::runtime::game_host::InspectModule(std::string_view path, game_api::GameMetadata &metadata) noexcept
Explicit metadata probe in a separate host process; validates the ABI and SDK identity without creating an instance or starting a graphics session. Returns ModuleLoadFailed and preserves metadata on Windows.

Related types: RunResult · game_api::GameMetadata

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

HostIdentity

std::string_view ludus::runtime::game_host::HostIdentity() noexcept
The host's own ABI identity string (the compatibility key it stamps and compares against a module's embedded identity).
Exposed for the host executable to report in Hello and for acceptance tooling.

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

HostAbiMajor

uint32 ludus::runtime::game_host::HostAbiMajor() noexcept

Related types: uint32

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h

HostAbiMinor

uint32 ludus::runtime::game_host::HostAbiMinor() noexcept

Related types: uint32

Declared in modules/runtime/game_host/include/ludus/runtime/game_host/host.h