-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
This probably goes against the point of a safe rust wrapper, but if this can be done it would allow people to interface with other c libraries that are not part of this project.
For example, unsafe access to the underlying C3D_RenderTarget pointer from Target<'screen> can allow someone to use citro2d-sys like so:
...
// assuming that we are in Instance::render_frame_with and a cast_lifetime_to_closure function exists
let render_to = cast_lifetime_to_closure(|pass, target| {
pass.select_render_target(target).expect("Unable to set render target");
unsafe {
C2D_SceneTarget(target.as_raw()); // as_raw would return a *mut pointer, just like the private function
}
...I know that y'all are wrapping citro2d into this project, but it's an easy example to reach for given the current state of things.
I came across this while developing my own 3DS game engine in rust. I want to use as much of citro3d-rs as I can, but I can't use citro2d if I use citro3d-rs in it's current state. :/
Metadata
Metadata
Assignees
Labels
No labels