Skip to content

Commit

Permalink
update to wgpu 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EggShark authored and grovesNL committed Jan 17, 2024
1 parent 3425efd commit 65825aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/grovesNL/glyphon"
license = "MIT OR Apache-2.0 OR Zlib"

[dependencies]
wgpu = "0.18"
wgpu = "0.19"
etagere = "0.2.10"
cosmic-text = "0.10"
lru = "0.12.1"
Expand Down
14 changes: 9 additions & 5 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ use winit::{
window::WindowBuilder,
};

use std::sync::Arc;

fn main() {
pollster::block_on(run());
}
Expand All @@ -23,11 +25,11 @@ async fn run() {
// Set up window
let (width, height) = (800, 600);
let event_loop = EventLoop::new().unwrap();
let window = WindowBuilder::new()
let window = Arc::new(WindowBuilder::new()
.with_inner_size(LogicalSize::new(width as f64, height as f64))
.with_title("glyphon hello world")
.build(&event_loop)
.unwrap();
.unwrap());
let size = window.inner_size();
let scale_factor = window.scale_factor();

Expand All @@ -41,14 +43,15 @@ async fn run() {
.request_device(
&DeviceDescriptor {
label: None,
features: Features::empty(),
limits: Limits::downlevel_defaults(),
required_features: Features::empty(),
required_limits: Limits::downlevel_defaults(),
},
None,
)
.await
.unwrap();
let surface = unsafe { instance.create_surface(&window) }.expect("Create surface");

let surface = instance.create_surface(window.clone()).expect("Create surface");
let swapchain_format = TextureFormat::Bgra8UnormSrgb;
let mut config = SurfaceConfiguration {
usage: TextureUsages::RENDER_ATTACHMENT,
Expand All @@ -58,6 +61,7 @@ async fn run() {
present_mode: PresentMode::Fifo,
alpha_mode: CompositeAlphaMode::Opaque,
view_formats: vec![],
desired_maximum_frame_latency: 2,
};
surface.configure(&device, &config);

Expand Down

0 comments on commit 65825aa

Please sign in to comment.