Skip to content

Conversation

@bruvzg
Copy link
Member

@bruvzg bruvzg commented Jul 7, 2025

Part of godotengine/godot#108369, should not affect any of existing native structures.

@bruvzg bruvzg added this to the 4.x milestone Jul 7, 2025
@bruvzg bruvzg requested a review from a team as a code owner July 7, 2025 09:49
@bruvzg bruvzg added the enhancement This is an enhancement on the current functionality label Jul 7, 2025
@bruvzg bruvzg force-pushed the nat_struct_union branch from 0f94325 to 2f66014 Compare July 7, 2025 09:50
@dsnopek
Copy link
Collaborator

dsnopek commented Jul 10, 2025

This seems OK, for what it's attempting to accomplish

It doesn't look like it would work with structs or unions that are nested another level deeper. I don't know if it's worth attempting to support that, but if we have one level, it seems natural that more levels could follow? Using a regex to "unwrap" each level of the struct or union could work

However, I think the more important discussion (which we should have with the wider GDExtension team, not just related to godot-cpp) is if we want to support having native structs with nested structs or unions in the first place, and if so, is this is how we want them represented. This will also cause problems for all the other bindings too, and so those maintainers should have the opportunity to be involved as well

@dsnopek
Copy link
Collaborator

dsnopek commented Jul 10, 2025

Actually, looking back at godotengine/godot#108369 I don't see it using nested structs or unions? Is that to work around them not being supported in godot-cpp, or is that something that you decided just not to do anymore?

@bruvzg
Copy link
Member Author

bruvzg commented Jul 10, 2025

Is that to work around them not being supported in godot-cpp, or is that something that you decided just not to do anymore?

I have changed API, so it is no longer need (using RIDs instead of raw pointer).

@dsnopek
Copy link
Collaborator

dsnopek commented Jul 10, 2025

Ok, so then should this PR just be closed? Or do you foresee this being needed for something else?

@Bromeon
Copy link
Contributor

Bromeon commented Jul 22, 2025

@bruvzg this PR only changes codegen, but do you have an example of such a native struct, both in C layout and JSON format? You mentioned godotengine/godot#108369, is it GlyphDrawCall? How would that look?

@bruvzg
Copy link
Member Author

bruvzg commented Jul 22, 2025

It's no longer used, so probably should be closed.

@bruvzg bruvzg closed this Jul 22, 2025
@bruvzg bruvzg removed this from the 4.x milestone Jul 22, 2025
@bruvzg
Copy link
Member Author

bruvzg commented Jul 22, 2025

Struct was GlyphDrawCall, with union for the call type specific data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

archived enhancement This is an enhancement on the current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants