Browse Source

Move plugins/gdnative to scripting/

Closes #4114
Nathan Lovato 4 years ago
parent
commit
6bca7ed4d6
24 changed files with 101 additions and 5 deletions
  1. 2 2
      classes/class_gdnativelibrary.rst
  2. 0 1
      tutorials/plugins/index.rst
  3. 0 0
      tutorials/scripting/gdnative/files/cpp_example/SConstruct
  4. 0 0
      tutorials/scripting/gdnative/gdnative_c_example.rst
  5. 0 0
      tutorials/scripting/gdnative/gdnative_cpp_example.rst
  6. 0 0
      tutorials/scripting/gdnative/img/add_main_script.gif
  7. 0 0
      tutorials/scripting/gdnative/img/c_main_scene_layout.png
  8. 0 0
      tutorials/scripting/gdnative/img/c_sample_result.png
  9. 0 0
      tutorials/scripting/gdnative/img/connect_button_signal.gif
  10. 0 0
      tutorials/scripting/gdnative/img/gdnative_cpp_animated.gif
  11. 0 0
      tutorials/scripting/gdnative/img/gdnative_cpp_nodes.png
  12. 0 0
      tutorials/scripting/gdnative/img/gdnative_cpp_sprite.png
  13. 0 0
      tutorials/scripting/gdnative/img/gdnative_library.png
  14. 0 0
      tutorials/scripting/gdnative/img/gdnativelibrary_editor.png
  15. 0 0
      tutorials/scripting/gdnative/img/gdnativelibrary_editor_complete.png
  16. 0 0
      tutorials/scripting/gdnative/img/gdnativelibrary_resource.png
  17. 0 0
      tutorials/scripting/gdnative/img/gdnativelibrary_save.png
  18. 0 0
      tutorials/scripting/gdnative/img/nativescript_library.png
  19. 0 0
      tutorials/scripting/gdnative/img/nativescript_resource.png
  20. 0 0
      tutorials/scripting/gdnative/img/new_resource.gif
  21. 0 0
      tutorials/scripting/gdnative/img/save_gdns.gif
  22. 3 2
      tutorials/scripting/gdnative/index.rst
  23. 95 0
      tutorials/scripting/gdnative/what_is_gdnative.rst
  24. 1 0
      tutorials/scripting/index.rst

+ 2 - 2
classes/class_gdnativelibrary.rst

@@ -21,9 +21,9 @@ A GDNative library can implement :ref:`NativeScript<class_NativeScript>`\ s, glo
 Tutorials
 Tutorials
 ---------
 ---------
 
 
-- :doc:`../tutorials/plugins/gdnative/gdnative-c-example`
+_ :doc:`../tutorials/scripting/gdnative/gdnative_c_example`
 
 
-- :doc:`../tutorials/plugins/gdnative/gdnative-cpp-example`
+_ :doc:`../tutorials/scripting/gdnative/gdnative_cpp_example`
 
 
 Properties
 Properties
 ----------
 ----------

+ 0 - 1
tutorials/plugins/index.rst

@@ -6,5 +6,4 @@ Plugins
    :name: toc-tutorials-extending
    :name: toc-tutorials-extending
 
 
    editor/index
    editor/index
-   gdnative/index
    running_code_in_the_editor
    running_code_in_the_editor

+ 0 - 0
tutorials/plugins/gdnative/files/cpp_example/SConstruct → tutorials/scripting/gdnative/files/cpp_example/SConstruct


+ 0 - 0
tutorials/plugins/gdnative/gdnative-c-example.rst → tutorials/scripting/gdnative/gdnative_c_example.rst


+ 0 - 0
tutorials/plugins/gdnative/gdnative-cpp-example.rst → tutorials/scripting/gdnative/gdnative_cpp_example.rst


+ 0 - 0
tutorials/plugins/gdnative/img/add_main_script.gif → tutorials/scripting/gdnative/img/add_main_script.gif


+ 0 - 0
tutorials/plugins/gdnative/img/c_main_scene_layout.png → tutorials/scripting/gdnative/img/c_main_scene_layout.png


+ 0 - 0
tutorials/plugins/gdnative/img/c_sample_result.png → tutorials/scripting/gdnative/img/c_sample_result.png


+ 0 - 0
tutorials/plugins/gdnative/img/connect_button_signal.gif → tutorials/scripting/gdnative/img/connect_button_signal.gif


+ 0 - 0
tutorials/plugins/gdnative/img/gdnative_cpp_animated.gif → tutorials/scripting/gdnative/img/gdnative_cpp_animated.gif


+ 0 - 0
tutorials/plugins/gdnative/img/gdnative_cpp_nodes.png → tutorials/scripting/gdnative/img/gdnative_cpp_nodes.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnative_cpp_sprite.png → tutorials/scripting/gdnative/img/gdnative_cpp_sprite.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnative_library.png → tutorials/scripting/gdnative/img/gdnative_library.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnativelibrary_editor.png → tutorials/scripting/gdnative/img/gdnativelibrary_editor.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnativelibrary_editor_complete.png → tutorials/scripting/gdnative/img/gdnativelibrary_editor_complete.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnativelibrary_resource.png → tutorials/scripting/gdnative/img/gdnativelibrary_resource.png


+ 0 - 0
tutorials/plugins/gdnative/img/gdnativelibrary_save.png → tutorials/scripting/gdnative/img/gdnativelibrary_save.png


+ 0 - 0
tutorials/plugins/gdnative/img/nativescript_library.png → tutorials/scripting/gdnative/img/nativescript_library.png


+ 0 - 0
tutorials/plugins/gdnative/img/nativescript_resource.png → tutorials/scripting/gdnative/img/nativescript_resource.png


+ 0 - 0
tutorials/plugins/gdnative/img/new_resource.gif → tutorials/scripting/gdnative/img/new_resource.gif


+ 0 - 0
tutorials/plugins/gdnative/img/save_gdns.gif → tutorials/scripting/gdnative/img/save_gdns.gif


+ 3 - 2
tutorials/plugins/gdnative/index.rst → tutorials/scripting/gdnative/index.rst

@@ -5,5 +5,6 @@ GDNative
    :maxdepth: 1
    :maxdepth: 1
    :name: toc-tutorials-gdnative
    :name: toc-tutorials-gdnative
 
 
-   gdnative-c-example
-   gdnative-cpp-example
+   what_is_gdnative
+   gdnative_c_example
+   gdnative_cpp_example

+ 95 - 0
tutorials/scripting/gdnative/what_is_gdnative.rst

@@ -0,0 +1,95 @@
+.. _doc_what_is_gdnative:
+
+What is GDNative?
+=================
+
+Introduction
+------------
+
+**GDNative** is a Godot-specific technology that lets the engine interact with
+native `shared libraries <https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries>`__
+at run-time. You can use it to run native code without compiling it with the engine.
+
+.. note:: GDNative is *not* a scripting language and has no relation to
+          :ref:`GDScript <doc_gdscript>`.
+
+Differences between GDNative and C++ modules
+--------------------------------------------
+
+You can use both GDNative and :ref:`C++ modules <doc_custom_modules_in_c++>` to
+run C or C++ code in a Godot project.
+
+They also both allow you to integrate third-party libraries into Godot. The one
+you should choose depends on your needs.
+
+Advantages of GDNative
+^^^^^^^^^^^^^^^^^^^^^^
+
+Unlike modules, GDNative doesn't require compiling the engine's source code,
+making it easier to distribute your work. It gives you access to most of the API
+available to GDScript C#, allowing you to code game logic with full control
+regarding performance. It's ideal if you need high-performance code you'd like
+to distribute as an add-on in the :ref:`asset library <doc_what_is_assetlib>`.
+
+Also:
+
+- GDNative is not limited to C and C++. Thanks to :ref:`third-party bindings
+  <doc_what_is_gdnative_third_party_bindings>`, you can use it with many other
+  languages.
+- You can use the same compiled GDNative library in the editor and exported
+  project. With C++ modules, you have to recompile all the export templates you
+  plan to use if you require its functionality at run-time.
+- GDNative only requires you to compile your library, not the whole engine.
+  That's unlike C++ modules, which are statically compiled into the engine.
+  Every time you change a module, you need to recompile the engine. Even with
+  incremental builds, this process is slower than using GDNative.
+
+Advantages of C++ modules
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+We recommend :ref:`C++ modules <doc_custom_modules_in_c++>` in cases where
+GDNative isn't enough:
+
+- C++ modules provide deeper integration into the engine. GDNative's access is
+  limited to what the scripting API exposes.
+- You can use C++ modules to provide additional features in a project without
+  carrying native library files around. This extends to exported projects.
+- C++ modules are supported on all platforms. In contrast, GDNative isn't
+  supported on HTML5 and the Universal Windows Platform (UWP) yet.
+- C++ modules can be faster than GDNative, especially when the code requires a
+  lot of communication through the scripting API.
+
+Supported languages
+-------------------
+
+The Godot developers officially support the following language bindings for
+GDNative:
+
+- C++ :ref:`(tutorial) <doc_gdnative_cpp_example>`
+- C :ref:`(tutorial) <doc_gdnative_c_example>`
+
+.. note::
+
+    There are no plans to support additional languages with GDNative officially.
+    That said, the community offers several bindings for other languages (see
+    below).
+
+.. _doc_what_is_gdnative_third_party_bindings:
+
+The bindings below are developed and maintained by the community:
+
+.. Binding developers: Feel free to open a pull request to add your binding if it's well-developed enough to be used in a project.
+.. Please keep languages sorted in alphabetical order.
+
+- `D <https://github.com/godot-d/godot-d>`__
+- `Kotlin <https://github.com/utopia-rise/godot-kotlin>`__
+- `Nim <https://github.com/pragmagic/godot-nim>`__
+- `Python <https://github.com/touilleMan/godot-python>`__
+- `Rust <https://github.com/godot-rust/godot-rust>`__
+
+.. note::
+
+    Not all bindings mentioned here may be production-ready. Make sure to
+    research options thoroughly before starting a project with one of those.
+    Also, double-check whether the binding is compatible with the Godot version
+    you're using.

+ 1 - 0
tutorials/scripting/index.rst

@@ -8,6 +8,7 @@ Scripting
    gdscript/index
    gdscript/index
    visual_script/index
    visual_script/index
    c_sharp/index
    c_sharp/index
+   gdnative/index
    cross_language_scripting
    cross_language_scripting
    creating_script_templates
    creating_script_templates
    change_scenes_manually
    change_scenes_manually