Skip to content

Engine → Platform

backend.h

Which implementation sits behind a platform::window: the real GLFW 3.4 window or the virtual null window used by every headless test and server build.

Enumerations

backend_kind

enum class backend_kind : u8 {
    NULL_BACKEND = 0,   // virtual window: no OS calls, events queued by tests
    GLFW = 1,           // real OS window through GLFW 3.4 (CONJURE_PLATFORM_GLFW)
    COUNT
};

Functions

Public

default_backend_kind

[[nodiscard]] CONJURE_API backend_kind default_backend_kind() noexcept;

GLFW when compiled, otherwise NULL_BACKEND.

is_backend_compiled

[[nodiscard]] CONJURE_API bool is_backend_compiled(
    backend_kind kind) noexcept;

True when the backend was compiled into this library. The null backend always is; the glfw backend only when CONJURE_PLATFORM_GLFW was ON.

parse_backend_kind

[[nodiscard]] CONJURE_API core::result<backend_kind> parse_backend_kind(
    std::string_view name) noexcept;

Parses a backend name case-insensitively ("null", "glfw"). Any other name fails with platform_error::UNKNOWN_BACKEND.

to_string

[[nodiscard]] CONJURE_API std::string_view to_string(
    backend_kind kind) noexcept;

The configuration name of a backend: "null" or "glfw"; "" for unknown values.