#[cfg(feature = "OpenVR")] pub mod openvrintegration; #[cfg(not(feature = "OpenVR"))] pub mod openvrintegration { use crate::Result; use vulkan_rs::prelude::*; use std::sync::Arc; pub struct OpenVRIntegration; impl OpenVRIntegration { pub fn new() -> Result { panic!("Feature OpenVR is not enabled!") } pub fn activate_vulkan_instance_extensions( &self, _: &mut InstanceExtensions, ) -> Result<()> { unimplemented!() } pub fn activate_vulkan_device_extensions( &self, _: &mut DeviceExtensions, _: &Arc, ) -> Result<()> { unimplemented!() } pub fn physical_device(&self, _: &Arc) -> Option { unimplemented!() } } impl std::fmt::Debug for OpenVRIntegration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "OpenVRIntegration {{ }}") } } } #[cfg(feature = "OpenVR")] pub mod openvrrendercore; #[cfg(not(feature = "OpenVR"))] pub mod openvrrendercore { use crate::Result; use ecs::World; use ui::prelude::*; use vulkan_rs::prelude::*; use std::sync::{Arc, Mutex}; use super::openvrintegration::OpenVRIntegration; use crate::RenderCoreCreateInfo; use crate::prelude::*; pub struct OpenVRRenderCore { _dummy: u32, } impl OpenVRRenderCore { pub fn new( _: &OpenVRIntegration, _: &Arc, _: &Arc>, _: RenderCoreCreateInfo, ) -> Result<(Self, TargetMode<()>)> { panic!("Feature OpenVR is not enabled!") } } impl RenderCore for OpenVRRenderCore { fn format(&self) -> VkFormat { unimplemented!() } fn resize(&mut self, _: &mut World, _: u32, _: u32) -> Result<()> { unimplemented!() } fn next_frame(&mut self, _: &mut World) -> Result { unimplemented!() } fn set_clear_color(&self, _: [f32; 4]) { unimplemented!() } // post process handling fn add_post_processing_routine(&self, _post_process: Arc) { unimplemented!() } fn remove_post_processing_routine(&self, _post_process: Arc) { unimplemented!() } fn clear_post_processing_routines(&self) { unimplemented!() } // getter fn image_count(&self) -> usize { unimplemented!() } fn images(&self) -> TargetMode>> { unimplemented!() } fn width(&self) -> u32 { unimplemented!() } fn height(&self) -> u32 { unimplemented!() } fn transformations(&self) -> Option<(VRTransformations, VRTransformations)> { unimplemented!() } } impl std::fmt::Debug for OpenVRRenderCore { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "OpenVRRenderCore {{ }}") } } }