pub unsafe extern "C" fn led_matrix_swap_on_vsync(
    matrix: *mut RGBLedMatrix,
    canvas: *mut LedCanvas
) -> *mut LedCanvas
Expand description

Swap the given canvas (created with create_offscreen_canvas) with the currently active canvas on vsync (blocks until vsync is reached). Returns the previously active canvas. So with that, you can create double buffering:

struct LedCanvas *offscreen = led_matrix_create_offscreen_canvas(…); led_canvas_set_pixel(offscreen, …); // not shown until swap-on-vsync offscreen = led_matrix_swap_on_vsync(matrix, offscreen); // The returned buffer, assigned to offscreen, is now the inactive buffer // fill, then swap again.