mirror of
https://github.com/godotengine/godot-cpp-template.git
synced 2026-01-08 06:09:44 +03:00
5eb763fff710d4e46d7303bb9a7a6217770a7617
Change project version to 4.1
godot-cpp template
This repository serves as a quickstart template for GDExtension development with Godot 4.0+.
Contents
- An empty Godot project (
demo/) - godot-cpp as a submodule (
godot-cpp/) - GitHub Issues template (
.github/ISSUE_TEMPLATE.yml) - GitHub CI/CD to publish your library packages when creating a release (
.github/workflows/builds.yml) - preconfigured source files for C++ development of the GDExtension (
src/)
Usage
To use this template, click the green "Use this template" button at the top of the repository page. This will let you create a copy of this repository with a clean git history. Make sure you clone the correct branch as these are configured for development of their respective Godot development branches and differ from each other. Refer to the docs to see what changed between the versions.
For getting started after cloning your own copy to your local machine, you should
- change the name of the compiled library file inside the
SConstructfile by modifying thelibnamestring. - change the name of the to be loaded library name inside the
.gdextensionfile. This should be the same name as in yourSConstructfile. - change the
entry_symbolstring inside your.gdextensionfile to be configured for your GDExtension name. This should be the same as theGDExtensionBool GDE_EXPORTexternal C function. As the name suggests, this sets the entry function for your GDExtension to be loaded by the Godot editors C API. - register the classes you want Godot to interact with inside the
register_types.cppfile in the initialization method (hereinitialize_gdextension_types) in the syntaxClassDB::register_class<CLASS-NAME>();.
Description
Languages
Python
41.2%
CMake
35.8%
C++
20.9%
C
2.1%