Skip to content

PlatformCapabilities

Namespace: pixelroot32::platforms

A structure that holds detected hardware capabilities, used to optimize task pinning and threading.

Members

  • bool hasDualCore True if the hardware has more than one CPU core.

  • int coreCount Total number of CPU cores detected.

  • int audioCoreId Recommended CPU core for audio tasks.

  • int mainCoreId Recommended CPU core for the main game loop.

  • int audioPriority Recommended priority for audio tasks.

Static Methods

  • static PlatformCapabilities detect() Automatically detects hardware capabilities based on the platform and configuration. It respects the defaults defined in platforms/PlatformDefaults.h and any compile-time overrides.

Debug Statistics Overlay

When the engine is built with the preprocessor define PIXELROOT32_ENABLE_DEBUG_OVERLAY, the engine draws a technical overlay with real-time metrics.

  • Metrics Included:
  • FPS: Frames per second (green).
  • RAM: Memory used in KB (cyan). ESP32 specific.
  • CPU: Estimated processor load percentage based on frame processing time (yellow).

  • Behavior: The metrics are drawn in the top-right area of the screen, fixed and independent of the camera.

  • Performance: Values are recalculated and formatted only every 16 frames (DEBUG_UPDATE_INTERVAL); the cached strings are drawn every frame. This ensures minimal overhead while providing useful development data.

  • Usage: Add to your build flags, e.g. in platformio.ini:
    build_flags = -D PIXELROOT32_ENABLE_DEBUG_OVERLAY
    This flag is also available in EngineConfig.h.