This repository contains C headers for Godot Engine's GDExtension API.
GDExtension enables the use of dynamically linked libraries inside of Godot.
Important
Starting with Godot 4.6, gdextension_interface.h can also be generated by the engine together with the *.jsons.
You can add the commands in § Updating Headers to your build system (Python SCons, C/Make, Ruby Rake, etc.).
This repository is now pending deprecation, and will be deprecated once libgodot.h is also Engine-generatable.
This repositories follows the same branch versioning as the main Godot Engine repository:
mastertracks the current release branch. As this is a moving target, the headers in this repository may not always be fully in sync with upstream. See Updating Headers if you need to bring them up to date.4.xtracks the release of the next 4.x minor release. Likemaster, it might not always be fully up-to-date with upstream.- Other versioned branches (e.g.,
4.0) track the latest stable release in the corresponding branch.
Stable releases are also tagged on this repository: Tags
Projects built against a stable release of Godot may use this repository as a Git submodule, checking out the specific tag matching your Godot version.
This library is meant to be used in conjunction with a code generator that creates the binding code necessary to interact with Godot. This library only provides access to the API over which communication with the Godot core is implemented and binding metadata in the form of a JSON document.
One such binding library is
godotengine/godot-cpp
which implements the bindings using C++.
An official pure C sample project is currently not available.
See Versioning for details on the Godot versions tracked by each branch of this repository.
If the relevant branch is not up-to-date for your needs, or if you want to sync the headers with your own modified version of Godot, here is the update procedure used to sync this repository with upstream releases:
- Download or Compile Godot Engine for your specific version
- Use the executable to generate files:
$ godot --dump-gdextension-interface # gdextension_interface.h $ godot --dump-gdextension-interface-json # gdextension_interface.json (4.6+) $ godot --dump-extension-api-with-docs && mv extension_api.json extension_api_with_docs.json # Command Prompt: move (4.2+) $ godot --dump-extension-api # extension_api.json
- Copy the file
core/extension/libgodot.h