Skip to content

Commit f3a120e

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

1 file changed

Lines changed: 41 additions & 52 deletions

File tree

README.md

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

3-
> [!WARNING]
3+
> [!NOTE]
44
>
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`).
18-
>
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,45 @@ 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):
18+
In the past, godot-cpp versions were synchronized with the Godot versions that
19+
they were compatible with (so, godot-cpp v4.5 was compatible with Godot v4.5
20+
and newer).
3421

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.
22+
This is no longer the case!
4123

42-
Stable releases are also tagged on this repository:
43-
[**Tags**](https://github.com/godotengine/godot-cpp/tags).
24+
Starting with godot-cpp version 10.0.0, godot-cpp's development cycle and
25+
versioning are independent from Godot, and has no bearing on which Godot
26+
versions it is compatible with.
4427

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.**
28+
The older versions are still available at their respective tags and branches,
29+
for example:
4830

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.
31+
- [`4.5`](https://github.com/godotengine/godot-cpp/tree/4.5)
32+
- [`godot-4.5-stable`](https://github.com/godotengine/godot-cpp/tree/godot-4.5-stable)
33+
- [`3.x`](https://github.com/godotengine/godot-cpp/tree/3.x)
5234

5335
## Compatibility
5436

5537
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.
38+
but not vice-versa. For example, a GDExtension targeting Godot 4.3 should work just fine
39+
in Godot 4.4, but one targeting Godot 4.4 won't work in Godot 4.3.
40+
41+
You can specify which version you are targeting with the `api_version` option:
5842

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).
43+
```
44+
scons api_version=4.3
45+
```
46+
47+
... or by providing a custom `extension_api.json` generated by the Godot version you are
48+
targeting:
49+
50+
```
51+
godot --dump-extension-api
52+
scons custom_api_file=extension_api.json
53+
```
54+
55+
If you don't provide `api_version` or `custom_api_file`, then, by default, godot-cpp will
56+
target the latest stable Godot version that it's aware of.
6257

6358
## Contributing
6459

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

7065
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).
7166

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:
67+
Building your extension will create a shared library. To use this in your Godot project you'll need a `.gdextension`
68+
file, for example:
8269

8370
```ini
8471
[configuration]
@@ -97,8 +84,9 @@ linux.release.x86_64 = "res://bin/libgdexample.linux.release.x86_64.so"
9784
# Repeat for other architectures to support arm64, rv64, etc.
9885
```
9986

100-
The `entry_symbol` is the name of the function that initializes
101-
your library. It should be similar to following layout:
87+
See [example.gdextension](test/project/example.gdextension) used in the test project for a complete example.
88+
89+
The `entry_symbol` is the name of the function that initializes your library, for example:
10290

10391
```cpp
10492
extern "C" {
@@ -117,7 +105,7 @@ GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddre
117105
}
118106
```
119107
120-
The `initialize_example_module()` should register the classes in ClassDB, very like a Godot module would do.
108+
The `initialize_example_module()` should register the classes in ClassDB, similar to a Godot module:
121109
122110
```cpp
123111
using namespace godot;
@@ -129,7 +117,8 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
129117
}
130118
```
131119

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

134123
## Examples and templates
135124

0 commit comments

Comments
 (0)