1
- .. _ doc_what_is_gdnative :
1
+ .. _ doc_what_is_gdextension :
2
2
3
- What is GDNative ?
3
+ What is GDExtension ?
4
4
=================
5
5
6
6
Introduction
7
7
------------
8
8
9
- **GDNative ** is a Godot-specific technology that lets the engine interact with
9
+ **GDExtension ** is a Godot-specific technology that lets the engine interact with
10
10
native `shared libraries <https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries >`__
11
11
at run-time. You can use it to run native code without compiling it with the engine.
12
12
13
- .. note :: GDNative is *not* a scripting language and has no relation to
13
+ .. note :: GDExtension is *not* a scripting language and has no relation to
14
14
:ref: `GDScript <doc_gdscript >`.
15
15
16
- Differences between GDNative and C++ modules
16
+ Differences between GDExtension and C++ modules
17
17
--------------------------------------------
18
18
19
- You can use both GDNative and :ref: `C++ modules <doc_custom_modules_in_c++ >` to
19
+ You can use both GDExtension and :ref: `C++ modules <doc_custom_modules_in_c++ >` to
20
20
run C or C++ code in a Godot project.
21
21
22
22
They also both allow you to integrate third-party libraries into Godot. The one
23
23
you should choose depends on your needs.
24
24
25
- Advantages of GDNative
25
+ Advantages of GDExtension
26
26
^^^^^^^^^^^^^^^^^^^^^^
27
27
28
- Unlike modules, GDNative doesn't require compiling the engine's source code,
28
+ Unlike modules, GDExtension doesn't require compiling the engine's source code,
29
29
making it easier to distribute your work. It gives you access to most of the API
30
30
available to GDScript C#, allowing you to code game logic with full control
31
31
regarding performance. It's ideal if you need high-performance code you'd like
32
32
to distribute as an add-on in the :ref: `asset library <doc_what_is_assetlib >`.
33
33
34
34
Also:
35
35
36
- - GDNative is not limited to C and C++. Thanks to :ref: `third-party bindings
36
+ - GDExtension is not limited to C and C++. Thanks to :ref: `third-party bindings
37
37
<doc_what_is_gdnative_third_party_bindings>`, you can use it with many other
38
38
languages.
39
- - You can use the same compiled GDNative library in the editor and exported
39
+ - You can use the same compiled GDExtension library in the editor and exported
40
40
project. With C++ modules, you have to recompile all the export templates you
41
41
plan to use if you require its functionality at run-time.
42
- - GDNative only requires you to compile your library, not the whole engine.
42
+ - GDExtension only requires you to compile your library, not the whole engine.
43
43
That's unlike C++ modules, which are statically compiled into the engine.
44
44
Every time you change a module, you need to recompile the engine. Even with
45
- incremental builds, this process is slower than using GDNative .
45
+ incremental builds, this process is slower than using GDExtension .
46
46
47
47
Advantages of C++ modules
48
48
^^^^^^^^^^^^^^^^^^^^^^^^^
49
49
50
50
We recommend :ref: `C++ modules <doc_custom_modules_in_c++ >` in cases where
51
- GDNative isn't enough:
51
+ GDExtension isn't enough:
52
52
53
- - C++ modules provide deeper integration into the engine. GDNative 's access is
54
- limited to what the scripting API exposes.
53
+ - C++ modules provide deeper integration into the engine. GDExtension 's access is not as deep as
54
+ static modules
55
55
- You can use C++ modules to provide additional features in a project without
56
56
carrying native library files around. This extends to exported projects.
57
- - C++ modules are supported on all platforms. In contrast, GDNative has only
58
- limited support on HTML5 (cannot be used together with multi-threading), and
59
- is not supported on Universal Windows Platform (UWP).
60
- - C++ modules can be faster than GDNative, especially when the code requires a
61
- lot of communication through the scripting API.
57
+ (- C++ modules can be faster than GDNative, especially when the code requires a
58
+ lot of communication through the scripting API.) -> TODO: check if this still holds up
62
59
63
60
Supported languages
64
61
-------------------
65
62
66
63
The Godot developers officially support the following language bindings for
67
- GDNative :
64
+ GDExtension :
68
65
69
66
- C++ :ref: `(tutorial) <doc_gdnative_cpp_example >`
70
67
- C :ref: `(tutorial) <doc_gdnative_c_example >`
71
68
72
69
.. note ::
73
70
74
- There are no plans to support additional languages with GDNative officially.
71
+ There are no plans to support additional languages with GDExtension officially.
75
72
That said, the community offers several bindings for other languages (see
76
73
below).
77
74
@@ -98,9 +95,9 @@ The bindings below are developed and maintained by the community:
98
95
Version compatibility
99
96
---------------------
100
97
101
- :ref: `Unlike Godot itself <doc_release_policy >`, GDNative has stricter version
102
- compatibility requirements as it relies on low-level *ptrcalls * to function.
98
+ ( :ref: `Unlike Godot itself <doc_release_policy >`, GDExtension has stricter version
99
+ compatibility requirements as it relies on low-level *ptrcalls * to function.) -> TODO: check up on this
103
100
104
- GDNative add-ons compiled for a given Godot version are only guaranteed to work
105
- with the same minor release series. For example, a GDNative add-on compiled for
106
- Godot 3.4 will only work with Godot 3.4, 3.4. 1, 3.4. 2… but not Godot 3.3 or 3.5 .
101
+ GDExtension add-ons compiled for a given Godot version are only guaranteed to work
102
+ with the same minor release series. For example, a GDExtension add-on compiled for
103
+ Godot 4.0 will only work with Godot 4.0, 4.0. 1, 4.0. 2… but not Godot 3.5 or 3.6 .
0 commit comments