Skip to content

Commit 97517d9

Browse files
committed
GDExtension docs
Renames from GDNative to GDExtension Add Pictures/Gifs and clarified compatability Remove GDNative language bindings from GDExtension docs Update SConstruct and AddingProperties section updated with suggestions Added property hint example + updated to API naming changes
1 parent 6c80dbd commit 97517d9

File tree

13 files changed

+784
-19
lines changed

13 files changed

+784
-19
lines changed

_tools/redirects/redirects.csv

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ source,destination
1818
/community/contributing/updating_the_class_reference.html,/contributing/documentation/updating_the_class_reference.html
1919
/community/contributing/ways_to_contribute.html,/contributing/ways_to_contribute.html
2020
/community/tutorials/3d/mesh_generation_with_heightmap_and_shaders.html,/tutorials/3d/mesh_generation_with_heightmap_and_shaders.html
21-
/community/tutorials/gdnative/gdnative-c-example.html,/tutorials/plugins/gdnative/gdnative-c-example.html
22-
/community/tutorials/gdnative/index.html,/tutorials/plugins/gdnative/index.html
21+
/community/tutorials/gdextension/gdextension-c-example.html,/tutorials/plugins/gdextension/gdextension-c-example.html
22+
/community/tutorials/gdextension/index.html,/tutorials/plugins/gdextension/index.html
2323
/community/tutorials/vr/index.html,/tutorials/vr/index.html
2424
/community/tutorials/vr/vr_primer.html,/tutorials/vr/vr_primer.html
2525
/content/3d/making_trees.html,/tutorials/content/making_trees.html
@@ -376,9 +376,9 @@ source,destination
376376
/tutorials/platform/android_in_app_purchases.html,/tutorials/platform/android/android_in_app_purchases.html
377377
/tutorials/plugins/android/android_plugin.html,/tutorials/platform/android/android_plugin.html
378378
/tutorials/plugins/android/index.html,/tutorials/platform/android/index.html
379-
/tutorials/plugins/gdnative/gdnative-c-example.html,/tutorials/scripting/gdnative/gdnative_c_example.html
380-
/tutorials/plugins/gdnative/gdnative-cpp-example.html,/tutorials/scripting/gdnative/gdnative_cpp_example.html
381-
/tutorials/plugins/gdnative/index.html,/tutorials/scripting/gdnative/index.html
379+
/tutorials/plugins/gdextension/gdextension-c-example.html,/tutorials/scripting/gdextension/gdextension_c_example.html
380+
/tutorials/plugins/gdextension/gdextension-cpp-example.html,/tutorials/scripting/gdextension/gdextension_cpp_example.html
381+
/tutorials/plugins/gdextension/index.html,/tutorials/scripting/gdextension/index.html
382382
/tutorials/shading/advanced_postprocessing.html,/tutorials/shaders/advanced_postprocessing.html
383383
/tutorials/shading/godot_shader_language_style_guide.html,/tutorials/shaders/shaders_style_guide.html
384384
/tutorials/shading/index.html,/tutorials/shaders/index.html

about/docs_changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Scripting
107107
- :ref:`doc_debugger_panel`
108108
- :ref:`doc_creating_script_templates`
109109
- :ref:`doc_evaluating_expressions`
110+
- :ref:`doc_what_is_gdextension`
110111
- :ref:`doc_gdscript_warning_system` (split from :ref:`doc_gdscript_static_typing`)
111112

112113
User Interface (UI)

getting_started/first_2d_game/06.heads_up_display.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ We also need to process what happens when the player loses. The code below will
246246
.. code-tab:: cpp
247247

248248
// This code goes in `hud.cpp`.
249-
// There is no `yield` in GDNative, so we need to have every
249+
// There is no `yield` in GDExtension, so we need to have every
250250
// step be its own method that is called on timer timeout.
251251
void HUD::show_get_ready() {
252252
_message_label->set_text("Get Ready");

getting_started/step_by_step/scripting_languages.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ officially supported .NET option.
124124
in GDScript, C#, or C++ won't have a significant impact on
125125
performance.
126126

127-
C and C++ via GDExtension
128-
~~~~~~~~~~~~~~~~~~~~~~~~~
127+
C++ via GDExtension
128+
~~~~~~~~~~~~~~~~~~~
129129

130-
GDExtension allows you to write game code in C or C++ without needing to recompile
130+
GDExtension allows you to write game code in C++ without needing to recompile
131131
or even restart Godot.
132132

133133
.. image:: img/scripting_cpp.png

tutorials/export/feature_tags.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ Customizing the build
178178
---------------------
179179

180180
Feature tags can be used to customize a build process too, by writing a custom **ExportPlugin**.
181-
They are also used to specify which shared library is loaded and exported in **GDNative**.
181+
They are also used to specify which shared library is loaded and exported in **GDExtension**.

tutorials/networking/webrtc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Using WebRTC in Godot
3535

3636
WebRTC is implemented in Godot via two main classes :ref:`WebRTCPeerConnection <class_WebRTCPeerConnection>` and :ref:`WebRTCDataChannel <class_WebRTCDataChannel>`, plus the multiplayer API implementation :ref:`WebRTCMultiplayerPeer <class_WebRTCMultiplayerPeer>`. See section on :ref:`high-level multiplayer <doc_high_level_multiplayer>` for more details.
3737

38-
.. note:: These classes are available automatically in HTML5, but **require an external GDNative plugin on native (non-HTML5) platforms**. Check out the `webrtc-native plugin repository <https://github.com/godotengine/webrtc-native>`__ for instructions and to get the latest `release <https://github.com/godotengine/webrtc-native/releases>`__.
38+
.. note:: These classes are available automatically in HTML5, but **require an external GDExtension plugin on native (non-HTML5) platforms**. Check out the `webrtc-native plugin repository <https://github.com/godotengine/webrtc-native>`__ for instructions and to get the latest `release <https://github.com/godotengine/webrtc-native/releases>`__.
3939

4040
.. warning::
4141

tutorials/platform/android/android_plugin.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,19 @@ From your script::
133133
print(singleton.myPluginFunction("World"))
134134

135135

136-
Bundling GDNative resources
137-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
136+
Bundling GDExtension resources
137+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138138

139-
An Android plugin can define and provide C/C++ GDNative resources, either to provide and/or access functionality from the game logic.
140-
The GDNative resources can be bundled within the plugin ``aar`` file which simplifies the distribution and deployment process:
139+
An Android plugin can define and provide C/C++ GDExtension resources, either to provide and/or access functionality from the game logic.
140+
The GDExtension resources can be bundled within the plugin ``aar`` file which simplifies the distribution and deployment process:
141141

142-
- The shared libraries (``.so``) for the defined GDNative libraries will be automatically bundled by the ``aar`` build system.
142+
- The shared libraries (``.so``) for the defined GDExtension libraries will be automatically bundled by the ``aar`` build system.
143143
- Godot ``*.gdnlib`` and ``*.gdns`` resource files must be manually defined in the plugin ``assets`` directory.
144144
The recommended path for these resources relative to the ``assets`` directory should be: ``godot/plugin/v1/[PluginName]/``.
145145

146-
For GDNative libraries, the plugin singleton object must override the ``org.godotengine.godot.plugin.GodotPlugin::getPluginGDNativeLibrariesPaths()`` method,
147-
and return the paths to the bundled GDNative libraries config files (``*.gdnlib``). The paths must be relative to the ``assets`` directory.
148-
At runtime, the plugin will provide these paths to Godot core which will use them to load and initialize the bundled GDNative libraries.
146+
For GDExtension libraries, the plugin singleton object must override the ``org.godotengine.godot.plugin.GodotPlugin::getPluginGDNativeLibrariesPaths()`` method,
147+
and return the paths to the bundled GDExtension libraries config files (``*.gdextension``). The paths must be relative to the ``assets`` directory.
148+
At runtime, the plugin will provide these paths to Godot core which will use them to load and initialize the bundled GDExtension libraries.
149149

150150
Reference implementations
151151
^^^^^^^^^^^^^^^^^^^^^^^^^
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
env = SConscript("godot-cpp/SConstruct")
6+
7+
# For reference:
8+
# - CCFLAGS are compilation flags shared between C and C++
9+
# - CFLAGS are for C-specific compilation flags
10+
# - CXXFLAGS are for C++-specific compilation flags
11+
# - CPPFLAGS are for pre-processor flags
12+
# - CPPDEFINES are for pre-processor defines
13+
# - LINKFLAGS are for linking flags
14+
15+
# tweak this if you want to use different folders, or more folders, to store your source code in.
16+
env.Append(CPPPATH=["src/"])
17+
sources = Glob("src/*.cpp")
18+
19+
if env["platform"] == "macos":
20+
library = env.SharedLibrary(
21+
"demo/bin/libgdexample.{}.{}.framework/libgdexample.{}.{}".format(
22+
env["platform"], env["target"], env["platform"], env["target"]
23+
),
24+
source=sources,
25+
)
26+
else:
27+
library = env.SharedLibrary(
28+
"demo/bin/libgdexample{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
29+
source=sources,
30+
)
31+
32+
Default(library)

0 commit comments

Comments
 (0)