Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
.godot/

# Ignore library files but not the gdextension file
demo/bin/*
!demo/bin/android
demo/bin/android/*
!demo/bin/android/.gitkeep
!demo/bin/linux
demo/bin/linux/*
!demo/bin/linux/.gitkeep
!demo/bin/macos
demo/bin/macos/*
!demo/bin/macos/.gitkeep
!demo/bin/windows
demo/bin/windows/*
!demo/bin/windows/.gitkeep
!demo/bin/*.gdextension
project/bin/*
!project/bin/android
project/bin/android/*
!project/bin/android/.gitkeep
!project/bin/linux
project/bin/linux/*
!project/bin/linux/.gitkeep
!project/bin/macos
project/bin/macos/*
!project/bin/macos/.gitkeep
!project/bin/windows
project/bin/windows/*
!project/bin/windows/.gitkeep
!project/bin/*.gdextension
.sconsign*.dblite

# Ignore custom.py
Expand Down Expand Up @@ -59,4 +59,4 @@ compile_commands.json

# Cmake
cmake-build*
CMakeUserPresets.json
CMakeUserPresets.json
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(CMAKE_C_COMPILER)
endif()

set(LIBNAME "EXTENSION-NAME" CACHE STRING "The name of the library")
set(GODOT_PROJECT_DIR "demo" CACHE STRING "The directory of a Godot project folder")
set(GODOT_PROJECT_DIR "project" CACHE STRING "The directory of a Godot project folder")

# Make sure all the dependencies are satisfied
find_package(Python3 3.4 REQUIRED)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This repository serves as a quickstart template for GDExtension development with

## Contents
* Preconfigured source files for C++ development of the GDExtension ([src/](./src/))
* An empty Godot project in [demo/](./demo), to test the GDExtension
* An empty Godot project in [project/](./project), to test the GDExtension
* godot-cpp as a submodule (`godot-cpp/`)
* GitHub Issues template ([.github/ISSUE_TEMPLATE.yml](./.github/ISSUE_TEMPLATE.yml))
* GitHub CI/CD workflows to publish your library packages when creating a release ([.github/workflows/builds.yml](./.github/workflows/builds.yml))
Expand All @@ -18,18 +18,18 @@ To get started with your new GDExtension, do the following:
* clone your repository to your local computer
* initialize the godot-cpp git submodule via `git submodule update --init`
* change the name of the compiled library file inside the [SConstruct](./SConstruct) file by modifying the `libname` string.
* change the paths of the to be loaded library name inside the [demo/bin/example.gdextension](./demo/bin/example.gdextension) file, by replacing `EXTENSION-NAME` with the name you chose for `libname`.
* change the `entry_symbol` string inside [demo/bin/example.gdextension](./demo/bin/example.gdextension) file.
* change the paths of the to be loaded library name inside the [project/bin/example.gdextension](./project/bin/example.gdextension) file, by replacing `EXTENSION-NAME` with the name you chose for `libname`.
* change the `entry_symbol` string inside [project/bin/example.gdextension](./project/bin/example.gdextension) file.
* rename the `example_library_init` function in [src/register_types.cpp](./src/register_types.cpp) to the same name you chose for `entry_symbol`.
* change the name of the `demo/bin/example.gdextension` file
* change the name of the `project/bin/example.gdextension` file

Now, you can build the project with the following command:

```shell
scons
```

If the build command worked, you can test it with the [demo](./demo) project. Import it into Godot, open it, and launch the main scene. You should see it print the following line in the console:
If the build command worked, you can test it with the [project](./project) project. Import it into Godot, open it, and launch the main scene. You should see it print the following line in the console:

```
Type: 24
Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ from methods import print_error


libname = "EXTENSION-NAME"
projectdir = "demo"
projectdir = "project"

localEnv = Environment(tools=["default"], PLATFORM="")

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.