Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

什麼是 GDExtension?

GDExtension is a Godot-specific technology that lets the engine interact with native shared libraries at runtime. You can use it to run native code without compiling it with the engine.

要達成這點主要有三種方式:

  • gdextension_interface.h:一組 C 函式,供 Godot 與 GDExtension 彼此溝通使用。

  • extension_api.json:由 Godot API(核心功能)對外提供的一系列 C 函式清單。

  • *.gdextension:Godot 讀取以載入 GDExtension 的檔案格式。

多數人會使用既有的語言綁定來建立 GDExtension,例如 godot-cpp(C++),或是 社群製作的綁定

版本相容性

請參閱 godot-cpp 版本相容性,該內容同樣適用於所有 GDExtension。