mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Update GDExtension tutorial for entry functions
Docs part of https://github.com/godotengine/godot-cpp/pull/1095 Same changes as https://github.com/godotengine/godot-cpp/pull/1115
This commit is contained in:
@@ -268,8 +268,8 @@ GDExtension plugin.
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// Initialization.
|
// Initialization.
|
||||||
GDExtensionBool GDE_EXPORT example_library_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
|
||||||
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
|
||||||
|
|
||||||
init_obj.register_initializer(initialize_example_module);
|
init_obj.register_initializer(initialize_example_module);
|
||||||
init_obj.register_terminator(uninitialize_example_module);
|
init_obj.register_terminator(uninitialize_example_module);
|
||||||
@@ -348,6 +348,7 @@ loaded for each platform and the entry function for the module. It is called ``g
|
|||||||
[configuration]
|
[configuration]
|
||||||
|
|
||||||
entry_symbol = "example_library_init"
|
entry_symbol = "example_library_init"
|
||||||
|
compatibility_minimum = 4.1
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
@@ -369,6 +370,8 @@ loaded for each platform and the entry function for the module. It is called ``g
|
|||||||
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"
|
android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so"
|
||||||
|
|
||||||
This file contains a ``configuration`` section that controls the entry function of the module.
|
This file contains a ``configuration`` section that controls the entry function of the module.
|
||||||
|
You should also set the minimum compatible Godot version with ``compatability_minimum``,
|
||||||
|
which prevents older version of Godot from trying to load your extension.
|
||||||
|
|
||||||
The ``libraries`` section is the important bit: it tells Godot the location of the
|
The ``libraries`` section is the important bit: it tells Godot the location of the
|
||||||
dynamic library in the project's filesystem for each supported platform. It will
|
dynamic library in the project's filesystem for each supported platform. It will
|
||||||
|
|||||||
Reference in New Issue
Block a user