Quickstart template for GDExtension development with Godot
 
 
 
 
 
Go to file
Fabio Alessandrelli ac1499baf4 Fix library copy command
Use InstallAs with the correct target/source order instead of Command.
2023-11-27 21:02:25 +01:00
.github Fix GitHub issue template not being parsed as form 2023-10-05 14:52:30 +02:00
.vscode Add vscode extension suggestions and ignore the rest 2023-08-17 08:31:03 -04:00
bin Copy generated library to the projectdir 2023-10-16 16:35:06 -04:00
demo Copy generated library to the projectdir 2023-10-16 16:35:06 -04:00
godot-cpp@1009da4d7e Initial commit 2023-08-08 01:43:32 +02:00
src Add class registration comment hint for main branch 2023-08-26 19:59:37 +02:00
.clang-format Add Godot project .clang-format file 2023-10-08 13:50:37 -04:00
.gitattributes Initial commit 2023-08-08 01:43:32 +02:00
.gitignore Copy generated library to the projectdir 2023-10-16 16:35:06 -04:00
.gitmodules Initial commit 2023-08-08 01:43:32 +02:00
LICENSE.md Initial commit 2023-08-08 01:43:32 +02:00
README.md Add/Clarify README instructions in main branch 2023-08-26 20:10:19 +02:00
SConstruct Fix library copy command 2023-11-27 21:02:25 +01:00

README.md

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, log in to github and 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 your library
    • change the name of the compiled library file inside the SConstruct file by modifying the libname string.
    • change the pathnames of the to be loaded library name inside the demo/bin/example.gdextension file. By replacing libgdexample to the name specified in your SConstruct file.
    • change the name of the demo/bin/example.gdextension file
  • change the entry_symbol string inside your demo/bin/your-extension.gdextension file to be configured for your GDExtension name. This should be the same as the GDExtensionBool GDE_EXPORT external 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.cpp file in the initialization method (here initialize_gdextension_types) in the syntax ClassDB::register_class<CLASS-NAME>();.