gdext icon indicating copy to clipboard operation
gdext copied to clipboard

GDExtension API has changed ! (a bit)

Open touilleMan opened this issue 3 years ago • 5 comments

This is friendly note so that you don't freak out when seeing this project it broken against Godot's master :smiley:

see https://github.com/godotengine/godot/pull/67750 & https://github.com/godotengine/godot-cpp/pull/896

Basically GDExtension API uses StringName (almost) everywhere instead of the char *. On top of that the way to register proerties has been simplified.

touilleMan avatar Nov 08 '22 22:11 touilleMan

Thanks for the heads-up! 👍

No worries, change detection of the GDExtension header has already been automated, outputting a descriptive diff 😉

Nevertheless it's even nicer to have a descriptive changeset, so I appreciate being proactive! I also wrote a comment regarding https://github.com/godotengine/godot/issues/61968, which might now be mitigated or even fully solved.

I might then use this issue to track the progress of implementing those changes.

Bromeon avatar Nov 08 '22 22:11 Bromeon

No worries, change detection of the GDExtension header has already been automated, outputting a descriptive diff wink

That's pretty sweet !

which might now be mitigated or even fully solved

I think the issue is fully solved, however it would be even better to entirely remove the get_property_list an replace it by an array passed where get_property_list function pointer is currently provided. This would simplify the API and remove the ambiguity that get_property_list might get called multiple time and can return different result each time it is called (to support dynamically adding property, which is of course not a thing in Godot)

What do you think ?

touilleMan avatar Nov 09 '22 00:11 touilleMan

however it would be even better to entirely remove the get_property_list an replace it by an array passed where get_property_list function pointer is currently provided.

You mean when the class is registered, one would provide an array of all properties?

I think that might be ideal, because then the extension library can forget (aka deallocate) the property meta-information once registered. I might need to check the implementation to make sure I'm not missing something though 🙂

Bromeon avatar Nov 09 '22 08:11 Bromeon

I think that might be ideal

I will try to find time to submit a PR to Godot then, and I'll ping you for the review then :smiley:

I might need to check the implementation to make sure I'm not missing something though

Please do ! My guess is the GDExtension API use this "function to pass constant values" pattern only because it leaks it C++ implementation where generics are implemented with templates and function argument specialization :smile:

touilleMan avatar Nov 09 '22 10:11 touilleMan

@Bromeon see https://github.com/godotengine/godot/pull/68479 ;-)

touilleMan avatar Nov 10 '22 15:11 touilleMan