mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-23 00:35:31 +00:00
maybe get api working again
This commit is contained in:
17
src/lib.rs
17
src/lib.rs
@ -250,7 +250,7 @@ impl IVRSystem {
|
|||||||
unsafe {
|
unsafe {
|
||||||
let mut err = openvr_sys::HmdError::None;
|
let mut err = openvr_sys::HmdError::None;
|
||||||
let name = std::ffi::CString::new("IVRCompositor_006").unwrap();
|
let name = std::ffi::CString::new("IVRCompositor_006").unwrap();
|
||||||
let ptr = openvr_sys::VR_GetGenericInterface(name.as_ptr(), &mut err as *mut openvr_sys::HmdError);
|
let ptr = openvr_sys::VR_GetGenericInterface(name.as_ptr() as *const u8, &mut err as *mut openvr_sys::HmdError);
|
||||||
match err {
|
match err {
|
||||||
openvr_sys::HmdError::None => Ok(Compositor(ptr)),
|
openvr_sys::HmdError::None => Ok(Compositor(ptr)),
|
||||||
err => Err(err)
|
err => Err(err)
|
||||||
@ -327,17 +327,6 @@ impl Compositor {
|
|||||||
unsafe { openvr_sys::VR_IVRCompositor_SetGamma(self.0, v) }
|
unsafe { openvr_sys::VR_IVRCompositor_SetGamma(self.0, v) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the compositor to gl mode
|
|
||||||
pub fn set_graphics_device_gl(&self) {
|
|
||||||
unsafe {
|
|
||||||
openvr_sys::VR_IVRCompositor_SetGraphicsDevice(
|
|
||||||
self.0,
|
|
||||||
openvr_sys::Compositor_DeviceType::DeviceType_OpenGL,
|
|
||||||
std::ptr::null_mut()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Submit an eye to the render
|
/// Submit an eye to the render
|
||||||
pub fn submit(&self, eye: Eye, texture: usize, bounds: TextureBounds) {
|
pub fn submit(&self, eye: Eye, texture: usize, bounds: TextureBounds) {
|
||||||
let mut b = bounds.to_raw();
|
let mut b = bounds.to_raw();
|
||||||
@ -349,8 +338,10 @@ impl Compositor {
|
|||||||
openvr_sys::VR_IVRCompositor_Submit(
|
openvr_sys::VR_IVRCompositor_Submit(
|
||||||
self.0,
|
self.0,
|
||||||
e,
|
e,
|
||||||
|
openvr_sys::GraphicsAPIConvention::OpenGL,
|
||||||
t,
|
t,
|
||||||
&mut b as *mut openvr_sys::VRTextureBounds_t
|
&mut b as *mut openvr_sys::VRTextureBounds_t,
|
||||||
|
openvr_sys::VRSubmitFlags_t::Default
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user