Home -> PlatformBindings

Description

The PlatformBindings.pkg header provides the platform-specific pieces that are deliberately kept out of the core renderer interfaces. These pieces describe native window systems, native windows, SDL3 integration helpers, and renderer plugin loading helpers.

The core renderer APIs accept base structures such as IRenderer.WindowSystemInfoBase and IFrameBuffer.WindowInfoBase. The concrete structures documented in this section fill those base structures for Win32, Xlib, XCB, Wayland, AppKit, SDL3, and headless operation.

ImportantImportant

If COBALT_RENDERER_MANUAL_PLATFORM_BINDINGS is not defined, PlatformBindings.pkg auto-selects bindings for the current platform. Windows enables Win32 bindings, Linux enables Wayland, XCB, and Xlib bindings, and macOS enables AppKit bindings.

ImportantImportant

Headless window system and framebuffer window information structures are included on all platforms. They are used when rendering without a native operating system window or presentation surface.

ImportantImportant

SDL3 helpers are enabled only when COBALT_RENDERER_SDL3_SUPPORT is defined. Automatic SDL3 detection is performed when COBALT_RENDERER_NO_SDL_DETECTION is not defined and <SDL3/SDL.h> is available.

WarningWarning

The RenderPluginEnumerator helper is included by PlatformBindings.pkg only for C++17 or newer builds, because it uses std::filesystem.

Platform selection macros

Usage

#include <Cobalt/RendererInterface/PlatformBindings.pkg>

Types

Renderer Plugins

Name Description
Public Interface IRendererPlugin
Interface filled by renderer plugins to describe an available renderer implementation before it is wrapped by a RendererPlugin.
Public Class RendererPlugin
Strong owning renderer plugin object used by applications and plugin loading helpers.
Public Class RenderPluginEnumerator
Helper for finding renderer plugin libraries, reading renderer plugin records, and selecting a preferred plugin.
Public Interface IModuleHandle
Reference-counted module handle interface used to keep renderer plugin libraries loaded.
Public Class ModuleHandleWin32
Windows module handle implementation used to keep renderer plugin DLLs loaded.
Public Class ModuleHandlePosix
POSIX module handle implementation used to keep renderer plugin shared libraries loaded.

Window System Info

Name Description
Public Struct WindowSystemInfoHeadless
Window system information for renderer initialization with no native window system.
Public Struct WindowSystemInfoWin32
Window system information for Win32 renderer initialization.
Public Struct WindowSystemInfoXlib
Window system information for Xlib renderer initialization.
Public Struct WindowSystemInfoXCB
Window system information for XCB renderer initialization.
Public Struct WindowSystemInfoWayland
Window system information for Wayland renderer initialization.
Public Struct WindowSystemInfoAppKit
Window system information for AppKit renderer initialization on macOS.

Window Info

Name Description
Public Struct WindowInfoHeadless
Window-sized framebuffer binding information for headless rendering.
Public Struct WindowInfoWin32
Native Win32 window information for framebuffer window binding.
Public Struct WindowInfoXlib
Native Xlib window information for framebuffer window binding.
Public Struct X11Constants
Wrapped constants for selected X11 macro values retained by the Xlib wrapper header.
Public Struct WindowInfoXCB
Native XCB window information for framebuffer window binding.
Public Struct WindowInfoWayland
Native Wayland window information for framebuffer window binding.
Public Struct WindowInfoAppKit
Native AppKit view information for framebuffer window binding on macOS.

SDL3 Helpers

Name Description
Public Class WindowSystemInfoSDL3
SDL3 helper that builds the appropriate renderer window system information structure.
Public Class WindowInfoSDL3
SDL3 helper that builds the appropriate framebuffer window information structure.

Functions

Renderer Plugins

Name Description
Public member GetCobaltAPIVersion
Renderer plugin export used to check Cobalt Renderer API compatibility before renderer plugin records are queried.
Public member GetRendererPlugin
Renderer plugin export used to retrieve a renderer plugin record from a loaded plugin library.

SDL3 Helpers

Name Description
Public member CobaltSDLCreateWindow
Creates an SDL3 window configured for use with Cobalt-managed graphics contexts.

See also