WIP: exposing translate

This commit is contained in:
Alejandro Alonso
2024-10-02 14:11:19 +02:00
parent 0bf442e626
commit 579b157ab7
3 changed files with 30 additions and 5 deletions

View File

@@ -127,6 +127,16 @@ pub unsafe extern "C" fn draw_rect(state: *mut State, left: i32, right: i32, top
.flush_and_submit_surface(&mut state.surface, None);
}
#[no_mangle]
pub unsafe extern "C" fn translate(state: *mut State, dx: f32, dy: f32) {
(*state).surface.canvas().translate((dx, dy));
}
#[no_mangle]
pub unsafe extern "C" fn scale(state: *mut State, sx: f32, sy: f32) {
(*state).surface.canvas().scale((sx, sy));
}
fn main() {
init_gl();
}