From 58721dc5c23b568e3727b769a779d17be95c7507 Mon Sep 17 00:00:00 2001 From: Chad Brokaw Date: Thu, 14 Jul 2022 15:03:27 -0400 Subject: [PATCH] fix new API use for android example --- piet-gpu/bin/android.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/piet-gpu/bin/android.rs b/piet-gpu/bin/android.rs index d1c4749..9f59117 100644 --- a/piet-gpu/bin/android.rs +++ b/piet-gpu/bin/android.rs @@ -13,8 +13,8 @@ use ndk::native_window::NativeWindow; use ndk_glue::Event; use piet_gpu_hal::{ - CmdBuf, Error, ImageLayout, Instance, QueryPool, Semaphore, Session, SubmittedCmdBuf, Surface, - Swapchain, + CmdBuf, Error, ImageLayout, Instance, InstanceFlags, QueryPool, Semaphore, Session, + SubmittedCmdBuf, Surface, Swapchain, }; use piet::kurbo::Point; @@ -54,9 +54,9 @@ fn my_main() -> Result<(), Error> { let width = window.width() as usize; let height = window.height() as usize; let handle = get_handle(window); - let (instance, surface) = Instance::new(Some(&handle), Default::default())?; - gfx_state = - Some(GfxState::new(&instance, surface.as_ref(), width, height)?); + let instance = Instance::new(InstanceFlags::PRESENT)?; + let surface = instance.surface(&handle)?; + gfx_state = Some(GfxState::new(&instance, Some(&surface), width, height)?); } else { println!("native window is sadly none"); } @@ -100,7 +100,7 @@ impl GfxState { height: usize, ) -> Result { unsafe { - let device = instance.device(surface)?; + let device = instance.device()?; let swapchain = instance.swapchain(width, height, &device, surface.unwrap())?; let session = Session::new(device); let current_frame = 0;