Skip to content

Commit b3e54c4

Browse files
committed
Update for GDExtension interface changes in Godot 4.5
1 parent 5cbffab commit b3e54c4

File tree

4 files changed

+3146
-6
lines changed

4 files changed

+3146
-6
lines changed

gdextension/gdextension_interface.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,21 @@ typedef struct {
805805
const char *string; // (e.g. "Godot v3.1.4.stable.official.mono")
806806
} GDExtensionGodotVersion2;
807807

808+
/* Called when starting the main loop. */
809+
typedef void (*GDExtensionMainLoopStartupCallback)();
810+
811+
/* Called when shutting down the main loop. */
812+
typedef void (*GDExtensionMainLoopShutdownCallback)();
813+
814+
/* Called for every frame iteration of the main loop. */
815+
typedef void (*GDExtensionMainLoopFrameCallback)();
816+
817+
typedef struct {
818+
GDExtensionMainLoopStartupCallback startup_func;
819+
GDExtensionMainLoopShutdownCallback shutdown_func;
820+
GDExtensionMainLoopFrameCallback frame_func;
821+
} GDExtensionMainLoopCallbacks;
822+
808823
/**
809824
* @name get_godot_version
810825
* @since 4.1
@@ -2386,6 +2401,7 @@ typedef GDExtensionVariantPtr (*GDExtensionInterfaceArrayOperatorIndexConst)(GDE
23862401
/**
23872402
* @name array_ref
23882403
* @since 4.1
2404+
* @deprecated in Godot 4.5. use `Array::operator=` instead.
23892405
*
23902406
* Sets an Array to be a reference to another Array object.
23912407
*
@@ -3131,6 +3147,17 @@ typedef void (*GDExtensionsInterfaceEditorHelpLoadXmlFromUtf8CharsAndLen)(const
31313147
*/
31323148
typedef void (*GDExtensionInterfaceEditorRegisterGetClassesUsedCallback)(GDExtensionClassLibraryPtr p_library, GDExtensionEditorGetClassesUsedCallback p_callback);
31333149

3150+
/**
3151+
* @name register_main_loop_callbacks
3152+
* @since 4.5
3153+
*
3154+
* Registers callbacks to be called at different phases of the main loop.
3155+
*
3156+
* @param p_library A pointer the library received by the GDExtension's entry point function.
3157+
* @param p_callback A pointer to the structure that contains the callbacks.
3158+
*/
3159+
typedef void (*GDExtensionInterfaceRegisterMainLoopCallbacks)(GDExtensionClassLibraryPtr p_library, const GDExtensionMainLoopCallbacks *p_callbacks);
3160+
31343161
#ifdef __cplusplus
31353162
}
31363163
#endif

0 commit comments

Comments
 (0)