Skip to content

Commit 56185e5

Browse files
authored
Merge pull request #27 from Spartan322/4.4-cherry-pick-add/redot-version
Add GDExtensionInterfaceGetRedotVersion
2 parents a114d67 + 5b7ebe8 commit 56185e5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

gdextension/gdextension_interface.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,19 @@ typedef struct {
792792
const char *string;
793793
} GDExtensionGodotVersion;
794794

795+
typedef struct {
796+
uint32_t major;
797+
uint32_t minor;
798+
uint32_t patch;
799+
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)
800+
const char *status; // (e.g. "stable", "beta", "rc")
801+
uint32_t status_version;
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. "Redot v3.1.4.stable.official.mono")
806+
} GDExtensionRedotVersion;
807+
795808
/**
796809
* @name get_godot_version
797810
* @since 4.1
@@ -802,6 +815,16 @@ typedef struct {
802815
*/
803816
typedef void (*GDExtensionInterfaceGetGodotVersion)(GDExtensionGodotVersion *r_godot_version);
804817

818+
/**
819+
* @name get_redot_version
820+
* @since 4.3
821+
*
822+
* Gets the Redot version that the GDExtension was loaded into.
823+
*
824+
* @param r_redot_version A pointer to the structure to write the version information into.
825+
*/
826+
typedef void (*GDExtensionInterfaceGetRedotVersion)(GDExtensionRedotVersion *r_redot_version);
827+
805828
/* INTERFACE: Memory */
806829

807830
/**

0 commit comments

Comments
 (0)