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

Missing Bindings: c3d/texture.h #9

Closed
hYdos opened this issue Nov 21, 2022 · 3 comments
Closed

Missing Bindings: c3d/texture.h #9

hYdos opened this issue Nov 21, 2022 · 3 comments

Comments

@hYdos
Copy link

hYdos commented Nov 21, 2022

After looking for a reference to C3D_TexSetFilter inside of the bindings, I've come to find out that C3D_TexSetFilter is an inlined function inside of c3d/texture.h which has been missed.

Do keep in mind the missing binding is a static inline, So its missing

@ian-h-chamberlain
Copy link
Member

Yeah, unfortunately static inline isn't supported directly by bindgen. For most of these the best option seems to port it manually, e.g. https://github.com/rust3ds/citro3d-rs/blob/main/citro3d-sys/src/uniforms.rs and https://github.com/rust3ds/citro3d-rs/blob/main/citro3d-sys/src/texenv.rs

Similarly, some macros needed to be ported over as well. I don't know of a better alternative than translating it by hand, but hopefully writing safe Rust wrappers over everything (and translating some more examples) will help identify the missing parts.

@hYdos
Copy link
Author

hYdos commented Nov 22, 2022

If there wasnt that dependency issue with citro3d-rs and ctru-rs I would pr the normal mapping one im currently working on at the moment but sadly its stopping me from using the safe wrapper

@ian-h-chamberlain
Copy link
Member

This should be resolved now with #26 which generates bindings for static inline functions at compile-time. I just double checked and C3D_TexSetFilter is in there now! There might be some performance implications since of course it can't be inlined across FFI boundaries, but at least the API should be usable now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants