Skip to content

Commit

Permalink
updating wgpu-hal/Cargo.toml, fix wgpu-hal/examples/halmark/main.rs
Browse files Browse the repository at this point in the history
bumping up `winit`
  • Loading branch information
TornaxO7 committed Oct 23, 2023
1 parent 6105633 commit 025b20b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 173 deletions.
177 changes: 10 additions & 167 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wgpu-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ features = ["wgsl-in"]
[dev-dependencies]
cfg-if = "1"
env_logger = "0.10"
winit = { version = "0.28.7", features = [ "android-native-activity" ] } # for "halmark" example
winit = { version = "0.29.2", features = [ "android-native-activity" ] } # for "halmark" example

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
glutin = "0.29.1" # for "gles" example
15 changes: 10 additions & 5 deletions wgpu-hal/examples/halmark/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate wgpu_hal as hal;
use hal::{
Adapter as _, CommandEncoder as _, Device as _, Instance as _, Queue as _, Surface as _,
};
use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle};
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};

use std::{
borrow::{Borrow, Cow},
Expand Down Expand Up @@ -95,10 +95,15 @@ impl<A: hal::Api> Example<A> {
gles_minor_version: wgt::Gles3MinorVersion::default(),
};
let instance = unsafe { A::Instance::init(&instance_desc)? };
let mut surface = unsafe {
instance
.create_surface(window.raw_display_handle(), window.raw_window_handle())
.unwrap()
let mut surface = {
let raw_window_handle = window.window_handle()?.as_raw();
let raw_display_handle = window.display_handle()?.as_raw();

unsafe {
instance
.create_surface(raw_display_handle, raw_window_handle)
.unwrap()
}
};

let (adapter, capabilities) = unsafe {
Expand Down

0 comments on commit 025b20b

Please sign in to comment.