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

New GDNative API #524

Closed
wants to merge 8 commits into from
Closed

New GDNative API #524

wants to merge 8 commits into from

Conversation

vnen
Copy link
Member

@vnen vnen commented Feb 28, 2021

This still a draft since it needs a few PRs to be merged in Godot itself, which will then allow godot-headers to be updated as well so it can be referenced here. That will certainly make the CI fail until that is done.

This is a big change but it doesn't really change how you would use this so it should be a seamless update apart from the changes in the API itself that Godot 4 is bringing,


This uses the new GDNative API from Godot 4. Major change is in the
ability to wrap the builtin types as well, so we don't have to
implement wrappers manually anymore (not on Godot side nor here).

The bindings generator now takes that into account to create the new
wrappers, including a case for utility functions, which are also exposed
from Godot (like print() which now should be called from Utilities).

A few special functions are still provided for convenience, like
print_error().

Some builtin types that are used in math are reimplemented here with a
copy from Godot source (with a few compatibility changes). This is so
you can make use of inlined functions. It is possible that this might
cause problems when marshalling from or to the engine, given difference
in memory alignment between compilers. I haven't experienced this and
that was pretty much already the case before, so it shouldn't be a
problem.

@vnen vnen added enhancement This is an enhancement on the current functionality breaks compat labels Feb 28, 2021
This uses the new GDNative API from Godot 4. Major change is in the
ability to wrap the builtin types as well, so we don't have to
implement wrappers manually anymore (not on Godot side nor here).

The bindings generator now takes that into account to create the new
wrappers, including a case for utility functions, which are also exposed
from Godot (like print() which now should be called from Utilities).

A few special functions are still provided for convenience, like
print_error().

Some builtin types that are used in math are reimplemented here with a
copy from Godot source (with a few compatibility changes). This is so
you can make use of inlined functions. It is possible that this might
cause problems when marshalling from or to the engine, given difference
in memory alignment between compilers. I haven't experienced this and
that was pretty much already the case before, so it shouldn't be a
problem.
@vnen vnen mentioned this pull request Mar 1, 2021
@BastiaanOlij
Copy link
Collaborator

@vnen which upstream PRs in Godot itself need to be merged for this to work? Are they already merged?

@BastiaanOlij
Copy link
Collaborator

@vnen we should probably squash those commits. it's going to be a nightmare rebasing this with all the class name changes...

BastiaanOlij and others added 5 commits June 10, 2021 14:42
Rename Transform, Quat and Reference to new names
In particular for default values. This also unifies the parsing for the
class API and the builtin types API so they use the same function.
@vnen
Copy link
Member Author

vnen commented Aug 20, 2021

Not much point keeping this open (kinda regret doing this since it was mostly a waste of time). Godot 4.0 will use extensions which follow a very different API. I did a good amount of groundwork in my fork for the new system: https://github.com/vnen/godot-cpp/tree/gdnative-extensions if anyone wants to check. Eventually there'll be a PR for that.

@vnen vnen closed this Aug 20, 2021
@vnen
Copy link
Member Author

vnen commented Aug 25, 2021

See #602 for the new system.

@akien-mga akien-mga added this to the 4.0 milestone Sep 27, 2021
@akien-mga akien-mga removed this from the 4.0 milestone Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archived breaks compat enhancement This is an enhancement on the current functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants