Skip to content

Commit 6e47919

Browse files
committed
Update README for versioning and compatibility changes in v10
1 parent b895ed9 commit 6e47919

File tree

1 file changed

+40
-54
lines changed

1 file changed

+40
-54
lines changed

README.md

Lines changed: 40 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
# godot-cpp
22

3-
> [!WARNING]
4-
>
5-
> This repository's `master` branch is only usable with
6-
> [GDExtension](https://godotengine.org/article/introducing-gd-extensions)
7-
> from Godot's `master` branch.
8-
>
9-
> For users of stable branches, switch to the branch matching your target Godot version:
10-
> - [`4.5`](https://github.com/godotengine/godot-cpp/tree/4.5)
11-
> - [`4.4`](https://github.com/godotengine/godot-cpp/tree/4.4)
12-
> - [`4.3`](https://github.com/godotengine/godot-cpp/tree/4.3)
13-
> - [`4.2`](https://github.com/godotengine/godot-cpp/tree/4.2)
14-
> - [`4.1`](https://github.com/godotengine/godot-cpp/tree/4.1)
15-
> - [`4.0`](https://github.com/godotengine/godot-cpp/tree/4.0)
16-
>
17-
> Or check out the Git tag matching your Godot version (e.g. `godot-4.1.1-stable`).
3+
> [!NOTE]
184
>
19-
> For GDNative users (Godot 3.x), switch to the [`3.x`](https://github.com/godotengine/godot-cpp/tree/3.x)
20-
> or the [`3.5`](https://github.com/godotengine/godot-cpp/tree/3.5) branch.
5+
> For GDNative (Godot 3.x), switch to the [`3.x`](https://github.com/godotengine/godot-cpp/tree/3.x)
6+
> or the [`3.6`](https://github.com/godotengine/godot-cpp/tree/3.6) branch.
217
228
This repository contains the *C++ bindings* for the [**Godot Engine**](https://github.com/godotengine/godot)'s GDExtensions API.
239

@@ -29,36 +15,41 @@ This repository contains the *C++ bindings* for the [**Godot Engine**](https://
2915

3016
## Versioning
3117

32-
This repositories follows the same branch versioning as the main [Godot Engine
33-
repository](https://github.com/godotengine/godot):
34-
35-
- `master` tracks the current GDExtension development branch for the next Godot
36-
4.x minor release.
37-
- `3.x` tracks the development of the GDNative plugin for the next 3.x minor
38-
release.
39-
- Other versioned branches (e.g. `4.0`, `3.5`) track the latest stable release
40-
in the corresponding branch.
41-
42-
Stable releases are also tagged on this repository:
43-
[**Tags**](https://github.com/godotengine/godot-cpp/tags).
18+
> [!WARNING]
19+
>
20+
> The master branch of godot-cpp (version 10.x) is currently in Beta. You may prefer to choose a previous version to build on top of instead:
21+
> - [`4.5`](https://github.com/godotengine/godot-cpp/tree/4.5)
22+
> - [`godot-4.5-stable`](https://github.com/godotengine/godot-cpp/tree/godot-4.5-stable)
23+
> - [`3.x`](https://github.com/godotengine/godot-cpp/tree/3.x)
4424
45-
**For any project built against a stable release of Godot, we recommend using
46-
this repository as a Git submodule, checking out the specific tag matching your
47-
Godot version.**
25+
Starting with version 10.x, godot-cpp is versioned independently from Godot. The godot-cpp version you
26+
choose has no bearing on which Godot versions it is compatible with.
4827

49-
> As the `master` branch of Godot is constantly getting updated, if you are
50-
> using `godot-cpp` against a more current version of Godot, see the instructions
51-
> in the `gdextension` folder to update the relevant files.
28+
Until we have a stable release branch, you can use the `master` branch, or choose any of the previous
29+
version branches and tags for your project.
5230

5331
## Compatibility
5432

5533
GDExtensions targeting an earlier version of Godot should work in later minor versions,
56-
but not vice-versa. For example, a GDExtension targeting Godot 4.2 should work just fine
57-
in Godot 4.3, but one targeting Godot 4.3 won't work in Godot 4.2.
34+
but not vice-versa. For example, a GDExtension targeting Godot 4.3 should work just fine
35+
in Godot 4.4, but one targeting Godot 4.4 won't work in Godot 4.3.
36+
37+
You can specify which version you are targeting with the `api_version` option:
5838

59-
There is one exception to this: extensions targeting Godot 4.0 will _not_ work with
60-
Godot 4.1 and later.
61-
See [Updating your GDExtension for 4.1](https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.1.html#updating-your-gdextension-for-godot-4-1).
39+
```
40+
scons api_version=4.3
41+
```
42+
43+
... or by providing a custom `extension_api.json` generated by the Godot version you are
44+
targeting:
45+
46+
```
47+
godot --dump-extension-api
48+
scons custom_api_file=extension_api.json
49+
```
50+
51+
If you don't provide `api_version` or `custom_api_file`, then, by default, godot-cpp will
52+
target the latest stable Godot version that it's aware of.
6253

6354
## Contributing
6455

@@ -69,16 +60,8 @@ wish to help out, please visit the [godot-cpp section of the Contributing docs](
6960

7061
You need the same C++ pre-requisites installed that are required for the `godot` repository. Follow the [official build instructions for your target platform](https://docs.godotengine.org/en/latest/engine_details/development/compiling/index.html).
7162

72-
Getting started with GDExtensions is a bit similar to what it was for 3.x but also a bit different.
73-
74-
This new approach is much more akin to how core Godot modules are structured.
75-
76-
Compiling this repository generates a static library to be linked with your shared lib,
77-
just like before.
78-
79-
To use the shared lib in your Godot project you'll need a `.gdextension`
80-
file, which replaces what was the `.gdnlib` before.
81-
See [example.gdextension](test/project/example.gdextension) used in the test project:
63+
Building your extension will create a shared library. To use this in your Godot project you'll need a `.gdextension`
64+
file, for example:
8265

8366
```ini
8467
[configuration]
@@ -97,8 +80,10 @@ linux.release.x86_64 = "res://bin/libgdexample.linux.release.x86_64.so"
9780
# Repeat for other architectures to support arm64, rv64, etc.
9881
```
9982

100-
The `entry_symbol` is the name of the function that initializes
101-
your library. It should be similar to following layout:
83+
See the [example.gdextension](https://github.com/godotengine/godot-cpp-template/blob/main/demo/bin/example.gdextension)
84+
used in the template project for a complete example.
85+
86+
The `entry_symbol` is the name of the function that initializes your library, for example:
10287

10388
```cpp
10489
extern "C" {
@@ -117,7 +102,7 @@ GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddre
117102
}
118103
```
119104
120-
The `initialize_example_module()` should register the classes in ClassDB, very like a Godot module would do.
105+
The `initialize_example_module()` should register the classes in ClassDB, similar to a Godot module:
121106
122107
```cpp
123108
using namespace godot;
@@ -129,7 +114,8 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
129114
}
130115
```
131116

132-
Any node and resource you register will be available in the corresponding `Create...` dialog. Any class will be available to scripting as well.
117+
Any node and resource you register will be available in the corresponding `Create...` dialog.
118+
Any class will be available to scripting as well.
133119

134120
## Examples and templates
135121

0 commit comments

Comments
 (0)