瀏覽代碼

gdextension: Sync with upstream commit 46c495ca21f40f57a7fb9c7cde6143738f1652d4 (4.5-beta1)

David Snopek 2 月之前
父節點
當前提交
61f52cb328
共有 2 個文件被更改,包括 291 次插入137 次删除
  1. 264 137
      gdextension/extension_api.json
  2. 27 0
      gdextension/gdextension_interface.h

文件差異過大導致無法顯示
+ 264 - 137
gdextension/extension_api.json


+ 27 - 0
gdextension/gdextension_interface.h

@@ -805,6 +805,21 @@ typedef struct {
 	const char *string; // (e.g. "Godot v3.1.4.stable.official.mono")
 } GDExtensionGodotVersion2;
 
+/* Called when starting the main loop. */
+typedef void (*GDExtensionMainLoopStartupCallback)();
+
+/* Called when shutting down the main loop. */
+typedef void (*GDExtensionMainLoopShutdownCallback)();
+
+/* Called for every frame iteration of the main loop. */
+typedef void (*GDExtensionMainLoopFrameCallback)();
+
+typedef struct {
+	GDExtensionMainLoopStartupCallback startup_func;
+	GDExtensionMainLoopShutdownCallback shutdown_func;
+	GDExtensionMainLoopFrameCallback frame_func;
+} GDExtensionMainLoopCallbacks;
+
 /**
  * @name get_godot_version
  * @since 4.1
@@ -2386,6 +2401,7 @@ typedef GDExtensionVariantPtr (*GDExtensionInterfaceArrayOperatorIndexConst)(GDE
 /**
  * @name array_ref
  * @since 4.1
+ * @deprecated in Godot 4.5. use `Array::operator=` instead.
  *
  * Sets an Array to be a reference to another Array object.
  *
@@ -3131,6 +3147,17 @@ typedef void (*GDExtensionsInterfaceEditorHelpLoadXmlFromUtf8CharsAndLen)(const
  */
 typedef void (*GDExtensionInterfaceEditorRegisterGetClassesUsedCallback)(GDExtensionClassLibraryPtr p_library, GDExtensionEditorGetClassesUsedCallback p_callback);
 
+/**
+ * @name register_main_loop_callbacks
+ * @since 4.5
+ *
+ * Registers callbacks to be called at different phases of the main loop.
+ *
+ * @param p_library A pointer the library received by the GDExtension's entry point function.
+ * @param p_callback A pointer to the structure that contains the callbacks.
+ */
+typedef void (*GDExtensionInterfaceRegisterMainLoopCallbacks)(GDExtensionClassLibraryPtr p_library, const GDExtensionMainLoopCallbacks *p_callbacks);
+
 #ifdef __cplusplus
 }
 #endif

部分文件因文件數量過多而無法顯示