Since it's a builder, we should really consume self and return Self
instead of using &mut self. This makes it easier to convert into the
final matrix at the end of building.
Finally, something that I don't think totally sucks. Pick some sane
defaults for some fields, and use generics to split between
orthographic and perspective implementations. It's still not perfect but
I think this looks a lot more ergonomic to use vs what I had before (and
compared to the C APIs).
It's not much but it should be extensible enough to apply for other
uniform types. We might want a generic impl for &[u8] or something
as well to support custom uniform types, but that gets trickier.
Effectively:
- Move the previous bindgen script into build.rs
- In lib.rs, include the file generated at build time
- Compile inline statics with devkitARM toolchain
- Remove now-unneeded reimplementations of inline statics
- Use doxygen_rs to clean up the docs of the generated bindings.
Nice! This cleans up the repo a lot and also ensures we are using the
canonical implementations of those inline functions, which should help
prevent mistakes as well.
We can return a "handle" that stores the index + size of the VBO data,
as well as keeping a phantom borrow on the original data. By requiring
this handle as input during the call to draw arrays, we ensure the VBO
data lives long enough for the draw call.