High level GDNative
Single header GDNative high level API for C/C++
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
NativeScript helpers

Definitions that help registering classes in Godot, focusing on wrapping C structs. More...

Data Structures

struct  hgdn_property_info
 
struct  hgdn_method_argument_info
 
struct  hgdn_method_info
 
struct  hgdn_signal_argument_info
 
struct  hgdn_signal_info
 
struct  hgdn_class_info
 

Macros

#define hgdn_properties(...)   ((hgdn_property_info[]){ __VA_ARGS__, {} })
 Helper for a literal NULL-terminated array of hgdn_property_info
 
#define hgdn_methods(...)   ((hgdn_method_info[]){ __VA_ARGS__, {} })
 Helper for a literal NULL-terminated array of hgdn_method_info
 
#define hgdn_method_arguments(...)   ((hgdn_method_argument_info[]){ __VA_ARGS__, {} })
 Helper for a literal NULL-terminated array of hgdn_method_argument_info
 
#define hgdn_signals(...)   ((hgdn_signal_info[]){ __VA_ARGS__, {} })
 Helper for a literal NULL-terminated array of hgdn_signal_info
 
#define hgdn_signal_arguments(...)   ((hgdn_signal_argument_info[]){ __VA_ARGS__, {} })
 Helper for a literal NULL-terminated array of hgdn_signal_argument_info
 
#define hgdn_instance_create_func_alloc(ctype)   ((const godot_instance_create_func){ &hgdn_instance_alloc, (void *) sizeof(ctype) })
 Create a godot_instance_create_func that allocates a zero-initialized ctype
 
#define hgdn_instance_destroy_func_free()   ((const godot_instance_destroy_func){ &hgdn_instance_free })
 Create a godot_instance_destroy_func that frees instance data.
 
#define hgdn_property_constant(value)   ((const godot_property_get_func){ &hgdn_property_constant_get, (void *) hgdn_property_constant_alloc(hgdn_new_variant((value))), &hgdn_property_constant_free })
 

Functions

HGDN_DECL void hgdn_register_class (void *gdnative_handle, const hgdn_class_info *class_info)
 
HGDN_DECL void * hgdn_instance_alloc (godot_object *instance, void *alloc_size)
 Function that allocates and returns zero-initialized alloc_size bytes, to be used as instance create function.
 
HGDN_DECL void hgdn_instance_free (godot_object *instance, void *method_data, void *data)
 Function that frees data with hgdn_free, to be used as instance destroy function.
 
HGDN_DECL godot_variant * hgdn_property_constant_alloc (godot_variant value)
 
HGDN_DECL void hgdn_property_constant_free (void *value)
 
HGDN_DECL godot_variant hgdn_property_constant_get (godot_object *instance, void *value, void *data)
 

Detailed Description

Macro Definition Documentation

◆ hgdn_property_constant

#define hgdn_property_constant (   value)    ((const godot_property_get_func){ &hgdn_property_constant_get, (void *) hgdn_property_constant_alloc(hgdn_new_variant((value))), &hgdn_property_constant_free })
Note
In C++ and C11 the value passed is transformed by hgdn_new_variant, so primitive C data can be passed directly