|
34 | 34 | * Together with the JSON file, you should be able to generate any binder.
|
35 | 35 | */
|
36 | 36 |
|
| 37 | +#ifndef __cplusplus |
37 | 38 | #include <stddef.h>
|
38 | 39 | #include <stdint.h>
|
39 | 40 |
|
40 |
| -#ifndef __cplusplus |
41 | 41 | typedef uint32_t char32_t;
|
42 | 42 | typedef uint16_t char16_t;
|
43 |
| -#endif |
| 43 | +#else |
| 44 | +#include <cstddef> |
| 45 | +#include <cstdint> |
44 | 46 |
|
45 |
| -#ifdef __cplusplus |
46 | 47 | extern "C" {
|
47 | 48 | #endif
|
48 | 49 |
|
@@ -792,16 +793,39 @@ typedef struct {
|
792 | 793 | const char *string;
|
793 | 794 | } GDExtensionGodotVersion;
|
794 | 795 |
|
| 796 | +typedef struct { |
| 797 | + uint32_t major; |
| 798 | + uint32_t minor; |
| 799 | + uint32_t patch; |
| 800 | + uint32_t hex; // Full version encoded as hexadecimal with one byte (2 hex digits) per number (e.g. for "3.1.12" it would be 0x03010C) |
| 801 | + const char *status; // (e.g. "stable", "beta", "rc1", "rc2") |
| 802 | + const char *build; // (e.g. "custom_build") |
| 803 | + const char *hash; // Full Git commit hash. |
| 804 | + uint64_t timestamp; // Git commit date UNIX timestamp in seconds, or 0 if unavailable. |
| 805 | + const char *string; // (e.g. "Godot v3.1.4.stable.official.mono") |
| 806 | +} GDExtensionGodotVersion2; |
| 807 | + |
795 | 808 | /**
|
796 | 809 | * @name get_godot_version
|
797 | 810 | * @since 4.1
|
| 811 | + * @deprecated in Godot 4.5. Use `get_godot_version2` instead. |
798 | 812 | *
|
799 | 813 | * Gets the Godot version that the GDExtension was loaded into.
|
800 | 814 | *
|
801 | 815 | * @param r_godot_version A pointer to the structure to write the version information into.
|
802 | 816 | */
|
803 | 817 | typedef void (*GDExtensionInterfaceGetGodotVersion)(GDExtensionGodotVersion *r_godot_version);
|
804 | 818 |
|
| 819 | +/** |
| 820 | + * @name get_godot_version2 |
| 821 | + * @since 4.5 |
| 822 | + * |
| 823 | + * Gets the Godot version that the GDExtension was loaded into. |
| 824 | + * |
| 825 | + * @param r_godot_version A pointer to the structure to write the version information into. |
| 826 | + */ |
| 827 | +typedef void (*GDExtensionInterfaceGetGodotVersion2)(GDExtensionGodotVersion2 *r_godot_version); |
| 828 | + |
805 | 829 | /* INTERFACE: Memory */
|
806 | 830 |
|
807 | 831 | /**
|
@@ -2723,6 +2747,17 @@ typedef void (*GDExtensionInterfacePlaceHolderScriptInstanceUpdate)(GDExtensionS
|
2723 | 2747 | */
|
2724 | 2748 | typedef GDExtensionScriptInstanceDataPtr (*GDExtensionInterfaceObjectGetScriptInstance)(GDExtensionConstObjectPtr p_object, GDExtensionObjectPtr p_language);
|
2725 | 2749 |
|
| 2750 | +/** |
| 2751 | + * @name object_set_script_instance |
| 2752 | + * @since 4.5 |
| 2753 | + * |
| 2754 | + * Set the script instance data attached to this object. |
| 2755 | + * |
| 2756 | + * @param p_object A pointer to the Object. |
| 2757 | + * @param p_script_instance A pointer to the script instance data to attach to this object. |
| 2758 | + */ |
| 2759 | +typedef void (*GDExtensionInterfaceObjectSetScriptInstance)(GDExtensionObjectPtr p_object, GDExtensionScriptInstanceDataPtr p_script_instance); |
| 2760 | + |
2726 | 2761 | /* INTERFACE: Callable */
|
2727 | 2762 |
|
2728 | 2763 | /**
|
@@ -3086,7 +3121,7 @@ typedef void (*GDExtensionsInterfaceEditorHelpLoadXmlFromUtf8CharsAndLen)(const
|
3086 | 3121 | *
|
3087 | 3122 | * Registers a callback that Godot can call to get the list of all classes (from ClassDB) that may be used by the calling GDExtension.
|
3088 | 3123 | *
|
3089 |
| - * This is used by the editor to generate a build profiles (in "Tools" > "Engine Compilation Configuration Editor..." > "Detect from project"), |
| 3124 | + * This is used by the editor to generate a build profile (in "Tools" > "Engine Compilation Configuration Editor..." > "Detect from project"), |
3090 | 3125 | * in order to recompile Godot with only the classes used.
|
3091 | 3126 | * In the provided callback, the GDExtension should provide the list of classes that _may_ be used statically, thus the time of invocation shouldn't matter.
|
3092 | 3127 | * If a GDExtension doesn't register a callback, Godot will assume that it could be using any classes.
|
|
0 commit comments