hyperion::platform#

hyperion::platform is a foundational C++ library for cross-platform projects, providing several common features to detect, work around, or abstract away the differences between various platforms and toolchains, such as operating system detection macros, CPU architecture detection macros, compiler and library feature detection macros, and bounds-checked numeric literals.

hyperion::platform is also a core library of the Hyperion game engine project. As such, it also provides an _optional_ feature specific to its usage in that and related projects, namely frame profiling support backed by Tracy. This is disabled by default (see the Quick Start Guide and the documentation for more on to enable it).

See the Quick Start Guide for how to get started using hyperion::platform.

For an overview of each module, see the links in the left sidebar or below.

Example#
 1#include <hyperion/platform.h>
 2#include <hyperion/platform/types.h>
 3
 4using hyperion::operator""_i32;
 5
 6static constexpr auto the_meaning_of_life = 42_i32;
 7
 8#if HYPERION_PLATFORM_IS_ARCHITECTURE(HYPERION_PLATFORM_ARCHITECTURE_ARM_V8)
 9    // do something for ARM
10#elif HYPERION_PLATFORM_IS_ARCHITECTURE(HYPERION_PLATFORM_ARCHITECTURE_X86_64)
11    // do something for x86_64
12#else
13    // do something else
14#endif

Getting Started

Quick Reference

Platform and Feature Detection Macros

Utility Macros