UXPlatform
UXPlatform hands an application the driver for the backend its build links.
With it, main() has no platform-aware line:
#import "UXPlatform.xc"
void main(void) { UXApplication* app = new UXApplication(); app.setDriver(UXPlatform.driver()); app.setDelegate(new Controller()); app.run();}Overview
Section titled “Overview”The backend follows the target where the target decides it: win64 is Win32,
wasm32 the web, arm9 GEM, ios-sim and ios iOS, android Android. Otherwise
the build names it with -D UX_GTK or -D UX_GEM (GEM on a host). With
neither, an arm64 build is the Mac’s AppKit and an x86_64 build is GTK on Linux.
Only the driver the build uses is imported.
A build script may differ per platform, in its link flags, its shims and these
defines. The .xc source does not.
Topics
Section titled “Topics”driver
Section titled “driver”static UXViewDriver* driver(void)A new driver for the backend this build links, for
UXApplication.setDriver.
static u8* name(void)The backend’s name for a log line: "appkit", "gtk", "win32", "web",
"ios", "android" or "gem".
See also
Section titled “See also”UXApplication:setDriver,setHeadless,run,stopUXViewDriver: the protocol every driver implements