Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynGd trait support + FromGodot "re-enrichment" conversions #958

Merged
merged 8 commits into from
Dec 3, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Dec 2, 2024

Follow-up to #953.

Many thanks to @Yarwin, who supported me throughout the design + implementation phase (also with great ideas from #930), and helped a lot with testing! 💪

This enhances the bare-bones #953 with a ton of traits to integrate with Godot, most notably:

  • Debug
  • Display
  • Eq + PartialEq + Hash (reference semantics like Gd)
  • ToGodot, GodotConvert (pass as object to Godot)
  • FromGodot (hard*)
  • ArrayElement
  • AsArg + ParamType.

The DynGd API is extended to include cast + try_cast, as well as a lot more documentation.

Also improves some error messages for existing conversions.


* FromGodot was particularly difficult, because we need to obtain a dyn Trait pointer from the aether (Godot doesn't have it), and make sure it points to the correct impl Trait vtable. Thanks again for the digging, Yarwin!

@Bromeon Bromeon added feature Adds functionality to the library c: core Core components c: ffi Low-level components and interaction with GDExtension API labels Dec 2, 2024
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-958

@Bromeon Bromeon added this pull request to the merge queue Dec 3, 2024
Merged via the queue into master with commit 6e23bb9 Dec 3, 2024
15 checks passed
@Bromeon Bromeon deleted the feature/dyn-gd-integration branch December 3, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Core components c: ffi Low-level components and interaction with GDExtension API feature Adds functionality to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants