High level GDNative
Single header GDNative high level API for C/C++
Loading...
Searching...
No Matches
Macros | Functions
Pool*Array/Array creation

Helper functions to create Pool*Array/Array objects from sized buffers. More...

Macros

#define hgdn_new_byte_array_args(...)   (hgdn_new_byte_array((const uint8_t[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_int_array_args(...)   (hgdn_new_int_array((const godot_int[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_real_array_args(...)   (hgdn_new_real_array((const godot_real[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_vector2_array_args(...)   (hgdn_new_vector2_array((const godot_vector2[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_vector3_array_args(...)   (hgdn_new_vector3_array((const godot_vector3[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_color_array_args(...)   (hgdn_new_color_array((const godot_color[]){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_string_array_args(...)   (hgdn_new_string_array((const char *const []){ __VA_ARGS__ }, HGDN__NARG(__VA_ARGS__)))
 
#define hgdn_new_array_args(...)   (hgdn_new_array_own((godot_variant[]){ HGDN__MAP(hgdn_new_variant, __VA_ARGS__) }, HGDN__NARG(__VA_ARGS__)))
 

Functions

HGDN_DECL godot_pool_byte_array hgdn_new_byte_array (const uint8_t *buffer, const godot_int size)
 
HGDN_DECL godot_pool_int_array hgdn_new_int_array (const godot_int *buffer, const godot_int size)
 
HGDN_DECL godot_pool_real_array hgdn_new_real_array (const godot_real *buffer, const godot_int size)
 
HGDN_DECL godot_pool_vector2_array hgdn_new_vector2_array (const godot_vector2 *buffer, const godot_int size)
 
HGDN_DECL godot_pool_vector3_array hgdn_new_vector3_array (const godot_vector3 *buffer, const godot_int size)
 
HGDN_DECL godot_pool_color_array hgdn_new_color_array (const godot_color *buffer, const godot_int size)
 
HGDN_DECL godot_pool_string_array hgdn_new_string_array (const char *const *buffer, const godot_int size)
 
HGDN_DECL godot_array hgdn_new_array (const godot_variant *const *buffer, const godot_int size)
 
HGDN_DECL godot_array hgdn_new_array_own (godot_variant *buffer, const godot_int size)
 

Detailed Description

The *_args variadic functions/macros construct a temporary array and call the functions. On C++11 they are implemented using templates with parameter pack.

Macro Definition Documentation

◆ hgdn_new_array_args

#define hgdn_new_array_args (   ...)    (hgdn_new_array_own((godot_variant[]){ HGDN__MAP(hgdn_new_variant, __VA_ARGS__) }, HGDN__NARG(__VA_ARGS__)))
Note
In C++ and C11 the arguments passed are transformed by hgdn_new_variant, so primitive C data can be passed directly

Function Documentation

◆ hgdn_new_array_own()

HGDN_DECL godot_array hgdn_new_array_own ( godot_variant *  buffer,
const godot_int  size 
)
Note
Variants in buffer will be destroyed, convenient if you create Variants only for constructing the Array

◆ hgdn_new_string_array()

HGDN_DECL godot_pool_string_array hgdn_new_string_array ( const char *const *  buffer,
const godot_int  size 
)
Note
All strings must be NULL terminated.