diff options
Diffstat (limited to 'modules/gdnative/include')
-rw-r--r-- | modules/gdnative/include/arvr/godot_arvr.h (renamed from modules/gdnative/include/nativearvr/godot_nativearvr.h) | 5 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/array.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/basis.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/dictionary.h | 2 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/gdnative.h | 4 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/pool_arrays.h | 124 | ||||
-rw-r--r-- | modules/gdnative/include/gdnative/string.h | 1 |
7 files changed, 135 insertions, 5 deletions
diff --git a/modules/gdnative/include/nativearvr/godot_nativearvr.h b/modules/gdnative/include/arvr/godot_arvr.h index 1a8970d396..be13ac954b 100644 --- a/modules/gdnative/include/nativearvr/godot_nativearvr.h +++ b/modules/gdnative/include/arvr/godot_arvr.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* godot_nativearvr.h */ +/* godot_arvr.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -47,7 +47,7 @@ typedef struct { godot_bool (*is_initialized)(const void *); godot_bool (*initialize)(void *); void (*uninitialize)(void *); - godot_vector2 (*get_recommended_render_targetsize)(const void *); + godot_vector2 (*get_render_targetsize)(const void *); godot_transform (*get_transform_for_eye)(void *, godot_int, godot_transform *); void (*fill_projection_for_eye)(void *, godot_real *, godot_int, godot_real, godot_real, godot_real); void (*commit_for_eye)(void *, godot_int, godot_rid *, godot_rect2 *); @@ -70,6 +70,7 @@ void GDAPI godot_arvr_remove_controller(godot_int p_controller_id); void GDAPI godot_arvr_set_controller_transform(godot_int p_controller_id, godot_transform *p_transform, godot_bool p_tracks_orientation, godot_bool p_tracks_position); void GDAPI godot_arvr_set_controller_button(godot_int p_controller_id, godot_int p_button, godot_bool p_is_pressed); void GDAPI godot_arvr_set_controller_axis(godot_int p_controller_id, godot_int p_axis, godot_real p_value, godot_bool p_can_be_negative); +godot_real GDAPI godot_arvr_get_controller_rumble(godot_int p_controller_id); #ifdef __cplusplus } diff --git a/modules/gdnative/include/gdnative/array.h b/modules/gdnative/include/gdnative/array.h index d0639589b7..01ae61e280 100644 --- a/modules/gdnative/include/gdnative/array.h +++ b/modules/gdnative/include/gdnative/array.h @@ -76,6 +76,8 @@ godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx); +const godot_variant GDAPI *godot_array_operator_index_const(const godot_array *p_self, const godot_int p_idx); + void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value); void GDAPI godot_array_clear(godot_array *p_self); diff --git a/modules/gdnative/include/gdnative/basis.h b/modules/gdnative/include/gdnative/basis.h index b86b1c17d8..49ca765a01 100644 --- a/modules/gdnative/include/gdnative/basis.h +++ b/modules/gdnative/include/gdnative/basis.h @@ -97,7 +97,7 @@ void GDAPI godot_basis_new(godot_basis *r_dest); void GDAPI godot_basis_new_with_euler_quat(godot_basis *r_dest, const godot_quat *p_euler); // p_elements is a pointer to an array of 3 (!!) vector3 -void GDAPI godot_basis_get_elements(godot_basis *p_self, godot_vector3 *p_elements); +void GDAPI godot_basis_get_elements(const godot_basis *p_self, godot_vector3 *p_elements); godot_vector3 GDAPI godot_basis_get_axis(const godot_basis *p_self, const godot_int p_axis); diff --git a/modules/gdnative/include/gdnative/dictionary.h b/modules/gdnative/include/gdnative/dictionary.h index e68d0fdc29..6d1f436921 100644 --- a/modules/gdnative/include/gdnative/dictionary.h +++ b/modules/gdnative/include/gdnative/dictionary.h @@ -85,6 +85,8 @@ void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key); +const godot_variant GDAPI *godot_dictionary_operator_index_const(const godot_dictionary *p_self, const godot_variant *p_key); + godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key); godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b); diff --git a/modules/gdnative/include/gdnative/gdnative.h b/modules/gdnative/include/gdnative/gdnative.h index 25d45db306..a479eced16 100644 --- a/modules/gdnative/include/gdnative/gdnative.h +++ b/modules/gdnative/include/gdnative/gdnative.h @@ -53,7 +53,7 @@ extern "C" { // This is for libraries *using* the header, NOT GODOT EXPOSING STUFF!! #ifdef _WIN32 -#define GDN_EXPORT __declspec(dllexport) +#define GDN_EXPORT #else #define GDN_EXPORT #endif @@ -237,7 +237,7 @@ typedef struct { uint64_t editor_api_hash; uint64_t no_api_hash; godot_object *gd_native_library; // pointer to GDNativeLibrary that is being initialized - const struct godot_gdnative_api_struct *api_struct; + const struct godot_gdnative_core_api_struct *api_struct; const godot_string *active_library_path; } godot_gdnative_init_options; diff --git a/modules/gdnative/include/gdnative/pool_arrays.h b/modules/gdnative/include/gdnative/pool_arrays.h index 93181f2a6b..81500c9186 100644 --- a/modules/gdnative/include/gdnative/pool_arrays.h +++ b/modules/gdnative/include/gdnative/pool_arrays.h @@ -36,6 +36,38 @@ extern "C" { #include <stdint.h> +/////// Read Access + +#define GODOT_POOL_ARRAY_READ_ACCESS_SIZE 1 + +typedef struct { + uint8_t _dont_touch_that[GODOT_POOL_ARRAY_READ_ACCESS_SIZE]; +} godot_pool_array_read_access; + +typedef godot_pool_array_read_access godot_pool_byte_array_read_access; +typedef godot_pool_array_read_access godot_pool_int_array_read_access; +typedef godot_pool_array_read_access godot_pool_real_array_read_access; +typedef godot_pool_array_read_access godot_pool_string_array_read_access; +typedef godot_pool_array_read_access godot_pool_vector2_array_read_access; +typedef godot_pool_array_read_access godot_pool_vector3_array_read_access; +typedef godot_pool_array_read_access godot_pool_color_array_read_access; + +/////// Write Access + +#define GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE 1 + +typedef struct { + uint8_t _dont_touch_that[GODOT_POOL_ARRAY_WRITE_ACCESS_SIZE]; +} godot_pool_array_write_access; + +typedef godot_pool_array_write_access godot_pool_byte_array_write_access; +typedef godot_pool_array_write_access godot_pool_int_array_write_access; +typedef godot_pool_array_write_access godot_pool_real_array_write_access; +typedef godot_pool_array_write_access godot_pool_string_array_write_access; +typedef godot_pool_array_write_access godot_pool_vector2_array_write_access; +typedef godot_pool_array_write_access godot_pool_vector3_array_write_access; +typedef godot_pool_array_write_access godot_pool_color_array_write_access; + /////// PoolByteArray #define GODOT_POOL_BYTE_ARRAY_SIZE sizeof(void *) @@ -149,6 +181,10 @@ void GDAPI godot_pool_byte_array_remove(godot_pool_byte_array *p_self, const god void GDAPI godot_pool_byte_array_resize(godot_pool_byte_array *p_self, const godot_int p_size); +godot_pool_byte_array_read_access GDAPI *godot_pool_byte_array_read(const godot_pool_byte_array *p_self); + +godot_pool_byte_array_write_access GDAPI *godot_pool_byte_array_write(godot_pool_byte_array *p_self); + void GDAPI godot_pool_byte_array_set(godot_pool_byte_array *p_self, const godot_int p_idx, const uint8_t p_data); uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_self, const godot_int p_idx); @@ -176,6 +212,10 @@ void GDAPI godot_pool_int_array_remove(godot_pool_int_array *p_self, const godot void GDAPI godot_pool_int_array_resize(godot_pool_int_array *p_self, const godot_int p_size); +godot_pool_int_array_read_access GDAPI *godot_pool_int_array_read(const godot_pool_int_array *p_self); + +godot_pool_int_array_write_access GDAPI *godot_pool_int_array_write(godot_pool_int_array *p_self); + void GDAPI godot_pool_int_array_set(godot_pool_int_array *p_self, const godot_int p_idx, const godot_int p_data); godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_self, const godot_int p_idx); @@ -203,6 +243,10 @@ void GDAPI godot_pool_real_array_remove(godot_pool_real_array *p_self, const god void GDAPI godot_pool_real_array_resize(godot_pool_real_array *p_self, const godot_int p_size); +godot_pool_real_array_read_access GDAPI *godot_pool_real_array_read(const godot_pool_real_array *p_self); + +godot_pool_real_array_write_access GDAPI *godot_pool_real_array_write(godot_pool_real_array *p_self); + void GDAPI godot_pool_real_array_set(godot_pool_real_array *p_self, const godot_int p_idx, const godot_real p_data); godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_self, const godot_int p_idx); @@ -230,6 +274,10 @@ void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_self, const void GDAPI godot_pool_string_array_resize(godot_pool_string_array *p_self, const godot_int p_size); +godot_pool_string_array_read_access GDAPI *godot_pool_string_array_read(const godot_pool_string_array *p_self); + +godot_pool_string_array_write_access GDAPI *godot_pool_string_array_write(godot_pool_string_array *p_self); + void GDAPI godot_pool_string_array_set(godot_pool_string_array *p_self, const godot_int p_idx, const godot_string *p_data); godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_self, const godot_int p_idx); @@ -257,6 +305,10 @@ void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_self, con void GDAPI godot_pool_vector2_array_resize(godot_pool_vector2_array *p_self, const godot_int p_size); +godot_pool_vector2_array_read_access GDAPI *godot_pool_vector2_array_read(const godot_pool_vector2_array *p_self); + +godot_pool_vector2_array_write_access GDAPI *godot_pool_vector2_array_write(godot_pool_vector2_array *p_self); + void GDAPI godot_pool_vector2_array_set(godot_pool_vector2_array *p_self, const godot_int p_idx, const godot_vector2 *p_data); godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_self, const godot_int p_idx); @@ -284,6 +336,10 @@ void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_self, con void GDAPI godot_pool_vector3_array_resize(godot_pool_vector3_array *p_self, const godot_int p_size); +godot_pool_vector3_array_read_access GDAPI *godot_pool_vector3_array_read(const godot_pool_vector3_array *p_self); + +godot_pool_vector3_array_write_access GDAPI *godot_pool_vector3_array_write(godot_pool_vector3_array *p_self); + void GDAPI godot_pool_vector3_array_set(godot_pool_vector3_array *p_self, const godot_int p_idx, const godot_vector3 *p_data); godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_self, const godot_int p_idx); @@ -311,6 +367,10 @@ void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_self, const g void GDAPI godot_pool_color_array_resize(godot_pool_color_array *p_self, const godot_int p_size); +godot_pool_color_array_read_access GDAPI *godot_pool_color_array_read(const godot_pool_color_array *p_self); + +godot_pool_color_array_write_access GDAPI *godot_pool_color_array_write(godot_pool_color_array *p_self); + void GDAPI godot_pool_color_array_set(godot_pool_color_array *p_self, const godot_int p_idx, const godot_color *p_data); godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_self, const godot_int p_idx); @@ -318,6 +378,70 @@ godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_self void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self); +// +// read accessor functions +// + +const uint8_t GDAPI *godot_pool_byte_array_read_access_ptr(const godot_pool_byte_array_read_access *p_read); +void GDAPI godot_pool_byte_array_read_access_operator_assign(godot_pool_byte_array_read_access *p_read, godot_pool_byte_array_read_access *p_other); +void GDAPI godot_pool_byte_array_read_access_destroy(godot_pool_byte_array_read_access *p_read); + +const godot_int GDAPI *godot_pool_int_array_read_access_ptr(const godot_pool_int_array_read_access *p_read); +void GDAPI godot_pool_int_array_read_access_operator_assign(godot_pool_int_array_read_access *p_read, godot_pool_int_array_read_access *p_other); +void GDAPI godot_pool_int_array_read_access_destroy(godot_pool_int_array_read_access *p_read); + +const godot_real GDAPI *godot_pool_real_array_read_access_ptr(const godot_pool_real_array_read_access *p_read); +void GDAPI godot_pool_real_array_read_access_operator_assign(godot_pool_real_array_read_access *p_read, godot_pool_real_array_read_access *p_other); +void GDAPI godot_pool_real_array_read_access_destroy(godot_pool_real_array_read_access *p_read); + +const godot_string GDAPI *godot_pool_string_array_read_access_ptr(const godot_pool_string_array_read_access *p_read); +void GDAPI godot_pool_string_array_read_access_operator_assign(godot_pool_string_array_read_access *p_read, godot_pool_string_array_read_access *p_other); +void GDAPI godot_pool_string_array_read_access_destroy(godot_pool_string_array_read_access *p_read); + +const godot_vector2 GDAPI *godot_pool_vector2_array_read_access_ptr(const godot_pool_vector2_array_read_access *p_read); +void GDAPI godot_pool_vector2_array_read_access_operator_assign(godot_pool_vector2_array_read_access *p_read, godot_pool_vector2_array_read_access *p_other); +void GDAPI godot_pool_vector2_array_read_access_destroy(godot_pool_vector2_array_read_access *p_read); + +const godot_vector3 GDAPI *godot_pool_vector3_array_read_access_ptr(const godot_pool_vector3_array_read_access *p_read); +void GDAPI godot_pool_vector3_array_read_access_operator_assign(godot_pool_vector3_array_read_access *p_read, godot_pool_vector3_array_read_access *p_other); +void GDAPI godot_pool_vector3_array_read_access_destroy(godot_pool_vector3_array_read_access *p_read); + +const godot_color GDAPI *godot_pool_color_array_read_access_ptr(const godot_pool_color_array_read_access *p_read); +void GDAPI godot_pool_color_array_read_access_operator_assign(godot_pool_color_array_read_access *p_read, godot_pool_color_array_read_access *p_other); +void GDAPI godot_pool_color_array_read_access_destroy(godot_pool_color_array_read_access *p_read); + +// +// write accessor functions +// + +uint8_t GDAPI *godot_pool_byte_array_write_access_ptr(const godot_pool_byte_array_write_access *p_write); +void GDAPI godot_pool_byte_array_write_access_operator_assign(godot_pool_byte_array_write_access *p_write, godot_pool_byte_array_write_access *p_other); +void GDAPI godot_pool_byte_array_write_access_destroy(godot_pool_byte_array_write_access *p_write); + +godot_int GDAPI *godot_pool_int_array_write_access_ptr(const godot_pool_int_array_write_access *p_write); +void GDAPI godot_pool_int_array_write_access_operator_assign(godot_pool_int_array_write_access *p_write, godot_pool_int_array_write_access *p_other); +void GDAPI godot_pool_int_array_write_access_destroy(godot_pool_int_array_write_access *p_write); + +godot_real GDAPI *godot_pool_real_array_write_access_ptr(const godot_pool_real_array_write_access *p_write); +void GDAPI godot_pool_real_array_write_access_operator_assign(godot_pool_real_array_write_access *p_write, godot_pool_real_array_write_access *p_other); +void GDAPI godot_pool_real_array_write_access_destroy(godot_pool_real_array_write_access *p_write); + +godot_string GDAPI *godot_pool_string_array_write_access_ptr(const godot_pool_string_array_write_access *p_write); +void GDAPI godot_pool_string_array_write_access_operator_assign(godot_pool_string_array_write_access *p_write, godot_pool_string_array_write_access *p_other); +void GDAPI godot_pool_string_array_write_access_destroy(godot_pool_string_array_write_access *p_write); + +godot_vector2 GDAPI *godot_pool_vector2_array_write_access_ptr(const godot_pool_vector2_array_write_access *p_write); +void GDAPI godot_pool_vector2_array_write_access_operator_assign(godot_pool_vector2_array_write_access *p_write, godot_pool_vector2_array_write_access *p_other); +void GDAPI godot_pool_vector2_array_write_access_destroy(godot_pool_vector2_array_write_access *p_write); + +godot_vector3 GDAPI *godot_pool_vector3_array_write_access_ptr(const godot_pool_vector3_array_write_access *p_write); +void GDAPI godot_pool_vector3_array_write_access_operator_assign(godot_pool_vector3_array_write_access *p_write, godot_pool_vector3_array_write_access *p_other); +void GDAPI godot_pool_vector3_array_write_access_destroy(godot_pool_vector3_array_write_access *p_write); + +godot_color GDAPI *godot_pool_color_array_write_access_ptr(const godot_pool_color_array_write_access *p_write); +void GDAPI godot_pool_color_array_write_access_operator_assign(godot_pool_color_array_write_access *p_write, godot_pool_color_array_write_access *p_other); +void GDAPI godot_pool_color_array_write_access_destroy(godot_pool_color_array_write_access *p_write); + #ifdef __cplusplus } #endif diff --git a/modules/gdnative/include/gdnative/string.h b/modules/gdnative/include/gdnative/string.h index f30fdb8dc7..29510313c9 100644 --- a/modules/gdnative/include/gdnative/string.h +++ b/modules/gdnative/include/gdnative/string.h @@ -66,6 +66,7 @@ void GDAPI godot_string_new_unicode_data(godot_string *r_dest, const wchar_t *p_ void GDAPI godot_string_get_data(const godot_string *p_self, char *p_dest, int *p_size); wchar_t GDAPI *godot_string_operator_index(godot_string *p_self, const godot_int p_idx); +wchar_t GDAPI godot_string_operator_index_const(const godot_string *p_self, const godot_int p_idx); const char GDAPI *godot_string_c_str(const godot_string *p_self); const wchar_t GDAPI *godot_string_unicode_str(const godot_string *p_self); |