rust3ds / citro3d-rs

Rust bindings and safe wrappers for citro3d
https://rust3ds.github.io/citro3d-rs
14 stars 11 forks source link

Missing Bindings: c3d/texture.h #9

Closed hYdos closed 1 year ago

hYdos commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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.