right now i use this:
use citro3d_sys::{C3D_ImmDrawBegin,C3D_ImmDrawEnd,C3D_ImmSendAttrib};
use ctru_sys::GPU_TRIANGLES;
pub fn imm(f: impl FnOnce()) {
unsafe {
C3D_ImmDrawBegin(GPU_TRIANGLES);
}
f();
unsafe {
C3D_ImmDrawEnd();
}
}
pub fn attr(xyzw: [f32;4]) {
unsafe {
C3D_ImmSendAttrib(xyzw[0],xyzw[1],xyzw[2],xyzw[3]);
}
}
this is, of course, not sound in the slightest, but could be fixed by some sort of struct that when created, ImmDrawBegin and when dropped, ImmDrawEnd,
The programmer should be informed that the struct needs to be dropped, and a convenience method that takes FnOnce(TheStruct) should be supplied.