nathanfranke / gdextension

GDExtension template that automatically builds into a self-contained addon for the Godot Asset Library. Updated to Godot 4.3.
The Unlicense
196 stars 27 forks source link

update godot-cpp to 4.1 latest, (4.1.3) and fix up register_types.cpp #8

Closed Squatnet closed 1 year ago

Squatnet commented 1 year ago

4.1 changes

GDExtensionBool GDE_EXPORT example_library_init(const GDExtensionInterface *p_interface, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
    godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);

to

GDExtensionBool GDE_EXPORT example_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
    godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
nathanfranke commented 1 year ago

I am going to try updating android builds shortly. Thanks for the contribution!

Squatnet commented 1 year ago

i noticed after i pushed this that it still doesnt work correctly. the .gdextension file needs a compatibility_minimum property and all paths to libraries are now specified as absolute paths, i guess so the bin folder can be outside the addon folder.

[configuration]

entry_symbol = "gdextension_init"
compatibility_minimum = 4.1
[libraries]

macos.debug = "res://addons/example/bin/libexample.macos.debug.framework"
macos.release = "res://addons/example/bin/libexample.macos.release.framework"
windows.debug.x86_64 = "res://addons/example/bin/libexample.windows.debug.x86_64.dll"
windows.release.x86_64 = "res://addons/example/bin/libexample.windows.release.x86_64.dll"
linux.debug.x86_64 = "res://addons/example/bin/libexample.linux.debug.x86_64.so"
linux.release.x86_64 = "res://addons/example/bin/libexample.linux.release.x86_64.so"
linux.debug.arm64 = "res://addons/example/bin/libexample.linux.debug.arm64.so"
linux.release.arm64 = "res://addons/example/bin/libexample.linux.release.arm64.so"
linux.debug.rv64 = "res://addons/example/bin/libexample.linux.debug.rv64.so"
linux.release.rv64 = "res://addons/example/bin/libexample.linux.release.rv64.so"

happy to help, apologies for the oversight.