reworked code

This commit is contained in:
awtterpip
2023-08-22 21:19:41 -05:00
parent 8e393804b5
commit 849c3e6677
10 changed files with 659 additions and 99 deletions

23
src/resources.rs Normal file
View File

@@ -0,0 +1,23 @@
use std::sync::Mutex;
use std::sync::atomic::AtomicBool;
use crate::resource_macros::*;
use openxr as xr;
xr_resource_wrapper!(XrInstance, xr::Instance);
xr_resource_wrapper!(XrSession, xr::Session<xr::AnyGraphics>);
xr_resource_wrapper!(XrEnvironmentBlendMode, xr::EnvironmentBlendMode);
xr_arc_resource_wrapper!(XrSessionRunning, AtomicBool);
xr_arc_resource_wrapper!(XrFrameWaiter, Mutex<XrFrameWaiter>);
xr_arc_resource_wrapper!(XrSwapchain, Mutex<Swapchain>);
pub enum Swapchain {
Vulkan(SwapchainInner<xr::Vulkan>)
}
pub struct SwapchainInner<G: xr::Graphics> {
stream: xr::FrameStream<G>,
handle: xr::Swapchain<G>,
resolution: (u32, u32),
buffers: Vec<wgpu::Texture>,
}