SDK 6.3/C++/Native API

From WowWiki
Revision as of 09:47, 26 July 2026 by WowBot (talk | contribs) (Split C++ Native API into per-module pages with minimal examples (WowBot))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Official WOWCube SDK documentation. SDK 6.3, C++ (WebAssembly) API. Signatures are extracted from the canonical SDK headers shipped with the WOWCube Development Kit; the headers remain authoritative.

SDK 6.3 · PAWN API: Core · Graphics · Topology · Sound · Motion Sensor · Leaderboard · Splash Screen · Physics · Network · Save · Scramble · Logging
C++: Native API · Application · GFX Engine  ·  Rust: Rust API (experimental)  ·  Changelog


SDK 6.3 · C++ / Native API

The low-level C ABI available to C/C++ (and Rust) cubeapps, declared in native.h. These are the same engine functions as the PAWN API — descriptions of shared functions below are taken from the official SDK reference. On top of this layer the SDK provides the object-oriented Application framework and the GFX Engine.

Types and data structures

Defined in native.h / native_defines.h:

typedef uint32_t u32_t;   typedef int32_t i32_t;
typedef int32_t soundID_t; typedef int32_t spriteID_t;
union AppVersion_t { uint32_t full; struct { uint16_t patch:16; uint8_t minor:4; uint8_t major:4; uint8_t reserved:8; }; };
struct TOPOLOGY_faceletInfo_t { int32_t module; int32_t screen; int32_t connected; };
struct TOPOLOGY_place_t      { int32_t face; int32_t position; };
struct TOPOLOGY_twistInfo_t  { int32_t screen; int32_t count; int32_t direction; };
struct LB_info_t   { int32_t boardCount; int32_t selfPosition; int32_t selfScore; int32_t wholeUserListCount; };
struct GFX_Particle_t { ttl, vx, vy, ax, ay, explosion, velocity, duration, frequency, max, loop, time };

Enumerations: TOPOLOGY_twist_t (LEFT/RIGHT/DOUBLE), TOPOLOGY_orientation_mode_t (MENU/GRAVITY/SPLASH), TOPOLOGY_orientation_t (UP/DOWN/FRONT/BACK/LEFT/RIGHT), TOPOLOGY_neighbor_t (SELF/LEFT/DIAGONAL/TOP/RIGHT/BOTTOM), text_align_t (9 values), GFX_mirror_t (BLANK/X/Y/XY), GFX_PixelFormat_t (RGB565/ARGB6666/ARGB8888), eventMask_t, LogLevel_t, uartID_t. Constant: NET_BROADCAST = 0xFF; global cubeN — the index of the module the code is running on.

Modules

  • Core — 14 functions. Application-level services: time, RNG, inter-module packets, BLE data, persistent state, user info, versioning and logging.
  • Topology — 10 functions. Cube geometry: facelets, faces, places, orientation and twist events.
  • Leaderboard — 2 functions. Scores and rankings synced via the companion app.
  • Motion Sensors — 6 functions. Per-display accelerometer and gyroscope readings.
  • Graphics — 26 functions. Immediate-mode drawing on the module's displays: primitives, images, text, shaders, QR codes and render targets. (The retained alternative is the GFX Engine.)
  • Sound — 6 functions. Sound asset playback and caching.