GodotNativeLibrary

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.

Members

Functions

deinitializeLevel
void deinitializeLevel(void* userdata, GDNativeInitializationLevel level)
Undocumented in source. Be warned that the author may not have intended to support it.
initializeLevel
void initializeLevel(void* userdata, GDNativeInitializationLevel level)
Undocumented in source. Be warned that the author may not have intended to support it.
main
void main()

HACK: empty main to force the compiler to add emulated TLS.

Mixins

__anonymous
mixin SimpleDllMain
Undocumented in source.

Static functions

godot_gdextension_entry
GDNativeBool godot_gdextension_entry(GDNativeInterface* p_interface, GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization* r_initialization)

This is the main entry point declared in your .gdextension file, it will be called by godot engine on load

register_types
void register_types(void* userdata, GDNativeInitializationLevel level)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_GODOT_projectInfo
enum godotutil.classes.ProjectInfo _GODOT_projectInfo;
Undocumented in source.
_GODOT_projectInfo
enum godotutil.classes.ProjectInfo _GODOT_projectInfo;
Undocumented in source.

Examples

import godot, godot.node;
class TestClass : GodotScript!Node
{ }
mixin GodotNativeLibrary!(
	"testlib",
	TestClass,
	(GodotInitOptions o){ print("Initialized"); },
	(GodotTerminateOptions o){ print("Terminated"); }
);

Meta