Skip to content

Commit

Permalink
fix wgpu_teapot_camera example panic when cursor grabbing unsupported
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchmindtree authored and tychedelia committed Jan 17, 2024
1 parent 69b3f19 commit 1fba132
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/wgpu/wgpu_teapot_camera/wgpu_teapot_camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ fn model(app: &App) -> Model {

let window = app.window(w_id).unwrap();
let camera_is_active = true;
window.set_cursor_grab(true).unwrap();
if let Err(e) = window.set_cursor_grab(true) {
eprintln!("warning: cursor grabbing not supported: {e}");
}
window.set_cursor_visible(false);
let device = window.device();
let format = Frame::TEXTURE_FORMAT;
Expand Down

0 comments on commit 1fba132

Please sign in to comment.