Skip to content

Platform (Visera.Platform)

Platform provides OS-specific abstraction and implementation: window creation and management, file system path and access, and dynamic library (DLL/dylib) loading and symbol resolution. The implementation is selected by build target (Windows or Apple); for cross-platform or headless use, GLFW (window + Device keyboard/mouse) and Null (no window, no file system, stub device) are available at the same level as Windows/MacOS.

Overview

  • Module: Visera.Platform
  • Source path: Engine/Platform/Source/
  • Dependencies: Depends on Core (Path, Text, Optional, Containers, Meta); does not depend on Runtime.
  • Build: Engine/Platform/CMake/install.cmake configures the Platform target for Windows or Apple only; other host OS values fail configuration. On those hosts, GLFW and Null module sources are still globbed in and linked so you can choose GLFW- or Null-based windowing and devices at runtime or via your app’s platform selection, alongside the native Windows/macOS implementations.

Platform exposes unified type names (e.g. FPlatformWindow, FPlatformPath, FPlatformFileSystem) that map to Windows/MacOS concrete types so that upper layers (e.g. Runtime.Window) only need to depend on the Platform interface for cross-platform builds.

Submodules

Module Description
Interface Platform-agnostic abstract API: window, path, file system, dynamic library; implemented by each backend.
GLFW Cross-platform: window, Device (keyboard, mouse), event loop, file system.
Null Headless/stub: no window, no file system (GetFileSystem() returns nullptr), empty device enums.
Windows Windows: window, path, file system, DLL loading; Device re-exports GLFW key/mouse types.
MacOS MacOS: window, path, file system, dylib loading; Device re-exports GLFW key/mouse types.

Difference from Core.OS

  • Core.OS: Platform-agnostic file I/O (e.g. FFile, FFileSystem::OpenFile), memory, thread, time; based on std or generic APIs.
  • Platform: OS-specific path format conversion, window handles, and dynamic library loading, tied to Win32/Cocoa/GLFW. Use both together: e.g. resolve path with Platform, then open file with Core.OS.FileSystem.

See also