Skip to content

Commit 1016093

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 Fixed redirect.csv
1 parent d91b6d4 commit 1016093

File tree

15 files changed

+793
-14
lines changed

15 files changed

+793
-14
lines changed

_tools/redirects/redirects.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,7 @@ source,destination
403403
/tutorials/physics/using_kinematic_body_2d.html,/tutorials/physics/using_character_body_2d.html
404404
/tutorials/plugins/editor/spatial_gizmos.html,/tutorials/plugins/editor/3d_gizmos.html
405405
/tutorials/3d/procedural_geometry/immediategeometry.html,/tutorials/3d/procedural_geometry/immediatemesh.html
406+
/tutorials/scripting/gdnative/index.html,/tutorials/scripting/gdextension/index.html
407+
/tutorials/scripting/gdnative/what_is_gdnative.html,/tutorials/scripting/gdnative/what_is_gdextension.html
408+
/tutorials/scripting/gdnative/gdnative_c_example.html,/tutorials/plugins/gdextension/gdextension_cpp_example.html
409+
/tutorials/scripting/gdnative/gdnative_cpp_example.html,/tutorials/plugins/gdextension/gdextension_cpp_example.html

about/docs_changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Scripting
109109
- :ref:`doc_debugger_panel`
110110
- :ref:`doc_creating_script_templates`
111111
- :ref:`doc_evaluating_expressions`
112+
- :ref:`doc_what_is_gdextension`
112113
- :ref:`doc_gdscript_warning_system` (split from :ref:`doc_gdscript_static_typing`)
113114

114115
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
@@ -126,10 +126,10 @@ officially supported .NET option.
126126
in GDScript, C#, or C++ won't have a significant impact on
127127
performance.
128128

129-
C and C++ via GDExtension
130-
~~~~~~~~~~~~~~~~~~~~~~~~~
129+
C++ via GDExtension
130+
~~~~~~~~~~~~~~~~~~~
131131

132-
GDExtension allows you to write game code in C or C++ without needing to recompile
132+
GDExtension allows you to write game code in C++ without needing to recompile
133133
or even restart Godot.
134134

135135
.. 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
@@ -37,7 +37,7 @@ Using WebRTC in Godot
3737

3838
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.
3939

40-
.. 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>`__.
40+
.. 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>`__.
4141

4242
.. warning::
4343

tutorials/platform/android/android_plugin.rst

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

137137

138-
Bundling GDNative resources
139-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
138+
Bundling GDExtension resources
139+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140140

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

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

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

152152
Reference implementations
153153
^^^^^^^^^^^^^^^^^^^^^^^^^
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)