Skip to content

If you need to send vertices mid-frame, don't use a buffer, it doesn't work. Use immediate mode instead. #57

@LexiBigCheese

Description

@LexiBigCheese

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions