HACK: empty main to force the compiler to add emulated TLS.
import godot, godot.node; class TestClass : GodotScript!Node { } mixin GodotNativeLibrary!( "testlib", TestClass, (GodotInitOptions o){ print("Initialized"); }, (GodotTerminateOptions o){ print("Terminated"); } );
This mixin will generate the GDNative C interface functions for this D library. Pass to it a name string for the library, followed by the GodotScript types to register, functions to call, and other options to configure Godot-D.
The symbolPrefix must match the GDNativeLibrary's symbolPrefix in Godot.
D runtime will be initialized and terminated, unless you pass LoadDRuntime.no or compile with BetterC.
Functions taking GodotInitOptions or no arguments will be called at init. Functions taking GodotTerminateOptions will be called at termination.