Added setMouseScrollCallback

This commit is contained in:
2022-01-10 12:20:52 -07:00
parent 2c465861e1
commit a816791914
2 changed files with 61 additions and 6 deletions

View File

@ -148,6 +148,11 @@ pub fn Window(comptime TUserData: type) type {
c.mfb_set_mouse_move_callback(self.cwin, @ptrCast(c.mfb_mouse_move_func, callback));
}
pub const MouseScrollFunc = fn (win: Window(TUserData), key_mod: KeyMod, delta_x: f32, delty_y: f32) callconv(.C) void;
pub fn setMouseScrollCallback(self: Window(TUserData), callback: MouseScrollFunc) void {
c.mfb_set_mouse_scroll_callback(self.cwin, @ptrCast(c.mfb_mouse_scroll_func, callback));
}
pub fn setViewport(self: Window(TUserData), offset_x: u32, offset_y: u32, width: u32, height: u32) bool {
return c.mfb_set_viewport(self.cwin, offset_x, offset_y, width, height);
}