-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
*Extension
classes missing virtual methods that accept or return pointers
#191
Comments
It seems that many of the |
True, this was actually omitted by design for now, and can be added later: gdext/godot-codegen/src/class_generator.rs Lines 476 to 484 in 33c4e55
Reclassifying as feature request. |
*Extension
classes missing virtual methods that accept or return pointers
272: Implement virtual methods that accept or return pointers (per #191) r=Bromeon a=Mercerenies This MR adds all missing virtual functions which were previously omitted due to an argument or return value being a pointer. All pointers are translated into Rust-side raw pointers (`*const T` or `*mut T`, as appropriate). All virtual trait functions which either take or return a pointer are marked as `unsafe`. All `native_structures` structs in the JSON file have been translated into Rust-side structures (with `#[repr(C)]` to ensure binary compatibility) and placed in the `godot::native` directory. These are all pure data structs (all fields are public and they have no methods). Many of the pointer functions take or return pointers to these native structures, so being able to construct and access them Rust-side is essential for this functionality. There is one double pointer in the JSON API. `const uint8_t**` appears in several of the networking functions. I believe the correct translation of this type (preserving `const`) is `*mut *const u8`, which is what the code in this MR uses. Co-authored-by: Silvio Mayolo <mercerenies@comcast.net>
*Extension
classes often use pointers to interact with the engine. For instance, all ofPhysicsDirectSpaceState2D
except for the ones inherited fromObject
use pointers in various places.We currently do not generate virtual methods that accept or return pointers. This makes many of these classes unusable, as key behavior is not available.
non-exhaustive list:
PhysicsDirectSpaceState2D
,ScriptExtension
_instance_create
_placeholder_instance_create
_placeholder_erased
The text was updated successfully, but these errors were encountered: