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

Add pointers support for virtual methods. #625

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

Faless
Copy link
Contributor

@Faless Faless commented Sep 27, 2021

As introduced in godot for virtual methods.
Custom structs are not yet supported.

@Faless Faless added enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation labels Sep 27, 2021
@Faless Faless added this to the 4.0 milestone Sep 27, 2021
As introduced in godot for virtual methods.
Custom structs are not yet supported.
@@ -184,6 +184,47 @@ struct PtrToArg<const T *> {
}
};

// Pointers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment that this should be kept in sync with https://github.com/godotengine/godot/blob/master/core/variant/native_ptr.h (especially the GDVIRTUAL_NATIVE_PTR calls).

GDVIRTUAL_NATIVE_PTR(char32_t);
GDVIRTUAL_NATIVE_PTR(wchar_t);
GDVIRTUAL_NATIVE_PTR(uint8_t);
GDVIRTUAL_NATIVE_PTR(uint8_t *);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing with https://github.com/godotengine/godot/blob/master/core/variant/native_ptr.h, this one seems unique here. Is that expected?

Also AudioFrame missing but I guess that's what you meant with "Custom structs are not yet supported."

Copy link
Contributor Author

@Faless Faless Sep 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing with https://github.com/godotengine/godot/blob/master/core/variant/native_ptr.h, this one seems unique here. Is that expected?

Oh I haven't yet merged godotengine/godot#52481 , that's the PacketPeer uint8_t **, hence the GDVIRTUAL_NATIVE_PTR(uint8_t *);

Also AudioFrame missing but I guess that's what you meant with "Custom structs are not yet supported."

Yes, those should be auto-generated

@Faless Faless merged commit 3cebc33 into godotengine:master Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an enhancement on the current functionality topic:gdextension This relates to the new Godot 4 extension implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants