From ff9743f9cf8b71c45379f5a5b6569bf9d139f729 Mon Sep 17 00:00:00 2001 From: Rene Eichhorn Date: Sun, 1 May 2016 18:35:07 +0200 Subject: [PATCH] updated to latest openvr sdk, updated to use bindgen, ongoing refactoring --- Cargo.toml | 1 + Readme.md | 70 +- examples/test.rs | 34 +- openvr | 2 +- scripts/binding.h | 5 + scripts/gen.py | 144 -- src/common.rs | 99 + src/compositor.rs | 69 + src/extended_display.rs | 57 + src/lib.rs | 410 +---- src/sys/lib.rs | 3776 +++++++++++++++++++++++++++------------ src/system.rs | 108 ++ 12 files changed, 3106 insertions(+), 1669 deletions(-) create mode 100644 scripts/binding.h delete mode 100644 scripts/gen.py create mode 100644 src/common.rs create mode 100644 src/compositor.rs create mode 100644 src/extended_display.rs create mode 100644 src/system.rs diff --git a/Cargo.toml b/Cargo.toml index f64c630..f19262c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ authors = [ "Erick Tryzelaar", "Rene Eichhorn" ] +build = "src/sys/build.rs" [lib] name = "openvr" diff --git a/Readme.md b/Readme.md index 93b8b16..0def63d 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ rust-openvr is a binding for openvr. It's still in progress. Tests are automatic Also my private jenkins is running these test on Ubuntu 14.04 as well, every successful build will be pushed to its branch (stable, nightly, beta). For good practice always use either stable, beta or nightly instead of master! ## [Link to the documentation](http://auruss.github.io/rust-openvr/openvr/index.html) -## Current version: OpenVR SDK 0.9.11 (will be updated soon to newest!) +## Current sdk version: OpenVR SDK 0.9.19 Building -------- @@ -32,69 +32,23 @@ Using rust-openvr extern crate openvr; -use openvr::{SensorCapabilities, Ovr}; - fn main() { - // Initalize the Oculus VR library - let ovr = match Ovr::init() { - Some(ovr) => ovr, - None => { - println!("Could not initialize OpenVR SDK"); + // Initialize system subsystem + let system = match openvr::init() { + Ok(sys) => sys, + Err(err) => { + println!("Could not initialize OpenVR SDK: \n\t{:?}", err); return; } }; - // get the first available HMD device, returns None - // if no HMD device is currently plugged in - let hmd = match ovr.first_hmd() { - Some(hmd) => hmd, - None => { - println!("Could not get hmd"); - return; - } - }; + // accessing other sub systems + let ext = openvr::extended_display(); - // start the sensor recording, Require orientation tracking - let started = hmd.start_sensor(SensorCapabilities::new().set_orientation(true), - SensorCapabilities::new().set_orientation(true)); - if !started { - println!("Could not start sensor"); - return; - } + // .. } ``` -# Render loop - -The OpenVR SDK will handle most of the heavy lifting of the barrel distortion. - -```rust -fn render(frame_index: uint, hmd: &ovr::Hmd, base_view: &Matrix4) { - // start a new frame, the frame_index should increment each frame - let frame_timing = hmd.begin_frame(frame_index); - let desc = hmd.get_description(); - - for &eye in [ovr::EyeLeft, ovr::EyeRight].iter() { - // start rendering a new eye, this will give the most current - // copy of the pose from the HMD tracking sensor - let pose = self.window.get_hmd().begin_eye_render(eye); - - // base_view * pose * eye_view_adjustment - let view = base_view.mul_m(&pose.orientation.to_matrix4()) - .mul_m(&Matrix4::translate(&eye.view_adjust)); - let projection = desc.eye_fovs.eye(eye).default_eye_fov; - - // render to texture - render(); - - let texture = ovr::Texture(width, height, - viewport_offset_x, viewport_offset_y, - viewport_width, viewport_height, - opengl_texture_id); - hmd.end_eye_render(eye, pose, &texture); - } - - // this will swap the buffers and frame sync - hmd.end_frame(); -} -``` +# Examples +For data collection examples/test.rs can be used. +For an actual opengl implementation see examples/opengl.rs (WIP) diff --git a/examples/test.rs b/examples/test.rs index fdc3c8a..f755c57 100644 --- a/examples/test.rs +++ b/examples/test.rs @@ -16,7 +16,7 @@ fn print_matrix_4x3(offset: u32, mat: [[f32; 4]; 3]) { } fn main() { - let ivr = match openvr::IVRSystem::init() { + let system = match openvr::init() { Ok(ivr) => ivr, Err(err) => { println!("Failed to create IVR subsystem {:?}", err); @@ -24,27 +24,26 @@ fn main() { } }; - println!("IVR was created"); - println!("\tbounds: {:?}", ivr.bounds()); - println!("\trecommended size: {:?}", ivr.recommended_render_target_size()); - println!("\teye output: {:?} {:?}", ivr.eye_viewport(openvr::Eye::Left), ivr.eye_viewport(openvr::Eye::Right)); - println!("\tvsync: {:?}", ivr.time_since_last_vsync()); + println!("IVRSystem was created"); + + println!("\trecommended size: {:?}", system.recommended_render_target_size()); + println!("\tvsync: {:?}", system.time_since_last_vsync()); print!("\tprojection matrix left "); - print_matrix_4x4(31, ivr.projection_matrix(openvr::Eye::Left, 0.1, 100.)); + print_matrix_4x4(31, system.projection_matrix(openvr::Eye::Left, 0.1, 100.)); print!("\tprojection matrix right "); - print_matrix_4x4(31, ivr.projection_matrix(openvr::Eye::Right, 0.1, 100.)); + print_matrix_4x4(31, system.projection_matrix(openvr::Eye::Right, 0.1, 100.)); print!("\teye_to_head "); - print_matrix_4x3(8+12, ivr.eye_to_head_transform(openvr::Eye::Left)); + print_matrix_4x3(8+12, system.eye_to_head_transform(openvr::Eye::Left)); print!("\tposes "); - print_matrix_4x3(8+6, ivr.tracked_devices(0.).as_slice()[0].to_device); + print_matrix_4x3(8+6, system.tracked_devices(0.).as_slice()[0].to_device); println!("Distortion example"); for u in 0..2 { for v in 0..2 { - let pos = ivr.compute_distortion( + let pos = system.compute_distortion( openvr::Eye::Left, u as f32 / 4., v as f32 / 4., @@ -54,6 +53,17 @@ fn main() { println!(""); } + let ext = match openvr::extended_display() { + Ok(ext) => ext, + Err(err) => { + println!("Failed to create IVRExtendedDisplay subsystem {:?}", err); + return; + } + }; + println!("\nIVRExtendedDisplay was created"); + println!("\tbounds: {:?}", ext.window_bounds()); + println!("\teye output: {:?} {:?}", ext.eye_viewport(openvr::Eye::Left), ext.eye_viewport(openvr::Eye::Right)); +/* println!("Trying to create a compositor"); match ivr.compositor() { Err(err) => println!("Could not create compositor {:?}", err), @@ -65,7 +75,9 @@ fn main() { println!("\tgamma value = {}", comp.get_gamma()); } } + */ + openvr::shutdown(); println!("Done! \\o/"); diff --git a/openvr b/openvr index 061cf41..a6c91ef 160000 --- a/openvr +++ b/openvr @@ -1 +1 @@ -Subproject commit 061cf411ee1125fe4b7cdf3837451a1c6a32a3c8 +Subproject commit a6c91ef97302ce2abd852115682fb8726471c67b diff --git a/scripts/binding.h b/scripts/binding.h new file mode 100644 index 0000000..7de7b4b --- /dev/null +++ b/scripts/binding.h @@ -0,0 +1,5 @@ +// This header is used for bindgen to automatically generate the openvr c binding +// bindgen -match openvr_capi.h scripts/binding.h -o binding.rs + +#include +#include "../openvr/headers/openvr_capi.h" diff --git a/scripts/gen.py b/scripts/gen.py deleted file mode 100644 index 5ec8f07..0000000 --- a/scripts/gen.py +++ /dev/null @@ -1,144 +0,0 @@ -import json -import re - -array = re.compile(r"(.+)\[([0-9]+)\]") - -data = {} -with open("openvr/headers/openvr_api.json") as f: - data = json.loads(f.read()) - -type_mapping = { - 'int': 'i32', - 'uint64_t': 'u64', - 'uint32_t': 'u32', - 'uint16_t': 'u16', - 'uint8_t': 'u8', - 'int64_t': 'i64', - 'int32_t': 'i32', - 'int16_t': 'i16', - 'int8_t': 'i8', - 'double': 'f64', - 'float': 'f32', - '_Bool': 'bool', - 'unsigned short': 'u16', - 'const char': 'u8', - 'void': '()', - - # I'm lazy - 'unsigned char *': '*const u8', - 'char *': '*const u8', - 'char **': '*const *const u8', - 'const uint16_t *': '*const u16', - 'const uint8_t *': '*const u8', - 'const struct vr::HmdVector2_t *': '*const HmdVector2_t', - 'const struct vr::RenderModel_Vertex_t *': '*const RenderModel_Vertex_t', - - 'float [3][4]': '[[f32; 4]; 3]', - 'float [16]': '[f32; 16]', - 'float [4]': '[f32; 4]', - 'float [3]': '[f32; 3]', - 'float [2]': '[f32; 2]', - 'double [3]': '[f64; 3]', - - 'union VREvent_Data_t': '[u8; 16]' -} - - -def parse_type(s): - if s.startswith("struct"): - return parse_type(s[7:]) - elif s.startswith("vr::"): - return parse_type(s[4:]) - elif s.startswith('enum'): - return parse_type(s.split()[1]) - elif s.startswith("const "): - return parse_type(s[6:]) - elif s in type_mapping: - return type_mapping[s] - elif s[-2:] == ' *': - return "*mut " + parse_type(s[:-2]) - elif s[-2:] == ' &': - return "*const " + parse_type(s[:-2]) - elif array.match(s): - m = array.match(s) - return "[%s; %s]" % (parse_type(m.group(1)), m.group(2)) - return s - -def parse_class(s): - if s.startswith("vr::"): - return 'VR_' + s[4:] - return s - - -def shorten_enum(parent, name): - split = name.split('_') - if len(split) == 2: - return split[-1] - elif len(split) > 2: - return '_'.join(split[1:]) - return name - - - -print """ -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(improper_ctypes)] - -#[link(name = "openvr_api")] -extern {} - -extern "C" { - pub fn VR_Init(err: *mut HmdError) -> *const (); - pub fn VR_Shutdown(); - pub fn VR_IsHmdPresent() -> bool; - pub fn VR_GetStringForHmdError(err: HmdError) -> *const u8; - pub fn VR_GetGenericInterface(name: *const u8, err: *mut HmdError) -> *const (); -} -""" - -for d in data['typedefs']: - if parse_type(d['typedef']) == parse_type(d['type']): - continue - - print "pub type %s = %s;" % (parse_type(d['typedef']), parse_type(d['type'])) - -for d in data['enums']: - found = set() - print "#[repr(C)]\n#[derive(Debug)]\npub enum %s {" % parse_type(d['enumname']) - for v in d['values']: - if v['value'] in found: - continue - found.add(v['value']) - print "\t%s = %s," % (shorten_enum(d['enumname'], v['name']), v['value']) - print "}\n" - -for s in data['structs']: - if s['struct'] == "vr::(anonymous)": - continue - print "#[repr(C)]\npub struct %s {" % parse_type(s['struct']) - for f in s['fields']: - print "\t//%s" % f['fieldtype'] - print "\tpub %s: %s," % (f['fieldname'], parse_type(f['fieldtype'])) - print "}" - -print "extern \"C\" {" - -for m in data['methods']: - print '\tpub fn ' + parse_class(m['classname']) + '_' + m['methodname'] + "(ptr: *const (),", - s = [] - for p in m.get('params', []): - if p['paramname'] == 'type': - p['paramname'] = '_type' - s += ["%s: %s" % (p['paramname'], parse_type(p['paramtype']))] - print "%s)" % (', '.join(s)), - if 'returntype' in m and m['returntype'] == 'void': - print ";" - elif 'returntype' in m: - print "-> %s;" % parse_type(m['returntype']) - else: - print ";" - -print "}" - - diff --git a/src/common.rs b/src/common.rs new file mode 100644 index 0000000..7488558 --- /dev/null +++ b/src/common.rs @@ -0,0 +1,99 @@ +use openvr_sys; +use openvr_sys::Enum_EVREye::*; + +#[derive(Debug, Copy, Clone)] +pub struct Size { + pub width: u32, + pub height: u32 +} + +#[derive(Debug, Copy, Clone)] +pub struct Position { + pub x: i32, + pub y: i32 +} + +#[derive(Debug, Copy, Clone)] +pub struct Rectangle { + pub position: Position, + pub size: Size +} + +#[derive(Debug, Copy, Clone)] +pub struct DistortionCoordinates { + pub red: [f32; 2], + pub green: [f32; 2], + pub blue: [f32; 2], +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum Eye { + Left, Right +} + +impl Eye { + /// Convert a eye to a HmdEye + pub fn to_raw(&self) -> openvr_sys::EVREye { + match self { + &Eye::Left => EVREye_Eye_Left, + &Eye::Right => EVREye_Eye_Right, + } + } +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct TextureBounds { + pub u_min: f32, + pub u_max: f32, + pub v_min: f32, + pub v_max: f32 +} + +impl TextureBounds { + /// Convert a bounds to a openvr_bounds + fn to_raw(self) -> openvr_sys::VRTextureBounds_t { + openvr_sys::VRTextureBounds_t{ + uMin: self.u_min, + uMax: self.u_max, + vMin: self.v_min, + vMax: self.v_max + } + } +} + +#[derive(Debug, Copy, Clone)] +pub struct TrackedDevicePose { + pub to_device: [[f32; 4]; 3], + pub velocity: [f32; 3], + pub angular_velocity: [f32; 3], + pub is_valid: bool, + pub is_connected: bool, +} + +#[derive(Debug, Copy, Clone)] +pub struct TrackedDevicePoses { + pub count: usize, + pub poses: [TrackedDevicePose; 16], +} + +impl TrackedDevicePoses { + pub fn as_slice(&self) -> &[TrackedDevicePose] { + &self.poses[0..self.count] + } +} + +pub unsafe fn to_tracked(data: [openvr_sys::TrackedDevicePose_t; 16]) -> TrackedDevicePoses { + use std; + let mut out: TrackedDevicePoses = std::mem::zeroed(); + for (i, d) in data.iter().enumerate() { + if d.bDeviceIsConnected > 0 { + out.count = i + 1; + } + out.poses[i].is_connected = d.bDeviceIsConnected > 0; + out.poses[i].is_valid = d.bPoseIsValid > 0; + out.poses[i].to_device = d.mDeviceToAbsoluteTracking.m; + out.poses[i].velocity = d.vVelocity.v; + out.poses[i].angular_velocity = d.vAngularVelocity.v; + } + out +} diff --git a/src/compositor.rs b/src/compositor.rs new file mode 100644 index 0000000..ea9507b --- /dev/null +++ b/src/compositor.rs @@ -0,0 +1,69 @@ + +/// A VR compositor +pub struct Compositor(*const ()); + +impl Compositor { + /// Check to see if the compositor is fullscreen + pub fn is_fullscreen(&self) -> bool { + unsafe { openvr_sys::VR_IVRCompositor_IsFullscreen(self.0) } + } + + /// Check if vsync in enabled + pub fn get_vsync(&self) -> Option { + unsafe { openvr_sys::VR_IVRCompositor_GetVSync(self.0) } + } + + /// Set the vsync value + pub fn set_vsync(&self, v: bool) { + unsafe { openvr_sys::VR_IVRCompositor_SetVSync(self.0, v) } + } + + /// Check if vsync in enabled + pub fn can_render_scene(&self) -> bool { + unsafe { openvr_sys::VR_IVRCompositor_CanRenderScene(self.0) } + } + + /// Get the gamma value + pub fn get_gamma(&self) -> f32 { + unsafe { openvr_sys::VR_IVRCompositor_GetGamma(self.0) } + } + + /// Get the gamma value + pub fn set_gamma(&self, v: f32) { + unsafe { openvr_sys::VR_IVRCompositor_SetGamma(self.0, v) } + } + + /// Submit an eye to the render + pub fn submit(&self, eye: Eye, texture: usize, bounds: TextureBounds) { + let mut b = bounds.to_raw(); + let e = eye.to_raw(); + unsafe { + use std::mem; + let t = mem::transmute(texture); + + openvr_sys::VR_IVRCompositor_Submit( + self.0, + e, + openvr_sys::GraphicsAPIConvention::OpenGL, + t, + &mut b as *mut openvr_sys::VRTextureBounds_t, + openvr_sys::VRSubmitFlags_t::Default + ); + } + } + + /// Get the poses + pub fn wait_get_poses(&self) -> TrackedDevicePoses { + unsafe { + let mut data: [openvr_sys::TrackedDevicePose_t; 16] = std::mem::zeroed(); + openvr_sys::VR_IVRCompositor_WaitGetPoses( + self.0, + &mut data[0], + 16, + std::ptr::null_mut(), + 0 + ); + to_tracked(data) + } + } +} diff --git a/src/extended_display.rs b/src/extended_display.rs new file mode 100644 index 0000000..f530dd9 --- /dev/null +++ b/src/extended_display.rs @@ -0,0 +1,57 @@ +use openvr_sys; + +use common::*; + +pub struct IVRExtendedDisplay(*const ()); + +impl IVRExtendedDisplay { + pub unsafe fn from_raw(ptr: *const ()) -> Self { + IVRExtendedDisplay(ptr as *mut ()) + } + + /// Get the window bounds + pub fn window_bounds(&self) -> Rectangle { + unsafe { + let ext = * { self.0 as *mut openvr_sys::Struct_VR_IVRExtendedDisplay_FnTable }; + + let mut size = Size{width: 0, height: 0}; + let mut pos = Position{x: 0, y: 0}; + + ext.GetWindowBounds.unwrap()( + &mut pos.x, + &mut pos.y, + &mut size.width, + &mut size.height + ); + + Rectangle { + position: pos, + size: size + } + } + } + /// Get eye viewport size + pub fn eye_viewport(&self, eye: Eye) -> Rectangle { + use std::mem; + + unsafe { + let ext = * { self.0 as *mut openvr_sys::Struct_VR_IVRExtendedDisplay_FnTable }; + + let mut size = Size{width: 0, height: 0}; + let mut pos = Position{x: 0, y: 0}; + + ext.GetEyeOutputViewport.unwrap()( + eye.to_raw(), + mem::transmute(&mut pos.x), + mem::transmute(&mut pos.y), + &mut size.width, + &mut size.height + ); + + Rectangle { + position: pos, + size: size + } + } + } +} diff --git a/src/lib.rs b/src/lib.rs index 8c6d2fa..b4b61e9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,361 +1,89 @@ extern crate openvr_sys; +use openvr_sys::Enum_EVRInitError::*; +use openvr_sys::Enum_EVRApplicationType::*; -pub struct IVRSystem(*const ()); +pub mod common; +pub mod system; +pub mod extended_display; -#[derive(Debug, Copy, Clone)] -pub struct Size { - pub width: u32, - pub height: u32 -} +pub use system::IVRSystem; +pub use extended_display::IVRExtendedDisplay; -#[derive(Debug, Copy, Clone)] -pub struct Position { - pub x: i32, - pub y: i32 -} +pub use common::Eye; -#[derive(Debug, Copy, Clone)] -pub struct Rectangle { - pub position: Position, - pub size: Size -} +/// Inits the open vr interface and returns the system +pub fn init() -> Result { + let mut err = EVRInitError_VRInitError_None; + let app_type = EVRApplicationType_VRApplication_Scene; -#[derive(Debug, Copy, Clone)] -pub struct DistortionCoordinates { - pub red: [f32; 2], - pub green: [f32; 2], - pub blue: [f32; 2], -} + // try to initialize base vr eco + unsafe { + openvr_sys::VR_InitInternal(&mut err, app_type); + }; -#[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub enum Eye { - Left, Right -} - - -impl Eye { - /// Convert a eye to a HmdEye - fn to_raw(&self) -> openvr_sys::Hmd_Eye { - match self { - &Eye::Left => openvr_sys::Hmd_Eye::Left, - &Eye::Right => openvr_sys::Hmd_Eye::Right, - } - } -} - -#[derive(Debug, Copy, Clone, PartialEq)] -pub struct TextureBounds { - pub u_min: f32, - pub u_max: f32, - pub v_min: f32, - pub v_max: f32 -} - -impl TextureBounds { - /// Convert a bounds to a openvr_bounds - fn to_raw(self) -> openvr_sys::VRTextureBounds_t { - openvr_sys::VRTextureBounds_t{ - uMin: self.u_min, - uMax: self.u_max, - vMin: self.v_min, - vMax: self.v_max - } - } -} - -#[derive(Debug, Copy, Clone)] -pub struct TrackedDevicePose { - pub to_device: [[f32; 4]; 3], - pub velocity: [f32; 3], - pub angular_velocity: [f32; 3], - pub is_valid: bool, - pub is_connected: bool, -} - -#[derive(Debug, Copy, Clone)] -pub struct TrackedDevicePoses { - pub count: usize, - pub poses: [TrackedDevicePose; 16], -} - -impl TrackedDevicePoses { - pub fn as_slice(&self) -> &[TrackedDevicePose] { - &self.poses[0..self.count] - } -} - -unsafe fn to_tracked(data: [openvr_sys::TrackedDevicePose_t; 16]) -> TrackedDevicePoses { - let mut out: TrackedDevicePoses = std::mem::zeroed(); - for (i, d) in data.iter().enumerate() { - if d.bDeviceIsConnected { - out.count = i + 1; - } - out.poses[i].is_connected = d.bDeviceIsConnected; - out.poses[i].is_valid = d.bPoseIsValid; - out.poses[i].to_device = d.mDeviceToAbsoluteTracking.m; - out.poses[i].velocity = d.vVelocity.v; - out.poses[i].angular_velocity = d.vAngularVelocity.v; - } - out -} - -impl IVRSystem { - /// Initialize the IVR System - pub fn init() -> Result { - let mut err = openvr_sys::HmdError::None; - let ptr = unsafe { - openvr_sys::VR_Init(&mut err as *mut openvr_sys::HmdError) - }; - if ptr.is_null() { - Err(err) - } else { - Ok(IVRSystem(ptr)) - } - } - - /// Get the window bounds - pub fn bounds(&self) -> Rectangle { - unsafe { - let mut size = Size{width: 0, height: 0}; - let mut pos = Position{x: 0, y: 0}; - openvr_sys::VR_IVRSystem_GetWindowBounds( - self.0, - &mut pos.x, - &mut pos.y, - &mut size.width, - &mut size.height - ); - Rectangle { - position: pos, - size: size + // check for errors + match err { + EVRInitError_VRInitError_None => { + // get system + let result = system(); + match result { + Ok(sys) => { + return Ok(sys); + }, + Err(err) => { + return Err(err); + } } + }, + _ => { + return Err(err); } - } + }; +} - /// Get the recommended render target size - pub fn recommended_render_target_size(&self) -> Size { - unsafe { - let mut size = Size{width: 0, height: 0}; - openvr_sys::VR_IVRSystem_GetRecommendedRenderTargetSize( - self.0, - &mut size.width, - &mut size.height - ); - size - } +/// Shutdowns all openvr related systems +pub fn shutdown() { + unsafe { + openvr_sys::VR_ShutdownInternal(); } +} - /// Get eye viewport size - pub fn eye_viewport(&self, eye: Eye) -> Rectangle { - use std::mem; - unsafe { - let mut size = Size{width: 0, height: 0}; - let mut pos = Position{x: 0, y: 0}; - openvr_sys::VR_IVRSystem_GetEyeOutputViewport( - self.0, - eye.to_raw(), - mem::transmute(&mut pos.x), - mem::transmute(&mut pos.y), - &mut size.width, - &mut size.height - ); - Rectangle { - position: pos, - size: size +/// gets the current vr system interface (initialization is required beforehand) +pub fn system() -> Result { + let mut err = EVRInitError_VRInitError_None; + let name = std::ffi::CString::new("FnTable:IVRSystem_012").unwrap(); + let ptr = unsafe { + openvr_sys::VR_GetGenericInterface(name.as_ptr(), &mut err) + }; + + match err { + EVRInitError_VRInitError_None => { + unsafe { + return Ok(IVRSystem::from_raw(ptr as *const ())); } - } - } - - /// Get the projection matrix for an eye - /// supply the near and the far position - /// assumes opengl conventions - pub fn projection_matrix(&self, eye: Eye, near: f32, far: f32) -> [[f32; 4]; 4] { - unsafe { - let mat = openvr_sys::VR_IVRSystem_GetProjectionMatrix( - self.0, - eye.to_raw(), - near, - far, - openvr_sys::GraphicsAPIConvention::OpenGL - ); - mat.m - } - } - - /// Computes the distortion caused by the optics - pub fn compute_distortion(&self, eye: Eye, u: f32, v: f32) -> DistortionCoordinates { - unsafe { - let coord = openvr_sys::VR_IVRSystem_ComputeDistortion( - self.0, - eye.to_raw(), - u, v - ); - DistortionCoordinates { - red: coord.rfRed, - blue: coord.rfBlue, - green: coord.rfGreen - } - } - } - - /// Computes the distortion caused by the optics - pub fn eye_to_head_transform(&self, eye: Eye) -> [[f32; 4]; 3] { - unsafe { - let mat = openvr_sys::VR_IVRSystem_GetEyeToHeadTransform( - self.0, - eye.to_raw(), - ); - mat.m - } - } - - /// Computes the distortion caused by the optics - pub fn time_since_last_vsync(&self) -> Option<(f32, u64)> { - unsafe { - let mut frame = 0; - let mut sync = 0.; - let found = openvr_sys::VR_IVRSystem_GetTimeSinceLastVsync( - self.0, - &mut sync, - &mut frame - ); - - if found { - Some((sync, frame)) - } else { - None - } - } - } - - /// Fetch the tracked results from the HMD - pub fn tracked_devices(&self, time: f32) -> TrackedDevicePoses { - unsafe { - let mut data: [openvr_sys::TrackedDevicePose_t; 16] = std::mem::zeroed(); - openvr_sys::VR_IVRSystem_GetDeviceToAbsoluteTrackingPose( - self.0, - openvr_sys::TrackingUniverseOrigin::TrackingUniverseSeated, - time, - &mut data[0], - 16 - ); - to_tracked(data) - } - } - - /// If the device supports a compositor return a instance - pub fn compositor(&self) -> Result { - unsafe { - let mut err = openvr_sys::HmdError::None; - let name = std::ffi::CString::new("IVRCompositor_006").unwrap(); - let ptr = openvr_sys::VR_GetGenericInterface(name.as_ptr() as *const u8, &mut err as *mut openvr_sys::HmdError); - match err { - openvr_sys::HmdError::None => Ok(Compositor(ptr)), - err => Err(err) - } - } - } - - /// get frequency of hmd in hz - pub fn display_frequency(&self) -> f32 { - unsafe { - openvr_sys::VR_IVRSystem_GetFloatTrackedDeviceProperty( - self.0, - 0, - openvr_sys::TrackedDeviceProperty::DisplayFrequency_Float, - std::ptr::null_mut() - ) - } - } - - /// get the time vsync to phonts - pub fn vsync_to_photons(&self) -> f32 { - unsafe { - openvr_sys::VR_IVRSystem_GetFloatTrackedDeviceProperty( - self.0, - 0, - openvr_sys::TrackedDeviceProperty::SecondsFromVsyncToPhotons_Float, - std::ptr::null_mut() - ) + }, + _ => { + return Err(err); } } } -impl Drop for IVRSystem { - fn drop(&mut self) { - unsafe { - println!("Trying to shutdown openvr"); - openvr_sys::VR_Shutdown(); - println!("Should be done now."); - } - } -} - -/// A VR compositor -pub struct Compositor(*const ()); - -impl Compositor { - /// Check to see if the compositor is fullscreen - pub fn is_fullscreen(&self) -> bool { - unsafe { openvr_sys::VR_IVRCompositor_IsFullscreen(self.0) } - } - - /// Check if vsync in enabled - pub fn get_vsync(&self) -> bool { - unsafe { openvr_sys::VR_IVRCompositor_GetVSync(self.0) } - } - - /// Set the vsync value - pub fn set_vsync(&self, v: bool) { - unsafe { openvr_sys::VR_IVRCompositor_SetVSync(self.0, v) } - } - - /// Check if vsync in enabled - pub fn can_render_scene(&self) -> bool { - unsafe { openvr_sys::VR_IVRCompositor_CanRenderScene(self.0) } - } - - /// Get the gamma value - pub fn get_gamma(&self) -> f32 { - unsafe { openvr_sys::VR_IVRCompositor_GetGamma(self.0) } - } - - /// Get the gamma value - pub fn set_gamma(&self, v: f32) { - unsafe { openvr_sys::VR_IVRCompositor_SetGamma(self.0, v) } - } - - /// Submit an eye to the render - pub fn submit(&self, eye: Eye, texture: usize, bounds: TextureBounds) { - let mut b = bounds.to_raw(); - let e = eye.to_raw(); - unsafe { - use std::mem; - let t = mem::transmute(texture); - - openvr_sys::VR_IVRCompositor_Submit( - self.0, - e, - openvr_sys::GraphicsAPIConvention::OpenGL, - t, - &mut b as *mut openvr_sys::VRTextureBounds_t, - openvr_sys::VRSubmitFlags_t::Default - ); - } - } - - /// Get the poses - pub fn wait_get_poses(&self) -> TrackedDevicePoses { - unsafe { - let mut data: [openvr_sys::TrackedDevicePose_t; 16] = std::mem::zeroed(); - openvr_sys::VR_IVRCompositor_WaitGetPoses( - self.0, - &mut data[0], - 16, - std::ptr::null_mut(), - 0 - ); - to_tracked(data) +/// gets the current vr extended display interface (initialization is required beforehand) +pub fn extended_display() -> Result { + let mut err = EVRInitError_VRInitError_None; + let name = std::ffi::CString::new("FnTable:IVRExtendedDisplay_001").unwrap(); + let ptr = unsafe { + openvr_sys::VR_GetGenericInterface(name.as_ptr(), &mut err) + }; + + match err { + EVRInitError_VRInitError_None => { + unsafe { + return Ok(IVRExtendedDisplay::from_raw(ptr as *const ())); + } + }, + _ => { + return Err(err); } } } diff --git a/src/sys/lib.rs b/src/sys/lib.rs index cdc481a..a602c6b 100755 --- a/src/sys/lib.rs +++ b/src/sys/lib.rs @@ -1,1137 +1,2685 @@ - -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(improper_ctypes)] - #[link(name = "openvr_api")] extern {} -extern "C" { - pub fn VR_Init(err: *mut HmdError) -> *const (); - pub fn VR_Shutdown(); - pub fn VR_IsHmdPresent() -> bool; - pub fn VR_GetStringForHmdError(err: HmdError) -> *const u8; - pub fn VR_GetGenericInterface(name: *const u8, err: *mut HmdError) -> *const (); -} - -pub type TrackedDeviceIndex_t = u32; -pub type VREvent_Data_t = [u8; 16]; -pub type VRControllerState_t = VRControllerState001_t; -pub type VROverlayHandle_t = u64; -pub type VRNotificationId = u32; -#[repr(C)] -#[derive(Debug)] -pub enum Hmd_Eye { - Left = 0, - Right = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum GraphicsAPIConvention { - DirectX = 0, - OpenGL = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum HmdTrackingResult { - Uninitialized = 1, - Calibrating_InProgress = 100, - Calibrating_OutOfRange = 101, - Running_OK = 200, - Running_OutOfRange = 201, -} - -#[repr(C)] -#[derive(Debug)] -pub enum TrackedDeviceClass { - Invalid = 0, - HMD = 1, - Controller = 2, - TrackingReference = 4, - Other = 1000, -} - -#[repr(C)] -#[derive(Debug)] -pub enum TrackingUniverseOrigin { - TrackingUniverseSeated = 0, - TrackingUniverseStanding = 1, - TrackingUniverseRawAndUncalibrated = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum TrackedDeviceProperty { - TrackingSystemName_String = 1000, - ModelNumber_String = 1001, - SerialNumber_String = 1002, - RenderModelName_String = 1003, - WillDriftInYaw_Bool = 1004, - ManufacturerName_String = 1005, - TrackingFirmwareVersion_String = 1006, - HardwareRevision_String = 1007, - AllWirelessDongleDescriptions_String = 1008, - ConnectedWirelessDongle_String = 1009, - DeviceIsWireless_Bool = 1010, - DeviceIsCharging_Bool = 1011, - DeviceBatteryPercentage_Float = 1012, - StatusDisplayTransform_Matrix34 = 1013, - Firmware_UpdateAvailable_Bool = 1014, - Firmware_ManualUpdate_Bool = 1015, - Firmware_ManualUpdateURL_String = 1016, - HardwareRevision_Uint64 = 1017, - FirmwareVersion_Uint64 = 1018, - FPGAVersion_Uint64 = 1019, - VRCVersion_Uint64 = 1020, - RadioVersion_Uint64 = 1021, - DongleVersion_Uint64 = 1022, - BlockServerShutdown_Bool = 1023, - CanUnifyCoordinateSystemWithHmd_Bool = 1024, - ReportsTimeSinceVSync_Bool = 2000, - SecondsFromVsyncToPhotons_Float = 2001, - DisplayFrequency_Float = 2002, - UserIpdMeters_Float = 2003, - CurrentUniverseId_Uint64 = 2004, - PreviousUniverseId_Uint64 = 2005, - DisplayFirmwareVersion_String = 2006, - IsOnDesktop_Bool = 2007, - DisplayMCType_Int32 = 2008, - DisplayMCOffset_Float = 2009, - DisplayMCScale_Float = 2010, - VendorID_Int32 = 2011, - DisplayMCImageLeft_String = 2012, - DisplayMCImageRight_String = 2013, - DisplayGCBlackClamp_Float = 2014, - AttachedDeviceId_String = 3000, - SupportedButtons_Uint64 = 3001, - Axis0Type_Int32 = 3002, - Axis1Type_Int32 = 3003, - Axis2Type_Int32 = 3004, - Axis3Type_Int32 = 3005, - Axis4Type_Int32 = 3006, - FieldOfViewLeftDegrees_Float = 4000, - FieldOfViewRightDegrees_Float = 4001, - FieldOfViewTopDegrees_Float = 4002, - FieldOfViewBottomDegrees_Float = 4003, - TrackingRangeMinimumMeters_Float = 4004, - TrackingRangeMaximumMeters_Float = 4005, - TrackedCamera_IntrinsicsFX_Float = 5000, - TrackedCamera_IntrinsicsFY_Float = 5001, - TrackedCamera_IntrinsicsCX_Float = 5002, - TrackedCamera_IntrinsicsCY_Float = 5003, - TrackedCamera_IntrinsicsK1_Float = 5004, - TrackedCamera_IntrinsicsK2_Float = 5005, - TrackedCamera_IntrinsicsP1_Float = 5006, - TrackedCamera_IntrinsicsP2_Float = 5007, - TrackedCamera_IntrinsicsK3_Float = 5008, -} - -#[repr(C)] -#[derive(Debug)] -pub enum TrackedPropertyError { - Success = 0, - WrongDataType = 1, - WrongDeviceClass = 2, - BufferTooSmall = 3, - UnknownProperty = 4, - InvalidDevice = 5, - CouldNotContactServer = 6, - ValueNotProvidedByDevice = 7, - StringExceedsMaximumLength = 8, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VRSubmitFlags_t { - Default = 0, - LensDistortionAlreadyApplied = 1, - GlRenderBuffer = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VRState_t { - Undefined = -1, - Off = 0, - Searching = 1, - Searching_Alert = 2, - Ready = 3, - Ready_Alert = 4, - NotReady = 5, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVREventType { - None = 0, - TrackedDeviceActivated = 100, - TrackedDeviceDeactivated = 101, - TrackedDeviceUpdated = 102, - TrackedDeviceUserInteractionStarted = 103, - TrackedDeviceUserInteractionEnded = 104, - ButtonPress = 200, - ButtonUnpress = 201, - ButtonTouch = 202, - ButtonUntouch = 203, - MouseMove = 300, - MouseButtonDown = 301, - MouseButtonUp = 302, - FocusEnter = 303, - FocusLeave = 304, - InputFocusCaptured = 400, - InputFocusReleased = 401, - SceneFocusLost = 402, - SceneFocusGained = 403, - SceneApplicationChanged = 404, - SceneFocusChanged = 405, - OverlayShown = 500, - OverlayHidden = 501, - DashboardActivated = 502, - DashboardDeactivated = 503, - DashboardThumbSelected = 504, - DashboardRequested = 505, - ResetDashboard = 506, - RenderToast = 507, - ImageLoaded = 508, - ShowKeyboard = 509, - HideKeyboard = 510, - OverlayGamepadFocusGained = 511, - OverlayGamepadFocusLost = 512, - Notification_Show = 600, - Notification_Dismissed = 601, - Notification_BeginInteraction = 602, - Quit = 700, - ProcessQuit = 701, - ChaperoneDataHasChanged = 800, - ChaperoneUniverseHasChanged = 801, - ChaperoneTempDataHasChanged = 802, - StatusUpdate = 900, - MCImageUpdated = 1000, - FirmwareUpdateStarted = 1100, - FirmwareUpdateFinished = 1101, - KeyboardClosed = 1200, - KeyboardCharInput = 1201, - ApplicationTransitionStarted = 1300, - ApplicationTransitionAborted = 1301, - ApplicationTransitionNewAppStarted = 1302, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EDeviceActivityLevel { - EDeviceActivityLevel_Unknown = -1, - EDeviceActivityLevel_Idle = 0, - EDeviceActivityLevel_UserInteraction = 1, - EDeviceActivityLevel_UserInteraction_Timeout = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRButtonId { - EButton_System = 0, - EButton_ApplicationMenu = 1, - EButton_Grip = 2, - EButton_DPad_Left = 3, - EButton_DPad_Up = 4, - EButton_DPad_Right = 5, - EButton_DPad_Down = 6, - EButton_A = 7, - EButton_Axis0 = 32, - EButton_Axis1 = 33, - EButton_Axis2 = 34, - EButton_Axis3 = 35, - EButton_Axis4 = 36, - EButton_Max = 64, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRMouseButton { - Left = 1, - Right = 2, - Middle = 4, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRControllerAxisType { - eControllerAxis_None = 0, - eControllerAxis_TrackPad = 1, - eControllerAxis_Joystick = 2, - eControllerAxis_Trigger = 3, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRControllerEventOutputType { - OSEvents = 0, - VREvents = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VROverlayError { - None = 0, - UnknownOverlay = 10, - InvalidHandle = 11, - PermissionDenied = 12, - OverlayLimitExceeded = 13, - WrongVisibilityType = 14, - KeyTooLong = 15, - NameTooLong = 16, - KeyInUse = 17, - WrongTransformType = 18, - InvalidTrackedDevice = 19, - InvalidParameter = 20, - ThumbnailCantBeDestroyed = 21, - ArrayTooSmall = 22, - RequestFailed = 23, - InvalidTexture = 24, - UnableToLoadFile = 25, - KeyboardAlreadyInUse = 26, - NoNeighbor = 27, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRApplicationType { - Other = 0, - Scene = 1, - Overlay = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VRFirmwareError { - None = 0, - Success = 1, - Fail = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum HmdError { - None = 0, - Unknown = 1, - Init_InstallationNotFound = 100, - Init_InstallationCorrupt = 101, - Init_VRClientDLLNotFound = 102, - Init_FileNotFound = 103, - Init_FactoryNotFound = 104, - Init_InterfaceNotFound = 105, - Init_InvalidInterface = 106, - Init_UserConfigDirectoryInvalid = 107, - Init_HmdNotFound = 108, - Init_NotInitialized = 109, - Init_PathRegistryNotFound = 110, - Init_NoConfigPath = 111, - Init_NoLogPath = 112, - Init_PathRegistryNotWritable = 113, - Init_AppInfoInitFailed = 114, - Init_Retry = 115, - Init_InitCanceledByUser = 116, - Init_AnotherAppLaunching = 117, - Init_SettingsInitFailed = 118, - Init_ShuttingDown = 119, - Init_TooManyObjects = 120, - Driver_Failed = 200, - Driver_Unknown = 201, - Driver_HmdUnknown = 202, - Driver_NotLoaded = 203, - Driver_RuntimeOutOfDate = 204, - Driver_HmdInUse = 205, - Driver_NotCalibrated = 206, - Driver_CalibrationInvalid = 207, - Driver_HmdDisplayNotFound = 208, - IPC_ServerInitFailed = 300, - IPC_ConnectFailed = 301, - IPC_SharedStateInitFailed = 302, - IPC_CompositorInitFailed = 303, - IPC_MutexInitFailed = 304, - IPC_Failed = 305, - VendorSpecific_UnableToConnectToOculusRuntime = 1000, - VendorSpecific_HmdFound_But = 1100, - VendorSpecific_HmdFound_CantOpenDevice = 1101, - VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102, - VendorSpecific_HmdFound_NoStoredConfig = 1103, - VendorSpecific_HmdFound_ConfigTooBig = 1104, - VendorSpecific_HmdFound_ConfigTooSmall = 1105, - VendorSpecific_HmdFound_UnableToInitZLib = 1106, - VendorSpecific_HmdFound_CantReadFirmwareVersion = 1107, - VendorSpecific_HmdFound_UnableToSendUserDataStart = 1108, - VendorSpecific_HmdFound_UnableToGetUserDataStart = 1109, - VendorSpecific_HmdFound_UnableToGetUserDataNext = 1110, - VendorSpecific_HmdFound_UserDataAddressRange = 1111, - VendorSpecific_HmdFound_UserDataError = 1112, - Steam_SteamInstallationNotFound = 2000, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRApplicationError { - None = 0, - AppKeyAlreadyExists = 100, - NoManifest = 101, - NoApplication = 102, - InvalidIndex = 103, - UnknownApplication = 104, - IPCFailed = 105, - ApplicationAlreadyRunning = 106, - InvalidManifest = 107, - InvalidApplication = 108, - LaunchFailed = 109, - ApplicationAlreadyStarting = 110, - LaunchInProgress = 111, - OldApplicationQuitting = 112, - TransitionAborted = 113, - BufferTooSmall = 200, - PropertyNotSet = 201, - UnknownProperty = 202, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRApplicationProperty { - Name_String = 0, - LaunchType_String = 11, - WorkingDirectory_String = 12, - BinaryPath_String = 13, - Arguments_String = 14, - URL_String = 15, - Description_String = 50, - NewsURL_String = 51, - ImagePath_String = 52, - Source_String = 53, - IsDashboardOverlay_Bool = 60, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRApplicationTransitionState { - None = 0, - OldAppQuitSent = 10, - WaitingForExternalLaunch = 11, - NewAppLaunched = 20, -} - -#[repr(C)] -#[derive(Debug)] -pub enum ChaperoneCalibrationState { - OK = 1, - Warning = 100, - Warning_BaseStationMayHaveMoved = 101, - Warning_BaseStationRemoved = 102, - Warning_SeatedBoundsInvalid = 103, - Error = 200, - Error_BaseStationUninitalized = 201, - Error_BaseStationConflict = 202, - Error_PlayAreaInvalid = 203, - Error_CollisionBoundsInvalid = 204, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VRCompositorError { - None = 0, - IncompatibleVersion = 100, - DoNotHaveFocus = 101, - InvalidTexture = 102, - IsNotSceneApplication = 103, - TextureIsOnWrongDevice = 104, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VROverlayInputMethod { - None = 0, - Mouse = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VROverlayTransformType { - Absolute = 0, - TrackedDeviceRelative = 1, - SystemOverlay = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum VROverlayFlags { - None = 0, - Curved = 1, - RGSS4X = 2, - NoDashboardTab = 3, - AcceptsGamepadEvents = 4, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EGamepadTextInputMode { - EGamepadTextInputModeNormal = 0, - EGamepadTextInputModePassword = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EGamepadTextInputLineMode { - EGamepadTextInputLineModeSingleLine = 0, - EGamepadTextInputLineModeMultipleLines = 1, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EOverlayDirection { - Up = 0, - Down = 1, - Left = 2, - Right = 3, - Count = 4, -} - -#[repr(C)] -#[derive(Debug)] -pub enum NotificationError_t { - ENotificationError_OK = 0, - ENotificationError_Fail = 1, - eNotificationError_InvalidParam = 2, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EVRSettingsError { - None = 0, - IPCFailed = 1, - WriteFailed = 2, - ReadFailed = 3, -} - -#[repr(C)] -#[derive(Debug)] -pub enum ECameraVideoStreamFormat { - FORMAT_UNKNOWN = 0, - FORMAT_RAW10 = 1, - FORMAT_NV12 = 2, - FORMAT_RGB24 = 3, - MAX_FORMATS = 4, -} - -#[repr(C)] -#[derive(Debug)] -pub enum EChaperoneConfigFile { - Live = 1, - Temp = 2, -} +/* automatically generated by rust-bindgen */ +pub type int64_t = ::std::os::raw::c_longlong; +pub type uint64_t = ::std::os::raw::c_ulonglong; +pub type int_least64_t = int64_t; +pub type uint_least64_t = uint64_t; +pub type int_fast64_t = int64_t; +pub type uint_fast64_t = uint64_t; +pub type int32_t = ::std::os::raw::c_int; +pub type uint32_t = ::std::os::raw::c_uint; +pub type int_least32_t = int32_t; +pub type uint_least32_t = uint32_t; +pub type int_fast32_t = int32_t; +pub type uint_fast32_t = uint32_t; +pub type int16_t = ::std::os::raw::c_short; +pub type uint16_t = ::std::os::raw::c_ushort; +pub type int_least16_t = int16_t; +pub type uint_least16_t = uint16_t; +pub type int_fast16_t = int16_t; +pub type uint_fast16_t = uint16_t; +pub type int8_t = ::std::os::raw::c_char; +pub type uint8_t = ::std::os::raw::c_uchar; +pub type int_least8_t = int8_t; +pub type uint_least8_t = uint8_t; +pub type int_fast8_t = int8_t; +pub type uint_fast8_t = uint8_t; +pub type intptr_t = int64_t; +pub type uintptr_t = uint64_t; +pub type intmax_t = ::std::os::raw::c_longlong; +pub type uintmax_t = ::std::os::raw::c_ulonglong; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVREye { EVREye_Eye_Left = 0, EVREye_Eye_Right = 1, } +pub type EVREye = Enum_EVREye; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EGraphicsAPIConvention { + EGraphicsAPIConvention_API_DirectX = 0, + EGraphicsAPIConvention_API_OpenGL = 1, +} +pub type EGraphicsAPIConvention = Enum_EGraphicsAPIConvention; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EColorSpace { + EColorSpace_ColorSpace_Auto = 0, + EColorSpace_ColorSpace_Gamma = 1, + EColorSpace_ColorSpace_Linear = 2, +} +pub type EColorSpace = Enum_EColorSpace; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackingResult { + ETrackingResult_TrackingResult_Uninitialized = 1, + ETrackingResult_TrackingResult_Calibrating_InProgress = 100, + ETrackingResult_TrackingResult_Calibrating_OutOfRange = 101, + ETrackingResult_TrackingResult_Running_OK = 200, + ETrackingResult_TrackingResult_Running_OutOfRange = 201, +} +pub type ETrackingResult = Enum_ETrackingResult; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackedDeviceClass { + ETrackedDeviceClass_TrackedDeviceClass_Invalid = 0, + ETrackedDeviceClass_TrackedDeviceClass_HMD = 1, + ETrackedDeviceClass_TrackedDeviceClass_Controller = 2, + ETrackedDeviceClass_TrackedDeviceClass_TrackingReference = 4, + ETrackedDeviceClass_TrackedDeviceClass_Other = 1000, +} +pub type ETrackedDeviceClass = Enum_ETrackedDeviceClass; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackedControllerRole { + ETrackedControllerRole_TrackedControllerRole_Invalid = 0, + ETrackedControllerRole_TrackedControllerRole_LeftHand = 1, + ETrackedControllerRole_TrackedControllerRole_RightHand = 2, +} +pub type ETrackedControllerRole = Enum_ETrackedControllerRole; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackingUniverseOrigin { + ETrackingUniverseOrigin_TrackingUniverseSeated = 0, + ETrackingUniverseOrigin_TrackingUniverseStanding = 1, + ETrackingUniverseOrigin_TrackingUniverseRawAndUncalibrated = 2, +} +pub type ETrackingUniverseOrigin = Enum_ETrackingUniverseOrigin; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackedDeviceProperty { + ETrackedDeviceProperty_Prop_TrackingSystemName_String = 1000, + ETrackedDeviceProperty_Prop_ModelNumber_String = 1001, + ETrackedDeviceProperty_Prop_SerialNumber_String = 1002, + ETrackedDeviceProperty_Prop_RenderModelName_String = 1003, + ETrackedDeviceProperty_Prop_WillDriftInYaw_Bool = 1004, + ETrackedDeviceProperty_Prop_ManufacturerName_String = 1005, + ETrackedDeviceProperty_Prop_TrackingFirmwareVersion_String = 1006, + ETrackedDeviceProperty_Prop_HardwareRevision_String = 1007, + ETrackedDeviceProperty_Prop_AllWirelessDongleDescriptions_String = 1008, + ETrackedDeviceProperty_Prop_ConnectedWirelessDongle_String = 1009, + ETrackedDeviceProperty_Prop_DeviceIsWireless_Bool = 1010, + ETrackedDeviceProperty_Prop_DeviceIsCharging_Bool = 1011, + ETrackedDeviceProperty_Prop_DeviceBatteryPercentage_Float = 1012, + ETrackedDeviceProperty_Prop_StatusDisplayTransform_Matrix34 = 1013, + ETrackedDeviceProperty_Prop_Firmware_UpdateAvailable_Bool = 1014, + ETrackedDeviceProperty_Prop_Firmware_ManualUpdate_Bool = 1015, + ETrackedDeviceProperty_Prop_Firmware_ManualUpdateURL_String = 1016, + ETrackedDeviceProperty_Prop_HardwareRevision_Uint64 = 1017, + ETrackedDeviceProperty_Prop_FirmwareVersion_Uint64 = 1018, + ETrackedDeviceProperty_Prop_FPGAVersion_Uint64 = 1019, + ETrackedDeviceProperty_Prop_VRCVersion_Uint64 = 1020, + ETrackedDeviceProperty_Prop_RadioVersion_Uint64 = 1021, + ETrackedDeviceProperty_Prop_DongleVersion_Uint64 = 1022, + ETrackedDeviceProperty_Prop_BlockServerShutdown_Bool = 1023, + ETrackedDeviceProperty_Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024, + ETrackedDeviceProperty_Prop_ContainsProximitySensor_Bool = 1025, + ETrackedDeviceProperty_Prop_DeviceProvidesBatteryStatus_Bool = 1026, + ETrackedDeviceProperty_Prop_DeviceCanPowerOff_Bool = 1027, + ETrackedDeviceProperty_Prop_Firmware_ProgrammingTarget_String = 1028, + ETrackedDeviceProperty_Prop_DeviceClass_Int32 = 1029, + ETrackedDeviceProperty_Prop_HasCamera_Bool = 1030, + ETrackedDeviceProperty_Prop_ReportsTimeSinceVSync_Bool = 2000, + ETrackedDeviceProperty_Prop_SecondsFromVsyncToPhotons_Float = 2001, + ETrackedDeviceProperty_Prop_DisplayFrequency_Float = 2002, + ETrackedDeviceProperty_Prop_UserIpdMeters_Float = 2003, + ETrackedDeviceProperty_Prop_CurrentUniverseId_Uint64 = 2004, + ETrackedDeviceProperty_Prop_PreviousUniverseId_Uint64 = 2005, + ETrackedDeviceProperty_Prop_DisplayFirmwareVersion_Uint64 = 2006, + ETrackedDeviceProperty_Prop_IsOnDesktop_Bool = 2007, + ETrackedDeviceProperty_Prop_DisplayMCType_Int32 = 2008, + ETrackedDeviceProperty_Prop_DisplayMCOffset_Float = 2009, + ETrackedDeviceProperty_Prop_DisplayMCScale_Float = 2010, + ETrackedDeviceProperty_Prop_EdidVendorID_Int32 = 2011, + ETrackedDeviceProperty_Prop_DisplayMCImageLeft_String = 2012, + ETrackedDeviceProperty_Prop_DisplayMCImageRight_String = 2013, + ETrackedDeviceProperty_Prop_DisplayGCBlackClamp_Float = 2014, + ETrackedDeviceProperty_Prop_EdidProductID_Int32 = 2015, + ETrackedDeviceProperty_Prop_CameraToHeadTransform_Matrix34 = 2016, + ETrackedDeviceProperty_Prop_DisplayGCType_Int32 = 2017, + ETrackedDeviceProperty_Prop_DisplayGCOffset_Float = 2018, + ETrackedDeviceProperty_Prop_DisplayGCScale_Float = 2019, + ETrackedDeviceProperty_Prop_DisplayGCPrescale_Float = 2020, + ETrackedDeviceProperty_Prop_DisplayGCImage_String = 2021, + ETrackedDeviceProperty_Prop_LensCenterLeftU_Float = 2022, + ETrackedDeviceProperty_Prop_LensCenterLeftV_Float = 2023, + ETrackedDeviceProperty_Prop_LensCenterRightU_Float = 2024, + ETrackedDeviceProperty_Prop_LensCenterRightV_Float = 2025, + ETrackedDeviceProperty_Prop_UserHeadToEyeDepthMeters_Float = 2026, + ETrackedDeviceProperty_Prop_CameraFirmwareVersion_Uint64 = 2027, + ETrackedDeviceProperty_Prop_CameraFirmwareDescription_String = 2028, + ETrackedDeviceProperty_Prop_DisplayFPGAVersion_Uint64 = 2029, + ETrackedDeviceProperty_Prop_DisplayBootloaderVersion_Uint64 = 2030, + ETrackedDeviceProperty_Prop_DisplayHardwareVersion_Uint64 = 2031, + ETrackedDeviceProperty_Prop_AudioFirmwareVersion_Uint64 = 2032, + ETrackedDeviceProperty_Prop_CameraCompatibilityMode_Int32 = 2033, + ETrackedDeviceProperty_Prop_AttachedDeviceId_String = 3000, + ETrackedDeviceProperty_Prop_SupportedButtons_Uint64 = 3001, + ETrackedDeviceProperty_Prop_Axis0Type_Int32 = 3002, + ETrackedDeviceProperty_Prop_Axis1Type_Int32 = 3003, + ETrackedDeviceProperty_Prop_Axis2Type_Int32 = 3004, + ETrackedDeviceProperty_Prop_Axis3Type_Int32 = 3005, + ETrackedDeviceProperty_Prop_Axis4Type_Int32 = 3006, + ETrackedDeviceProperty_Prop_FieldOfViewLeftDegrees_Float = 4000, + ETrackedDeviceProperty_Prop_FieldOfViewRightDegrees_Float = 4001, + ETrackedDeviceProperty_Prop_FieldOfViewTopDegrees_Float = 4002, + ETrackedDeviceProperty_Prop_FieldOfViewBottomDegrees_Float = 4003, + ETrackedDeviceProperty_Prop_TrackingRangeMinimumMeters_Float = 4004, + ETrackedDeviceProperty_Prop_TrackingRangeMaximumMeters_Float = 4005, + ETrackedDeviceProperty_Prop_ModeLabel_String = 4006, + ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_Start = 10000, + ETrackedDeviceProperty_Prop_VendorSpecific_Reserved_End = 10999, +} +pub type ETrackedDeviceProperty = Enum_ETrackedDeviceProperty; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ETrackedPropertyError { + ETrackedPropertyError_TrackedProp_Success = 0, + ETrackedPropertyError_TrackedProp_WrongDataType = 1, + ETrackedPropertyError_TrackedProp_WrongDeviceClass = 2, + ETrackedPropertyError_TrackedProp_BufferTooSmall = 3, + ETrackedPropertyError_TrackedProp_UnknownProperty = 4, + ETrackedPropertyError_TrackedProp_InvalidDevice = 5, + ETrackedPropertyError_TrackedProp_CouldNotContactServer = 6, + ETrackedPropertyError_TrackedProp_ValueNotProvidedByDevice = 7, + ETrackedPropertyError_TrackedProp_StringExceedsMaximumLength = 8, + ETrackedPropertyError_TrackedProp_NotYetAvailable = 9, +} +pub type ETrackedPropertyError = Enum_ETrackedPropertyError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRSubmitFlags { + EVRSubmitFlags_Submit_Default = 0, + EVRSubmitFlags_Submit_LensDistortionAlreadyApplied = 1, + EVRSubmitFlags_Submit_GlRenderBuffer = 2, +} +pub type EVRSubmitFlags = Enum_EVRSubmitFlags; +#[derive(Clone, Copy)] +#[repr(i32)] +pub enum Enum_EVRState { + EVRState_VRState_Undefined = -1, + EVRState_VRState_Off = 0, + EVRState_VRState_Searching = 1, + EVRState_VRState_Searching_Alert = 2, + EVRState_VRState_Ready = 3, + EVRState_VRState_Ready_Alert = 4, + EVRState_VRState_NotReady = 5, +} +pub type EVRState = Enum_EVRState; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVREventType { + EVREventType_VREvent_None = 0, + EVREventType_VREvent_TrackedDeviceActivated = 100, + EVREventType_VREvent_TrackedDeviceDeactivated = 101, + EVREventType_VREvent_TrackedDeviceUpdated = 102, + EVREventType_VREvent_TrackedDeviceUserInteractionStarted = 103, + EVREventType_VREvent_TrackedDeviceUserInteractionEnded = 104, + EVREventType_VREvent_IpdChanged = 105, + EVREventType_VREvent_EnterStandbyMode = 106, + EVREventType_VREvent_LeaveStandbyMode = 107, + EVREventType_VREvent_TrackedDeviceRoleChanged = 108, + EVREventType_VREvent_ButtonPress = 200, + EVREventType_VREvent_ButtonUnpress = 201, + EVREventType_VREvent_ButtonTouch = 202, + EVREventType_VREvent_ButtonUntouch = 203, + EVREventType_VREvent_MouseMove = 300, + EVREventType_VREvent_MouseButtonDown = 301, + EVREventType_VREvent_MouseButtonUp = 302, + EVREventType_VREvent_FocusEnter = 303, + EVREventType_VREvent_FocusLeave = 304, + EVREventType_VREvent_Scroll = 305, + EVREventType_VREvent_TouchPadMove = 306, + EVREventType_VREvent_InputFocusCaptured = 400, + EVREventType_VREvent_InputFocusReleased = 401, + EVREventType_VREvent_SceneFocusLost = 402, + EVREventType_VREvent_SceneFocusGained = 403, + EVREventType_VREvent_SceneApplicationChanged = 404, + EVREventType_VREvent_SceneFocusChanged = 405, + EVREventType_VREvent_HideRenderModels = 410, + EVREventType_VREvent_ShowRenderModels = 411, + EVREventType_VREvent_OverlayShown = 500, + EVREventType_VREvent_OverlayHidden = 501, + EVREventType_VREvent_DashboardActivated = 502, + EVREventType_VREvent_DashboardDeactivated = 503, + EVREventType_VREvent_DashboardThumbSelected = 504, + EVREventType_VREvent_DashboardRequested = 505, + EVREventType_VREvent_ResetDashboard = 506, + EVREventType_VREvent_RenderToast = 507, + EVREventType_VREvent_ImageLoaded = 508, + EVREventType_VREvent_ShowKeyboard = 509, + EVREventType_VREvent_HideKeyboard = 510, + EVREventType_VREvent_OverlayGamepadFocusGained = 511, + EVREventType_VREvent_OverlayGamepadFocusLost = 512, + EVREventType_VREvent_OverlaySharedTextureChanged = 513, + EVREventType_VREvent_Notification_Shown = 600, + EVREventType_VREvent_Notification_Hidden = 601, + EVREventType_VREvent_Notification_BeginInteraction = 602, + EVREventType_VREvent_Notification_Destroyed = 603, + EVREventType_VREvent_Quit = 700, + EVREventType_VREvent_ProcessQuit = 701, + EVREventType_VREvent_QuitAborted_UserPrompt = 702, + EVREventType_VREvent_QuitAcknowledged = 703, + EVREventType_VREvent_ChaperoneDataHasChanged = 800, + EVREventType_VREvent_ChaperoneUniverseHasChanged = 801, + EVREventType_VREvent_ChaperoneTempDataHasChanged = 802, + EVREventType_VREvent_ChaperoneSettingsHaveChanged = 803, + EVREventType_VREvent_SeatedZeroPoseReset = 804, + EVREventType_VREvent_BackgroundSettingHasChanged = 850, + EVREventType_VREvent_CameraSettingsHaveChanged = 851, + EVREventType_VREvent_StatusUpdate = 900, + EVREventType_VREvent_MCImageUpdated = 1000, + EVREventType_VREvent_FirmwareUpdateStarted = 1100, + EVREventType_VREvent_FirmwareUpdateFinished = 1101, + EVREventType_VREvent_KeyboardClosed = 1200, + EVREventType_VREvent_KeyboardCharInput = 1201, + EVREventType_VREvent_KeyboardDone = 1202, + EVREventType_VREvent_ApplicationTransitionStarted = 1300, + EVREventType_VREvent_ApplicationTransitionAborted = 1301, + EVREventType_VREvent_ApplicationTransitionNewAppStarted = 1302, + EVREventType_VREvent_Compositor_MirrorWindowShown = 1400, + EVREventType_VREvent_Compositor_MirrorWindowHidden = 1401, + EVREventType_VREvent_Compositor_ChaperoneBoundsShown = 1410, + EVREventType_VREvent_Compositor_ChaperoneBoundsHidden = 1411, + EVREventType_VREvent_TrackedCamera_StartVideoStream = 1500, + EVREventType_VREvent_TrackedCamera_StopVideoStream = 1501, + EVREventType_VREvent_TrackedCamera_PauseVideoStream = 1502, + EVREventType_VREvent_TrackedCamera_ResumeVideoStream = 1503, + EVREventType_VREvent_PerformanceTest_EnableCapture = 1600, + EVREventType_VREvent_PerformanceTest_DisableCapture = 1601, + EVREventType_VREvent_PerformanceTest_FidelityLevel = 1602, + EVREventType_VREvent_VendorSpecific_Reserved_Start = 10000, + EVREventType_VREvent_VendorSpecific_Reserved_End = 19999, +} +pub type EVREventType = Enum_EVREventType; +#[derive(Clone, Copy)] +#[repr(i32)] +pub enum Enum_EDeviceActivityLevel { + EDeviceActivityLevel_k_EDeviceActivityLevel_Unknown = -1, + EDeviceActivityLevel_k_EDeviceActivityLevel_Idle = 0, + EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction = 1, + EDeviceActivityLevel_k_EDeviceActivityLevel_UserInteraction_Timeout = 2, + EDeviceActivityLevel_k_EDeviceActivityLevel_Standby = 3, +} +pub type EDeviceActivityLevel = Enum_EDeviceActivityLevel; +pub const EVRButtonId_k_EButton_SteamVR_Touchpad: Enum_EVRButtonId = + Enum_EVRButtonId::EVRButtonId_k_EButton_Axis0; +pub const EVRButtonId_k_EButton_SteamVR_Trigger: Enum_EVRButtonId = + Enum_EVRButtonId::EVRButtonId_k_EButton_Axis1; +pub const EVRButtonId_k_EButton_Dashboard_Back: Enum_EVRButtonId = + Enum_EVRButtonId::EVRButtonId_k_EButton_Grip; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRButtonId { + EVRButtonId_k_EButton_System = 0, + EVRButtonId_k_EButton_ApplicationMenu = 1, + EVRButtonId_k_EButton_Grip = 2, + EVRButtonId_k_EButton_DPad_Left = 3, + EVRButtonId_k_EButton_DPad_Up = 4, + EVRButtonId_k_EButton_DPad_Right = 5, + EVRButtonId_k_EButton_DPad_Down = 6, + EVRButtonId_k_EButton_A = 7, + EVRButtonId_k_EButton_Axis0 = 32, + EVRButtonId_k_EButton_Axis1 = 33, + EVRButtonId_k_EButton_Axis2 = 34, + EVRButtonId_k_EButton_Axis3 = 35, + EVRButtonId_k_EButton_Axis4 = 36, + EVRButtonId_k_EButton_Max = 64, +} +pub type EVRButtonId = Enum_EVRButtonId; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRMouseButton { + EVRMouseButton_VRMouseButton_Left = 1, + EVRMouseButton_VRMouseButton_Right = 2, + EVRMouseButton_VRMouseButton_Middle = 4, +} +pub type EVRMouseButton = Enum_EVRMouseButton; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRControllerAxisType { + EVRControllerAxisType_k_eControllerAxis_None = 0, + EVRControllerAxisType_k_eControllerAxis_TrackPad = 1, + EVRControllerAxisType_k_eControllerAxis_Joystick = 2, + EVRControllerAxisType_k_eControllerAxis_Trigger = 3, +} +pub type EVRControllerAxisType = Enum_EVRControllerAxisType; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRControllerEventOutputType { + EVRControllerEventOutputType_ControllerEventOutput_OSEvents = 0, + EVRControllerEventOutputType_ControllerEventOutput_VREvents = 1, +} +pub type EVRControllerEventOutputType = Enum_EVRControllerEventOutputType; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ECollisionBoundsStyle { + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_BEGINNER = 0, + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_INTERMEDIATE = 1, + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_SQUARES = 2, + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_ADVANCED = 3, + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_NONE = 4, + ECollisionBoundsStyle_COLLISION_BOUNDS_STYLE_COUNT = 5, +} +pub type ECollisionBoundsStyle = Enum_ECollisionBoundsStyle; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVROverlayError { + EVROverlayError_VROverlayError_None = 0, + EVROverlayError_VROverlayError_UnknownOverlay = 10, + EVROverlayError_VROverlayError_InvalidHandle = 11, + EVROverlayError_VROverlayError_PermissionDenied = 12, + EVROverlayError_VROverlayError_OverlayLimitExceeded = 13, + EVROverlayError_VROverlayError_WrongVisibilityType = 14, + EVROverlayError_VROverlayError_KeyTooLong = 15, + EVROverlayError_VROverlayError_NameTooLong = 16, + EVROverlayError_VROverlayError_KeyInUse = 17, + EVROverlayError_VROverlayError_WrongTransformType = 18, + EVROverlayError_VROverlayError_InvalidTrackedDevice = 19, + EVROverlayError_VROverlayError_InvalidParameter = 20, + EVROverlayError_VROverlayError_ThumbnailCantBeDestroyed = 21, + EVROverlayError_VROverlayError_ArrayTooSmall = 22, + EVROverlayError_VROverlayError_RequestFailed = 23, + EVROverlayError_VROverlayError_InvalidTexture = 24, + EVROverlayError_VROverlayError_UnableToLoadFile = 25, + EVROverlayError_VROVerlayError_KeyboardAlreadyInUse = 26, + EVROverlayError_VROverlayError_NoNeighbor = 27, +} +pub type EVROverlayError = Enum_EVROverlayError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRApplicationType { + EVRApplicationType_VRApplication_Other = 0, + EVRApplicationType_VRApplication_Scene = 1, + EVRApplicationType_VRApplication_Overlay = 2, + EVRApplicationType_VRApplication_Background = 3, + EVRApplicationType_VRApplication_Utility = 4, +} +pub type EVRApplicationType = Enum_EVRApplicationType; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRFirmwareError { + EVRFirmwareError_VRFirmwareError_None = 0, + EVRFirmwareError_VRFirmwareError_Success = 1, + EVRFirmwareError_VRFirmwareError_Fail = 2, +} +pub type EVRFirmwareError = Enum_EVRFirmwareError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRNotificationError { + EVRNotificationError_VRNotificationError_OK = 0, + EVRNotificationError_VRNotificationError_InvalidNotificationId = 100, + EVRNotificationError_VRNotificationError_NotificationQueueFull = 101, + EVRNotificationError_VRNotificationError_InvalidOverlayHandle = 102, +} +pub type EVRNotificationError = Enum_EVRNotificationError; +#[derive(Clone, Copy, Debug)] +#[repr(u32)] +pub enum Enum_EVRInitError { + EVRInitError_VRInitError_None = 0, + EVRInitError_VRInitError_Unknown = 1, + EVRInitError_VRInitError_Init_InstallationNotFound = 100, + EVRInitError_VRInitError_Init_InstallationCorrupt = 101, + EVRInitError_VRInitError_Init_VRClientDLLNotFound = 102, + EVRInitError_VRInitError_Init_FileNotFound = 103, + EVRInitError_VRInitError_Init_FactoryNotFound = 104, + EVRInitError_VRInitError_Init_InterfaceNotFound = 105, + EVRInitError_VRInitError_Init_InvalidInterface = 106, + EVRInitError_VRInitError_Init_UserConfigDirectoryInvalid = 107, + EVRInitError_VRInitError_Init_HmdNotFound = 108, + EVRInitError_VRInitError_Init_NotInitialized = 109, + EVRInitError_VRInitError_Init_PathRegistryNotFound = 110, + EVRInitError_VRInitError_Init_NoConfigPath = 111, + EVRInitError_VRInitError_Init_NoLogPath = 112, + EVRInitError_VRInitError_Init_PathRegistryNotWritable = 113, + EVRInitError_VRInitError_Init_AppInfoInitFailed = 114, + EVRInitError_VRInitError_Init_Retry = 115, + EVRInitError_VRInitError_Init_InitCanceledByUser = 116, + EVRInitError_VRInitError_Init_AnotherAppLaunching = 117, + EVRInitError_VRInitError_Init_SettingsInitFailed = 118, + EVRInitError_VRInitError_Init_ShuttingDown = 119, + EVRInitError_VRInitError_Init_TooManyObjects = 120, + EVRInitError_VRInitError_Init_NoServerForBackgroundApp = 121, + EVRInitError_VRInitError_Init_NotSupportedWithCompositor = 122, + EVRInitError_VRInitError_Init_NotAvailableToUtilityApps = 123, + EVRInitError_VRInitError_Driver_Failed = 200, + EVRInitError_VRInitError_Driver_Unknown = 201, + EVRInitError_VRInitError_Driver_HmdUnknown = 202, + EVRInitError_VRInitError_Driver_NotLoaded = 203, + EVRInitError_VRInitError_Driver_RuntimeOutOfDate = 204, + EVRInitError_VRInitError_Driver_HmdInUse = 205, + EVRInitError_VRInitError_Driver_NotCalibrated = 206, + EVRInitError_VRInitError_Driver_CalibrationInvalid = 207, + EVRInitError_VRInitError_Driver_HmdDisplayNotFound = 208, + EVRInitError_VRInitError_IPC_ServerInitFailed = 300, + EVRInitError_VRInitError_IPC_ConnectFailed = 301, + EVRInitError_VRInitError_IPC_SharedStateInitFailed = 302, + EVRInitError_VRInitError_IPC_CompositorInitFailed = 303, + EVRInitError_VRInitError_IPC_MutexInitFailed = 304, + EVRInitError_VRInitError_IPC_Failed = 305, + EVRInitError_VRInitError_Compositor_Failed = 400, + EVRInitError_VRInitError_Compositor_D3D11HardwareRequired = 401, + EVRInitError_VRInitError_VendorSpecific_UnableToConnectToOculusRuntime = + 1000, + EVRInitError_VRInitError_VendorSpecific_HmdFound_CantOpenDevice = 1101, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart + = 1102, + EVRInitError_VRInitError_VendorSpecific_HmdFound_NoStoredConfig = 1103, + EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooBig = 1104, + EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigTooSmall = 1105, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToInitZLib = 1106, + EVRInitError_VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion = + 1107, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart + = 1108, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart + = 1109, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext = + 1110, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataAddressRange = + 1111, + EVRInitError_VRInitError_VendorSpecific_HmdFound_UserDataError = 1112, + EVRInitError_VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck = + 1113, + EVRInitError_VRInitError_Steam_SteamInstallationNotFound = 2000, +} +pub type EVRInitError = Enum_EVRInitError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRApplicationError { + EVRApplicationError_VRApplicationError_None = 0, + EVRApplicationError_VRApplicationError_AppKeyAlreadyExists = 100, + EVRApplicationError_VRApplicationError_NoManifest = 101, + EVRApplicationError_VRApplicationError_NoApplication = 102, + EVRApplicationError_VRApplicationError_InvalidIndex = 103, + EVRApplicationError_VRApplicationError_UnknownApplication = 104, + EVRApplicationError_VRApplicationError_IPCFailed = 105, + EVRApplicationError_VRApplicationError_ApplicationAlreadyRunning = 106, + EVRApplicationError_VRApplicationError_InvalidManifest = 107, + EVRApplicationError_VRApplicationError_InvalidApplication = 108, + EVRApplicationError_VRApplicationError_LaunchFailed = 109, + EVRApplicationError_VRApplicationError_ApplicationAlreadyStarting = 110, + EVRApplicationError_VRApplicationError_LaunchInProgress = 111, + EVRApplicationError_VRApplicationError_OldApplicationQuitting = 112, + EVRApplicationError_VRApplicationError_TransitionAborted = 113, + EVRApplicationError_VRApplicationError_IsTemplate = 114, + EVRApplicationError_VRApplicationError_BufferTooSmall = 200, + EVRApplicationError_VRApplicationError_PropertyNotSet = 201, + EVRApplicationError_VRApplicationError_UnknownProperty = 202, +} +pub type EVRApplicationError = Enum_EVRApplicationError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRApplicationProperty { + EVRApplicationProperty_VRApplicationProperty_Name_String = 0, + EVRApplicationProperty_VRApplicationProperty_LaunchType_String = 11, + EVRApplicationProperty_VRApplicationProperty_WorkingDirectory_String = 12, + EVRApplicationProperty_VRApplicationProperty_BinaryPath_String = 13, + EVRApplicationProperty_VRApplicationProperty_Arguments_String = 14, + EVRApplicationProperty_VRApplicationProperty_URL_String = 15, + EVRApplicationProperty_VRApplicationProperty_Description_String = 50, + EVRApplicationProperty_VRApplicationProperty_NewsURL_String = 51, + EVRApplicationProperty_VRApplicationProperty_ImagePath_String = 52, + EVRApplicationProperty_VRApplicationProperty_Source_String = 53, + EVRApplicationProperty_VRApplicationProperty_IsDashboardOverlay_Bool = 60, + EVRApplicationProperty_VRApplicationProperty_IsTemplate_Bool = 61, + EVRApplicationProperty_VRApplicationProperty_IsInstanced_Bool = 62, + EVRApplicationProperty_VRApplicationProperty_LastLaunchTime_Uint64 = 70, +} +pub type EVRApplicationProperty = Enum_EVRApplicationProperty; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRApplicationTransitionState { + EVRApplicationTransitionState_VRApplicationTransition_None = 0, + EVRApplicationTransitionState_VRApplicationTransition_OldAppQuitSent = 10, + EVRApplicationTransitionState_VRApplicationTransition_WaitingForExternalLaunch + = 11, + EVRApplicationTransitionState_VRApplicationTransition_NewAppLaunched = 20, +} +pub type EVRApplicationTransitionState = Enum_EVRApplicationTransitionState; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_ChaperoneCalibrationState { + ChaperoneCalibrationState_OK = 1, + ChaperoneCalibrationState_Warning = 100, + ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved = 101, + ChaperoneCalibrationState_Warning_BaseStationRemoved = 102, + ChaperoneCalibrationState_Warning_SeatedBoundsInvalid = 103, + ChaperoneCalibrationState_Error = 200, + ChaperoneCalibrationState_Error_BaseStationUninitalized = 201, + ChaperoneCalibrationState_Error_BaseStationConflict = 202, + ChaperoneCalibrationState_Error_PlayAreaInvalid = 203, + ChaperoneCalibrationState_Error_CollisionBoundsInvalid = 204, +} +pub type ChaperoneCalibrationState = Enum_ChaperoneCalibrationState; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EChaperoneConfigFile { + EChaperoneConfigFile_Live = 1, + EChaperoneConfigFile_Temp = 2, +} +pub type EChaperoneConfigFile = Enum_EChaperoneConfigFile; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EChaperoneImportFlags { + EChaperoneImportFlags_EChaperoneImport_BoundsOnly = 1, +} +pub type EChaperoneImportFlags = Enum_EChaperoneImportFlags; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRCompositorError { + EVRCompositorError_VRCompositorError_None = 0, + EVRCompositorError_VRCompositorError_IncompatibleVersion = 100, + EVRCompositorError_VRCompositorError_DoNotHaveFocus = 101, + EVRCompositorError_VRCompositorError_InvalidTexture = 102, + EVRCompositorError_VRCompositorError_IsNotSceneApplication = 103, + EVRCompositorError_VRCompositorError_TextureIsOnWrongDevice = 104, + EVRCompositorError_VRCompositorError_TextureUsesUnsupportedFormat = 105, + EVRCompositorError_VRCompositorError_SharedTexturesNotSupported = 106, + EVRCompositorError_VRCompositorError_IndexOutOfRange = 107, +} +pub type EVRCompositorError = Enum_EVRCompositorError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_VROverlayInputMethod { + VROverlayInputMethod_None = 0, + VROverlayInputMethod_Mouse = 1, +} +pub type VROverlayInputMethod = Enum_VROverlayInputMethod; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_VROverlayTransformType { + VROverlayTransformType_VROverlayTransform_Absolute = 0, + VROverlayTransformType_VROverlayTransform_TrackedDeviceRelative = 1, + VROverlayTransformType_VROverlayTransform_SystemOverlay = 2, + VROverlayTransformType_VROverlayTransform_TrackedComponent = 3, +} +pub type VROverlayTransformType = Enum_VROverlayTransformType; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_VROverlayFlags { + VROverlayFlags_None = 0, + VROverlayFlags_Curved = 1, + VROverlayFlags_RGSS4X = 2, + VROverlayFlags_NoDashboardTab = 3, + VROverlayFlags_AcceptsGamepadEvents = 4, + VROverlayFlags_ShowGamepadFocus = 5, + VROverlayFlags_SendVRScrollEvents = 6, + VROverlayFlags_SendVRTouchpadEvents = 7, + VROverlayFlags_ShowTouchPadScrollWheel = 8, +} +pub type VROverlayFlags = Enum_VROverlayFlags; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EGamepadTextInputMode { + EGamepadTextInputMode_k_EGamepadTextInputModeNormal = 0, + EGamepadTextInputMode_k_EGamepadTextInputModePassword = 1, + EGamepadTextInputMode_k_EGamepadTextInputModeSubmit = 2, +} +pub type EGamepadTextInputMode = Enum_EGamepadTextInputMode; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EGamepadTextInputLineMode { + EGamepadTextInputLineMode_k_EGamepadTextInputLineModeSingleLine = 0, + EGamepadTextInputLineMode_k_EGamepadTextInputLineModeMultipleLines = 1, +} +pub type EGamepadTextInputLineMode = Enum_EGamepadTextInputLineMode; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EOverlayDirection { + EOverlayDirection_OverlayDirection_Up = 0, + EOverlayDirection_OverlayDirection_Down = 1, + EOverlayDirection_OverlayDirection_Left = 2, + EOverlayDirection_OverlayDirection_Right = 3, + EOverlayDirection_OverlayDirection_Count = 4, +} +pub type EOverlayDirection = Enum_EOverlayDirection; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRRenderModelError { + EVRRenderModelError_VRRenderModelError_None = 0, + EVRRenderModelError_VRRenderModelError_Loading = 100, + EVRRenderModelError_VRRenderModelError_NotSupported = 200, + EVRRenderModelError_VRRenderModelError_InvalidArg = 300, + EVRRenderModelError_VRRenderModelError_InvalidModel = 301, + EVRRenderModelError_VRRenderModelError_NoShapes = 302, + EVRRenderModelError_VRRenderModelError_MultipleShapes = 303, + EVRRenderModelError_VRRenderModelError_TooManyIndices = 304, + EVRRenderModelError_VRRenderModelError_MultipleTextures = 305, + EVRRenderModelError_VRRenderModelError_InvalidTexture = 400, +} +pub type EVRRenderModelError = Enum_EVRRenderModelError; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRComponentProperty { + EVRComponentProperty_VRComponentProperty_IsStatic = 1, + EVRComponentProperty_VRComponentProperty_IsVisible = 2, + EVRComponentProperty_VRComponentProperty_IsTouched = 4, + EVRComponentProperty_VRComponentProperty_IsPressed = 8, + EVRComponentProperty_VRComponentProperty_IsScrolled = 16, +} +pub type EVRComponentProperty = Enum_EVRComponentProperty; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRNotificationType { + EVRNotificationType_Transient = 0, + EVRNotificationType_Persistent = 1, +} +pub type EVRNotificationType = Enum_EVRNotificationType; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRNotificationStyle { + EVRNotificationStyle_None = 0, + EVRNotificationStyle_Application = 100, + EVRNotificationStyle_Contact_Disabled = 200, + EVRNotificationStyle_Contact_Enabled = 201, + EVRNotificationStyle_Contact_Active = 202, +} +pub type EVRNotificationStyle = Enum_EVRNotificationStyle; +#[derive(Clone, Copy)] +#[repr(u32)] +pub enum Enum_EVRSettingsError { + EVRSettingsError_VRSettingsError_None = 0, + EVRSettingsError_VRSettingsError_IPCFailed = 1, + EVRSettingsError_VRSettingsError_WriteFailed = 2, + EVRSettingsError_VRSettingsError_ReadFailed = 3, +} +pub type EVRSettingsError = Enum_EVRSettingsError; +pub type TrackedDeviceIndex_t = uint32_t; +pub type VRNotificationId = uint32_t; +pub type VROverlayHandle_t = uint64_t; +pub type glSharedTextureHandle_t = *mut ::std::os::raw::c_void; +pub type glInt_t = int32_t; +pub type glUInt_t = uint32_t; +pub type VRComponentProperties = uint32_t; +pub type TextureID_t = int32_t; +pub type HmdError = EVRInitError; +pub type Hmd_Eye = EVREye; +pub type GraphicsAPIConvention = EGraphicsAPIConvention; +pub type ColorSpace = EColorSpace; +pub type HmdTrackingResult = ETrackingResult; +pub type TrackedDeviceClass = ETrackedDeviceClass; +pub type TrackingUniverseOrigin = ETrackingUniverseOrigin; +pub type TrackedDeviceProperty = ETrackedDeviceProperty; +pub type TrackedPropertyError = ETrackedPropertyError; +pub type VRSubmitFlags_t = EVRSubmitFlags; +pub type VRState_t = EVRState; +pub type CollisionBoundsStyle_t = ECollisionBoundsStyle; +pub type VROverlayError = EVROverlayError; +pub type VRFirmwareError = EVRFirmwareError; +pub type VRCompositorError = EVRCompositorError; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdMatrix34_t { + pub m: [[::std::os::raw::c_float; 4usize]; 3usize], +} +impl ::std::clone::Clone for Struct_HmdMatrix34_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdMatrix34_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdMatrix34_t = Struct_HmdMatrix34_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdMatrix44_t { + pub m: [[::std::os::raw::c_float; 4usize]; 4usize], +} +impl ::std::clone::Clone for Struct_HmdMatrix44_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdMatrix44_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdMatrix44_t = Struct_HmdMatrix44_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdVector3_t { + pub v: [::std::os::raw::c_float; 3usize], +} +impl ::std::clone::Clone for Struct_HmdVector3_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdVector3_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdVector3_t = Struct_HmdVector3_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdVector4_t { + pub v: [::std::os::raw::c_float; 4usize], +} +impl ::std::clone::Clone for Struct_HmdVector4_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdVector4_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdVector4_t = Struct_HmdVector4_t; #[repr(C)] -pub struct HmdMatrix34_t { - //float [3][4] - pub m: [[f32; 4]; 3], +#[derive(Copy)] +pub struct Struct_HmdVector3d_t { + pub v: [::std::os::raw::c_double; 3usize], } -#[repr(C)] -pub struct HmdMatrix44_t { - //float [4][4] - pub m: [[f32; 4]; 4], -} -#[repr(C)] -pub struct HmdVector3_t { - //float [3] - pub v: [f32; 3], +impl ::std::clone::Clone for Struct_HmdVector3d_t { + fn clone(&self) -> Self { *self } } +impl ::std::default::Default for Struct_HmdVector3d_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdVector3d_t = Struct_HmdVector3d_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdVector2_t { + pub v: [::std::os::raw::c_float; 2usize], +} +impl ::std::clone::Clone for Struct_HmdVector2_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdVector2_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdVector2_t = Struct_HmdVector2_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdQuaternion_t { + pub w: ::std::os::raw::c_double, + pub x: ::std::os::raw::c_double, + pub y: ::std::os::raw::c_double, + pub z: ::std::os::raw::c_double, +} +impl ::std::clone::Clone for Struct_HmdQuaternion_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdQuaternion_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdQuaternion_t = Struct_HmdQuaternion_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdColor_t { + pub r: ::std::os::raw::c_float, + pub g: ::std::os::raw::c_float, + pub b: ::std::os::raw::c_float, + pub a: ::std::os::raw::c_float, +} +impl ::std::clone::Clone for Struct_HmdColor_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdColor_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdColor_t = Struct_HmdColor_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdQuad_t { + pub vCorners: [Struct_HmdVector3_t; 4usize], +} +impl ::std::clone::Clone for Struct_HmdQuad_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdQuad_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdQuad_t = Struct_HmdQuad_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HmdRect2_t { + pub vTopLeft: Struct_HmdVector2_t, + pub vBottomRight: Struct_HmdVector2_t, +} +impl ::std::clone::Clone for Struct_HmdRect2_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HmdRect2_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HmdRect2_t = Struct_HmdRect2_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_DistortionCoordinates_t { + pub rfRed: [::std::os::raw::c_float; 2usize], + pub rfGreen: [::std::os::raw::c_float; 2usize], + pub rfBlue: [::std::os::raw::c_float; 2usize], +} +impl ::std::clone::Clone for Struct_DistortionCoordinates_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_DistortionCoordinates_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type DistortionCoordinates_t = Struct_DistortionCoordinates_t; #[repr(C)] -pub struct HmdVector4_t { - //float [4] - pub v: [f32; 4], -} -#[repr(C)] -pub struct HmdVector3d_t { - //double [3] - pub v: [f64; 3], -} -#[repr(C)] -pub struct HmdVector2_t { - //float [2] - pub v: [f32; 2], -} +#[derive(Copy)] +pub struct Struct_Texture_t { + pub handle: *mut ::std::os::raw::c_void, + pub eType: Enum_EGraphicsAPIConvention, + pub eColorSpace: Enum_EColorSpace, +} +impl ::std::clone::Clone for Struct_Texture_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_Texture_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type Texture_t = Struct_Texture_t; #[repr(C)] -pub struct HmdQuaternion_t { - //double - pub w: f64, - //double - pub x: f64, - //double - pub y: f64, - //double - pub z: f64, +#[derive(Copy)] +pub struct Struct_TrackedDevicePose_t { + pub mDeviceToAbsoluteTracking: Struct_HmdMatrix34_t, + pub vVelocity: Struct_HmdVector3_t, + pub vAngularVelocity: Struct_HmdVector3_t, + pub eTrackingResult: Enum_ETrackingResult, + pub bPoseIsValid: u8, + pub bDeviceIsConnected: u8, +} +impl ::std::clone::Clone for Struct_TrackedDevicePose_t { + fn clone(&self) -> Self { *self } } -#[repr(C)] -pub struct HmdColor_t { - //float - pub r: f32, - //float - pub g: f32, - //float - pub b: f32, - //float - pub a: f32, -} -#[repr(C)] -pub struct HmdQuad_t { - //struct vr::HmdVector3_t [4] - pub vCorners: [HmdVector3_t ; 4], -} -#[repr(C)] -pub struct DistortionCoordinates_t { - //float [2] - pub rfRed: [f32; 2], - //float [2] - pub rfGreen: [f32; 2], - //float [2] - pub rfBlue: [f32; 2], +impl ::std::default::Default for Struct_TrackedDevicePose_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } } +pub type TrackedDevicePose_t = Struct_TrackedDevicePose_t; #[repr(C)] -pub struct TrackedDevicePose_t { - //struct vr::HmdMatrix34_t - pub mDeviceToAbsoluteTracking: HmdMatrix34_t, - //struct vr::HmdVector3_t - pub vVelocity: HmdVector3_t, - //struct vr::HmdVector3_t - pub vAngularVelocity: HmdVector3_t, - //enum vr::HmdTrackingResult - pub eTrackingResult: HmdTrackingResult, - //_Bool - pub bPoseIsValid: bool, - //_Bool - pub bDeviceIsConnected: bool, +#[derive(Copy)] +pub struct Struct_VRTextureBounds_t { + pub uMin: ::std::os::raw::c_float, + pub vMin: ::std::os::raw::c_float, + pub uMax: ::std::os::raw::c_float, + pub vMax: ::std::os::raw::c_float, } +impl ::std::clone::Clone for Struct_VRTextureBounds_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VRTextureBounds_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VRTextureBounds_t = Struct_VRTextureBounds_t; #[repr(C)] -pub struct RenderModel_Vertex_t { - //struct vr::HmdVector3_t - pub vPosition: HmdVector3_t, - //struct vr::HmdVector3_t - pub vNormal: HmdVector3_t, - //float [2] - pub rfTextureCoord: [f32; 2], +#[derive(Copy)] +pub struct Struct_VREvent_Controller_t { + pub button: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_Controller_t { + fn clone(&self) -> Self { *self } } +impl ::std::default::Default for Struct_VREvent_Controller_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Controller_t = Struct_VREvent_Controller_t; #[repr(C)] -pub struct RenderModel_TextureMap_t { - //uint16_t - pub unWidth: u16, - //uint16_t - pub unHeight: u16, - //const uint8_t * - pub rubTextureMapData: *mut u8, +#[derive(Copy)] +pub struct Struct_VREvent_Mouse_t { + pub x: ::std::os::raw::c_float, + pub y: ::std::os::raw::c_float, + pub button: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_Mouse_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Mouse_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } } +pub type VREvent_Mouse_t = Struct_VREvent_Mouse_t; #[repr(C)] -pub struct RenderModel_t { - //uint64_t - pub ulInternalHandle: u64, - //const struct vr::RenderModel_Vertex_t * - pub rVertexData: *mut RenderModel_Vertex_t, - //uint32_t - pub unVertexCount: u32, - //const uint16_t * - pub rIndexData: *mut u16, - //uint32_t - pub unTriangleCount: u32, - //struct vr::RenderModel_TextureMap_t - pub diffuseTexture: RenderModel_TextureMap_t, +#[derive(Copy)] +pub struct Struct_VREvent_Scroll_t { + pub xdelta: ::std::os::raw::c_float, + pub ydelta: ::std::os::raw::c_float, + pub repeatCount: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_Scroll_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Scroll_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Scroll_t = Struct_VREvent_Scroll_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_TouchPadMove_t { + pub bFingerDown: u8, + pub flSecondsFingerDown: ::std::os::raw::c_float, + pub fValueXFirst: ::std::os::raw::c_float, + pub fValueYFirst: ::std::os::raw::c_float, + pub fValueXRaw: ::std::os::raw::c_float, + pub fValueYRaw: ::std::os::raw::c_float, +} +impl ::std::clone::Clone for Struct_VREvent_TouchPadMove_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_TouchPadMove_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_TouchPadMove_t = Struct_VREvent_TouchPadMove_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Notification_t { + pub ulUserValue: uint64_t, + pub notificationId: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_Notification_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Notification_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Notification_t = Struct_VREvent_Notification_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Process_t { + pub pid: uint32_t, + pub oldPid: uint32_t, + pub bForced: u8, +} +impl ::std::clone::Clone for Struct_VREvent_Process_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Process_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Process_t = Struct_VREvent_Process_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Overlay_t { + pub overlayHandle: uint64_t, +} +impl ::std::clone::Clone for Struct_VREvent_Overlay_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Overlay_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Overlay_t = Struct_VREvent_Overlay_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Status_t { + pub statusState: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_Status_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Status_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Status_t = Struct_VREvent_Status_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Keyboard_t { + pub cNewInput: [*mut ::std::os::raw::c_char; 8usize], + pub uUserValue: uint64_t, +} +impl ::std::clone::Clone for Struct_VREvent_Keyboard_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Keyboard_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Keyboard_t = Struct_VREvent_Keyboard_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Ipd_t { + pub ipdMeters: ::std::os::raw::c_float, +} +impl ::std::clone::Clone for Struct_VREvent_Ipd_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Ipd_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Ipd_t = Struct_VREvent_Ipd_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Chaperone_t { + pub m_nPreviousUniverse: uint64_t, + pub m_nCurrentUniverse: uint64_t, +} +impl ::std::clone::Clone for Struct_VREvent_Chaperone_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Chaperone_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Chaperone_t = Struct_VREvent_Chaperone_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_Reserved_t { + pub reserved0: uint64_t, + pub reserved1: uint64_t, +} +impl ::std::clone::Clone for Struct_VREvent_Reserved_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_Reserved_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Reserved_t = Struct_VREvent_Reserved_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_PerformanceTest_t { + pub m_nFidelityLevel: uint32_t, +} +impl ::std::clone::Clone for Struct_VREvent_PerformanceTest_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_PerformanceTest_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_PerformanceTest_t = Struct_VREvent_PerformanceTest_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_SeatedZeroPoseReset_t { + pub bResetBySystemMenu: u8, +} +impl ::std::clone::Clone for Struct_VREvent_SeatedZeroPoseReset_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_SeatedZeroPoseReset_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_SeatedZeroPoseReset_t = Struct_VREvent_SeatedZeroPoseReset_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_HiddenAreaMesh_t { + pub pVertexData: *mut Struct_HmdVector2_t, + pub unTriangleCount: uint32_t, +} +impl ::std::clone::Clone for Struct_HiddenAreaMesh_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_HiddenAreaMesh_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type HiddenAreaMesh_t = Struct_HiddenAreaMesh_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VRControllerAxis_t { + pub x: ::std::os::raw::c_float, + pub y: ::std::os::raw::c_float, +} +impl ::std::clone::Clone for Struct_VRControllerAxis_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VRControllerAxis_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VRControllerAxis_t = Struct_VRControllerAxis_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VRControllerState_t { + pub unPacketNum: uint32_t, + pub ulButtonPressed: uint64_t, + pub ulButtonTouched: uint64_t, + pub rAxis: [Struct_VRControllerAxis_t; 5usize], +} +impl ::std::clone::Clone for Struct_VRControllerState_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VRControllerState_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VRControllerState_t = Struct_VRControllerState_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_Compositor_OverlaySettings { + pub size: uint32_t, + pub curved: u8, + pub antialias: u8, + pub scale: ::std::os::raw::c_float, + pub distance: ::std::os::raw::c_float, + pub alpha: ::std::os::raw::c_float, + pub uOffset: ::std::os::raw::c_float, + pub vOffset: ::std::os::raw::c_float, + pub uScale: ::std::os::raw::c_float, + pub vScale: ::std::os::raw::c_float, + pub gridDivs: ::std::os::raw::c_float, + pub gridWidth: ::std::os::raw::c_float, + pub gridScale: ::std::os::raw::c_float, + pub transform: Struct_HmdMatrix44_t, +} +impl ::std::clone::Clone for Struct_Compositor_OverlaySettings { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_Compositor_OverlaySettings { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type Compositor_OverlaySettings = Struct_Compositor_OverlaySettings; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_AppOverrideKeys_t { + pub pchKey: *mut ::std::os::raw::c_char, + pub pchValue: *mut ::std::os::raw::c_char, +} +impl ::std::clone::Clone for Struct_AppOverrideKeys_t { + fn clone(&self) -> Self { *self } } +impl ::std::default::Default for Struct_AppOverrideKeys_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type AppOverrideKeys_t = Struct_AppOverrideKeys_t; #[repr(C)] -pub struct VRTextureBounds_t { - //float - pub uMin: f32, - //float - pub vMin: f32, - //float - pub uMax: f32, - //float - pub vMax: f32, -} -#[repr(C)] -pub struct VREvent_Controller_t { - //enum vr::EVRButtonId - pub button: EVRButtonId, -} -#[repr(C)] -pub struct VREvent_Mouse_t { - //float - pub x: f32, - //float - pub y: f32, - //enum vr::EVRMouseButton - pub button: EVRMouseButton, -} -#[repr(C)] -pub struct VREvent_Notification_t { - //uint64_t - pub ulUserValue: u64, - //uint32_t - pub notificationId: u32, -} -#[repr(C)] -pub struct VREvent_Process_t { - //uint32_t - pub pid: u32, - //uint32_t - pub oldPid: u32, -} -#[repr(C)] -pub struct VREvent_Overlay_t { - //uint64_t - pub overlayHandle: u64, -} -#[repr(C)] -pub struct VREvent_Status_t { - //enum vr::VRState_t - pub statusState: VRState_t, -} -#[repr(C)] -pub struct VREvent_Keyboard_t { - //char [8] - pub cNewInput: [char ; 8], - //uint64_t - pub uUserValue: u64, -} -#[repr(C)] -pub struct VREvent_Reserved_t { - //uint64_t - pub reserved0: u64, - //uint64_t - pub reserved1: u64, -} -#[repr(C)] -pub struct VREvent_t { - //enum vr::EVREventType - pub eventType: EVREventType, - //TrackedDeviceIndex_t - pub trackedDeviceIndex: TrackedDeviceIndex_t, - //VREvent_Data_t - pub data: VREvent_Data_t, - //float - pub eventAgeSeconds: f32, -} -#[repr(C)] -pub struct HiddenAreaMesh_t { - //const struct vr::HmdVector2_t * - pub pVertexData: *mut HmdVector2_t, - //uint32_t - pub unTriangleCount: u32, -} -#[repr(C)] -pub struct VRControllerAxis_t { - //float - pub x: f32, - //float - pub y: f32, -} -#[repr(C)] -pub struct VRControllerState001_t { - //uint32_t - pub unPacketNum: u32, - //uint64_t - pub ulButtonPressed: u64, - //uint64_t - pub ulButtonTouched: u64, - //struct vr::VRControllerAxis_t [5] - pub rAxis: [VRControllerAxis_t ; 5], -} -#[repr(C)] -pub struct Compositor_OverlaySettings { - //uint32_t - pub size: u32, - //_Bool - pub curved: bool, - //_Bool - pub antialias: bool, - //float - pub scale: f32, - //float - pub distance: f32, - //float - pub alpha: f32, - //float - pub uOffset: f32, - //float - pub vOffset: f32, - //float - pub uScale: f32, - //float - pub vScale: f32, - //float - pub gridDivs: f32, - //float - pub gridWidth: f32, - //float - pub gridScale: f32, - //struct vr::HmdMatrix44_t - pub transform: HmdMatrix44_t, -} -#[repr(C)] -pub struct ChaperoneSoftBoundsInfo_t { - //struct vr::HmdQuad_t - pub quadCorners: HmdQuad_t, -} -#[repr(C)] -pub struct ChaperoneSeatedBoundsInfo_t { - //struct vr::HmdVector3_t - pub vSeatedHeadPosition: HmdVector3_t, - //struct vr::HmdVector3_t [2] - pub vDeskEdgePositions: [HmdVector3_t ; 2], -} -#[repr(C)] -pub struct Compositor_FrameTiming { - //uint32_t - pub size: u32, - //double - pub frameStart: f64, - //float - pub frameVSync: f32, - //uint32_t - pub droppedFrames: u32, - //uint32_t - pub frameIndex: u32, - //vr::TrackedDevicePose_t - pub pose: TrackedDevicePose_t, - //float - pub prediction: f32, - //float - pub m_flFrameIntervalMs: f32, - //float - pub m_flSceneRenderCpuMs: f32, - //float - pub m_flSceneRenderGpuMs: f32, - //float - pub m_flCompositorRenderCpuMs: f32, - //float - pub m_flCompositorRenderGpuMs: f32, - //float - pub m_flPresentCallCpuMs: f32, - //float - pub m_flRunningStartMs: f32, - //float - pub m_flHandoffStartMs: f32, - //float - pub m_flHandoffEndMs: f32, -} -#[repr(C)] -pub struct VROverlayIntersectionParams_t { - //struct vr::HmdVector3_t - pub vSource: HmdVector3_t, - //struct vr::HmdVector3_t - pub vDirection: HmdVector3_t, - //enum vr::TrackingUniverseOrigin - pub eOrigin: TrackingUniverseOrigin, -} -#[repr(C)] -pub struct VROverlayIntersectionResults_t { - //struct vr::HmdVector3_t - pub vPoint: HmdVector3_t, - //struct vr::HmdVector3_t - pub vNormal: HmdVector3_t, - //struct vr::HmdVector2_t - pub vUVs: HmdVector2_t, - //float - pub fDistance: f32, -} -#[repr(C)] -pub struct ComponentState_t { - //struct vr::HmdMatrix34_t - pub mTrackingToComponentRenderModel: HmdMatrix34_t, - //struct vr::HmdMatrix34_t - pub mTrackingToComponentLocal: HmdMatrix34_t, - //_Bool - pub bIsStatic: bool, - //_Bool - pub bIsVisible: bool, -} -#[repr(C)] -pub struct NotificationBitmap { - //void * - pub bytes: *mut (), - //int32_t - pub width: i32, - //int32_t - pub height: i32, - //int32_t - pub depth: i32, -} -#[repr(C)] -pub struct NotificationItem { - //VRNotificationId - pub notificationId: VRNotificationId, -} -#[repr(C)] -pub struct CameraVideoStreamFrame_t { - //enum vr::ECameraVideoStreamFormat - pub m_nStreamFormat: ECameraVideoStreamFormat, - //uint32_t - pub m_nWidth: u32, - //uint32_t - pub m_nHeight: u32, - //uint32_t - pub m_nFrameSequence: u32, - //uint32_t - pub m_nTimeStamp: u32, - //uint32_t - pub m_nBufferIndex: u32, - //uint32_t - pub m_nBufferCount: u32, - //uint32_t - pub m_nImageDataSize: u32, - //double - pub m_flFrameTime: f64, - //_Bool - pub m_bPoseValid: bool, - //float [16] - pub m_HMDPoseMatrix: [f32; 16], - //void * - pub m_pImageData: *mut (), -} -#[repr(C)] -pub struct TrackedCameraCalibrationDevOnly_t { - //double - pub m_flIntrinsicsFX: f64, - //double - pub m_flIntrinsicsFY: f64, - //double - pub m_flIntrinsicsCX: f64, - //double - pub m_flIntrinsicsCY: f64, - //double - pub m_flIntrinsicsK1: f64, - //double - pub m_flIntrinsicsK2: f64, - //double - pub m_flIntrinsicsP1: f64, - //double - pub m_flIntrinsicsP2: f64, - //double - pub m_flIntrinsicsK3: f64, +#[derive(Copy)] +pub struct Struct_Compositor_FrameTiming { + pub m_nSize: uint32_t, + pub m_nFrameIndex: uint32_t, + pub m_nNumFramePresents: uint32_t, + pub m_nNumDroppedFrames: uint32_t, + pub m_flSystemTimeInSeconds: ::std::os::raw::c_double, + pub m_flSceneRenderGpuMs: ::std::os::raw::c_float, + pub m_flTotalRenderGpuMs: ::std::os::raw::c_float, + pub m_flCompositorRenderGpuMs: ::std::os::raw::c_float, + pub m_flCompositorRenderCpuMs: ::std::os::raw::c_float, + pub m_flCompositorIdleCpuMs: ::std::os::raw::c_float, + pub m_flClientFrameIntervalMs: ::std::os::raw::c_float, + pub m_flPresentCallCpuMs: ::std::os::raw::c_float, + pub m_flWaitForPresentCpuMs: ::std::os::raw::c_float, + pub m_flSubmitFrameMs: ::std::os::raw::c_float, + pub m_flWaitGetPosesCalledMs: ::std::os::raw::c_float, + pub m_flNewPosesReadyMs: ::std::os::raw::c_float, + pub m_flNewFrameReadyMs: ::std::os::raw::c_float, + pub m_flCompositorUpdateStartMs: ::std::os::raw::c_float, + pub m_flCompositorUpdateEndMs: ::std::os::raw::c_float, + pub m_flCompositorRenderStartMs: ::std::os::raw::c_float, + pub m_HmdPose: TrackedDevicePose_t, + pub m_nFidelityLevel: int32_t, +} +impl ::std::clone::Clone for Struct_Compositor_FrameTiming { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_Compositor_FrameTiming { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type Compositor_FrameTiming = Struct_Compositor_FrameTiming; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VROverlayIntersectionParams_t { + pub vSource: Struct_HmdVector3_t, + pub vDirection: Struct_HmdVector3_t, + pub eOrigin: Enum_ETrackingUniverseOrigin, +} +impl ::std::clone::Clone for Struct_VROverlayIntersectionParams_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VROverlayIntersectionParams_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VROverlayIntersectionParams_t = Struct_VROverlayIntersectionParams_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VROverlayIntersectionResults_t { + pub vPoint: Struct_HmdVector3_t, + pub vNormal: Struct_HmdVector3_t, + pub vUVs: Struct_HmdVector2_t, + pub fDistance: ::std::os::raw::c_float, +} +impl ::std::clone::Clone for Struct_VROverlayIntersectionResults_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VROverlayIntersectionResults_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VROverlayIntersectionResults_t = + Struct_VROverlayIntersectionResults_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_RenderModel_ComponentState_t { + pub mTrackingToComponentRenderModel: Struct_HmdMatrix34_t, + pub mTrackingToComponentLocal: Struct_HmdMatrix34_t, + pub uProperties: VRComponentProperties, +} +impl ::std::clone::Clone for Struct_RenderModel_ComponentState_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_RenderModel_ComponentState_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type RenderModel_ComponentState_t = Struct_RenderModel_ComponentState_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_RenderModel_Vertex_t { + pub vPosition: Struct_HmdVector3_t, + pub vNormal: Struct_HmdVector3_t, + pub rfTextureCoord: [::std::os::raw::c_float; 2usize], +} +impl ::std::clone::Clone for Struct_RenderModel_Vertex_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_RenderModel_Vertex_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type RenderModel_Vertex_t = Struct_RenderModel_Vertex_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_RenderModel_TextureMap_t { + pub unWidth: uint16_t, + pub unHeight: uint16_t, + pub rubTextureMapData: *mut uint8_t, +} +impl ::std::clone::Clone for Struct_RenderModel_TextureMap_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_RenderModel_TextureMap_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type RenderModel_TextureMap_t = Struct_RenderModel_TextureMap_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_RenderModel_t { + pub rVertexData: *mut Struct_RenderModel_Vertex_t, + pub unVertexCount: uint32_t, + pub rIndexData: *mut uint16_t, + pub unTriangleCount: uint32_t, + pub diffuseTextureId: TextureID_t, +} +impl ::std::clone::Clone for Struct_RenderModel_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_RenderModel_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type RenderModel_t = Struct_RenderModel_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_RenderModel_ControllerMode_State_t { + pub bScrollWheelVisible: u8, +} +impl ::std::clone::Clone for Struct_RenderModel_ControllerMode_State_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_RenderModel_ControllerMode_State_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type RenderModel_ControllerMode_State_t = + Struct_RenderModel_ControllerMode_State_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_NotificationBitmap_t { + pub bytes: *mut ::std::os::raw::c_void, + pub width: int32_t, + pub height: int32_t, + pub depth: int32_t, +} +impl ::std::clone::Clone for Struct_NotificationBitmap_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_NotificationBitmap_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type NotificationBitmap_t = Struct_NotificationBitmap_t; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_COpenVRContext { + pub m_pVRSystem: intptr_t, + pub m_pVRChaperone: intptr_t, + pub m_pVRChaperoneSetup: intptr_t, + pub m_pVRCompositor: intptr_t, + pub m_pVROverlay: intptr_t, + pub m_pVRRenderModels: intptr_t, + pub m_pVRExtendedDisplay: intptr_t, + pub m_pVRSettings: intptr_t, + pub m_pVRApplications: intptr_t, +} +impl ::std::clone::Clone for Struct_COpenVRContext { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_COpenVRContext { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type COpenVRContext = Struct_COpenVRContext; +#[repr(C)] +#[derive(Copy)] +pub struct Union_Unnamed1 { + pub _bindgen_data_: [u64; 9usize], +} +impl Union_Unnamed1 { + pub unsafe fn reserved(&mut self) -> *mut VREvent_Reserved_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn controller(&mut self) -> *mut VREvent_Controller_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn mouse(&mut self) -> *mut VREvent_Mouse_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn scroll(&mut self) -> *mut VREvent_Scroll_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn process(&mut self) -> *mut VREvent_Process_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn notification(&mut self) -> *mut VREvent_Notification_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn overlay(&mut self) -> *mut VREvent_Overlay_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn status(&mut self) -> *mut VREvent_Status_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn keyboard(&mut self) -> *mut VREvent_Keyboard_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn ipd(&mut self) -> *mut VREvent_Ipd_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn chaperone(&mut self) -> *mut VREvent_Chaperone_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn performanceTest(&mut self) + -> *mut VREvent_PerformanceTest_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn touchPadMove(&mut self) -> *mut VREvent_TouchPadMove_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } + pub unsafe fn seatedZeroPoseReset(&mut self) + -> *mut VREvent_SeatedZeroPoseReset_t { + let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_); + ::std::mem::transmute(raw.offset(0)) + } +} +impl ::std::clone::Clone for Union_Unnamed1 { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Union_Unnamed1 { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +pub type VREvent_Data_t = Union_Unnamed1; +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VREvent_t { + pub eventType: uint32_t, + pub trackedDeviceIndex: TrackedDeviceIndex_t, + pub eventAgeSeconds: ::std::os::raw::c_float, + pub data: VREvent_Data_t, +} +impl ::std::clone::Clone for Struct_VREvent_t { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VREvent_t { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRSystem_FnTable { + pub GetRecommendedRenderTargetSize: ::std::option::Option, + pub GetProjectionMatrix: ::std::option::Option + Struct_HmdMatrix44_t>, + pub GetProjectionRaw: ::std::option::Option, + pub ComputeDistortion: ::std::option::Option + Struct_DistortionCoordinates_t>, + pub GetEyeToHeadTransform: ::std::option::Option + Struct_HmdMatrix34_t>, + pub GetTimeSinceLastVsync: ::std::option::Option u8>, + pub GetD3D9AdapterIndex: ::std::option::Option int32_t>, + pub GetDXGIOutputInfo: ::std::option::Option, + pub IsDisplayOnDesktop: ::std::option::Option u8>, + pub SetDisplayVisibility: ::std::option::Option u8>, + pub GetDeviceToAbsoluteTrackingPose: ::std::option::Option, + pub ResetSeatedZeroPose: ::std::option::Option, + pub GetSeatedZeroPoseToStandingAbsoluteTrackingPose: ::std::option::Option + Struct_HmdMatrix34_t>, + pub GetRawZeroPoseToStandingAbsoluteTrackingPose: ::std::option::Option + Struct_HmdMatrix34_t>, + pub GetSortedTrackedDeviceIndicesOfClass: ::std::option::Option + uint32_t>, + pub GetTrackedDeviceActivityLevel: ::std::option::Option + EDeviceActivityLevel>, + pub ApplyTransform: ::std::option::Option, + pub GetTrackedDeviceIndexForControllerRole: ::std::option::Option + TrackedDeviceIndex_t>, + pub GetControllerRoleForTrackedDeviceIndex: ::std::option::Option + ETrackedControllerRole>, + pub GetTrackedDeviceClass: ::std::option::Option + ETrackedDeviceClass>, + pub IsTrackedDeviceConnected: ::std::option::Option u8>, + pub GetBoolTrackedDeviceProperty: ::std::option::Option u8>, + pub GetFloatTrackedDeviceProperty: ::std::option::Option + ::std::os::raw::c_float>, + pub GetInt32TrackedDeviceProperty: ::std::option::Option int32_t>, + pub GetUint64TrackedDeviceProperty: ::std::option::Option + uint64_t>, + pub GetMatrix34TrackedDeviceProperty: ::std::option::Option + Struct_HmdMatrix34_t>, + pub GetStringTrackedDeviceProperty: ::std::option::Option + uint32_t>, + pub GetPropErrorNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub PollNextEvent: ::std::option::Option u8>, + pub PollNextEventWithPose: ::std::option::Option u8>, + pub GetEventTypeNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub GetHiddenAreaMesh: ::std::option::Option + Struct_HiddenAreaMesh_t>, + pub GetControllerState: ::std::option::Option u8>, + pub GetControllerStateWithPose: ::std::option::Option u8>, + pub TriggerHapticPulse: ::std::option::Option, + pub GetButtonIdNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub GetControllerAxisTypeNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub CaptureInputFocus: ::std::option::Option u8>, + pub ReleaseInputFocus: ::std::option::Option, + pub IsInputFocusCapturedByAnotherProcess: ::std::option::Option + u8>, + pub DriverDebugRequest: ::std::option::Option uint32_t>, + pub PerformFirmwareUpdate: ::std::option::Option EVRFirmwareError>, + pub AcknowledgeQuit_Exiting: ::std::option::Option, + pub AcknowledgeQuit_UserPrompt: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVRSystem_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRSystem_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRExtendedDisplay_FnTable { + pub GetWindowBounds: ::std::option::Option, + pub GetEyeOutputViewport: ::std::option::Option, + pub GetDXGIOutputInfo: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVRExtendedDisplay_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRExtendedDisplay_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRApplications_FnTable { + pub AddApplicationManifest: ::std::option::Option + EVRApplicationError>, + pub RemoveApplicationManifest: ::std::option::Option + EVRApplicationError>, + pub IsApplicationInstalled: ::std::option::Option u8>, + pub GetApplicationCount: ::std::option::Option uint32_t>, + pub GetApplicationKeyByIndex: ::std::option::Option + EVRApplicationError>, + pub GetApplicationKeyByProcessId: ::std::option::Option + EVRApplicationError>, + pub LaunchApplication: ::std::option::Option EVRApplicationError>, + pub LaunchTemplateApplication: ::std::option::Option + EVRApplicationError>, + pub LaunchDashboardOverlay: ::std::option::Option + EVRApplicationError>, + pub CancelApplicationLaunch: ::std::option::Option u8>, + pub IdentifyApplication: ::std::option::Option + EVRApplicationError>, + pub GetApplicationProcessId: ::std::option::Option uint32_t>, + pub GetApplicationsErrorNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub GetApplicationPropertyString: ::std::option::Option uint32_t>, + pub GetApplicationPropertyBool: ::std::option::Option u8>, + pub GetApplicationPropertyUint64: ::std::option::Option uint64_t>, + pub SetApplicationAutoLaunch: ::std::option::Option + EVRApplicationError>, + pub GetApplicationAutoLaunch: ::std::option::Option u8>, + pub GetStartingApplication: ::std::option::Option + EVRApplicationError>, + pub GetTransitionState: ::std::option::Option + EVRApplicationTransitionState>, + pub PerformApplicationPrelaunchCheck: ::std::option::Option + EVRApplicationError>, + pub GetApplicationsTransitionStateNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub IsQuitUserPromptRequested: ::std::option::Option u8>, + pub LaunchInternalProcess: ::std::option::Option + EVRApplicationError>, +} +impl ::std::clone::Clone for Struct_VR_IVRApplications_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRApplications_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRChaperone_FnTable { + pub GetCalibrationState: ::std::option::Option + ChaperoneCalibrationState>, + pub GetPlayAreaSize: ::std::option::Option u8>, + pub GetPlayAreaRect: ::std::option::Option u8>, + pub ReloadInfo: ::std::option::Option, + pub SetSceneColor: ::std::option::Option, + pub GetBoundsColor: ::std::option::Option, + pub AreBoundsVisible: ::std::option::Option u8>, + pub ForceBoundsVisible: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVRChaperone_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRChaperone_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRChaperoneSetup_FnTable { + pub CommitWorkingCopy: ::std::option::Option u8>, + pub RevertWorkingCopy: ::std::option::Option, + pub GetWorkingPlayAreaSize: ::std::option::Option u8>, + pub GetWorkingPlayAreaRect: ::std::option::Option u8>, + pub GetWorkingCollisionBoundsInfo: ::std::option::Option u8>, + pub GetLiveCollisionBoundsInfo: ::std::option::Option u8>, + pub GetWorkingSeatedZeroPoseToRawTrackingPose: ::std::option::Option + u8>, + pub GetWorkingStandingZeroPoseToRawTrackingPose: ::std::option::Option + u8>, + pub SetWorkingPlayAreaSize: ::std::option::Option, + pub SetWorkingCollisionBoundsInfo: ::std::option::Option, + pub SetWorkingSeatedZeroPoseToRawTrackingPose: ::std::option::Option, + pub SetWorkingStandingZeroPoseToRawTrackingPose: ::std::option::Option, + pub ReloadFromDisk: ::std::option::Option, + pub GetLiveSeatedZeroPoseToRawTrackingPose: ::std::option::Option + u8>, + pub SetWorkingCollisionBoundsTagsInfo: ::std::option::Option, + pub GetLiveCollisionBoundsTagsInfo: ::std::option::Option u8>, + pub SetWorkingPhysicalBoundsInfo: ::std::option::Option u8>, + pub GetLivePhysicalBoundsInfo: ::std::option::Option u8>, + pub ExportLiveToBuffer: ::std::option::Option u8>, + pub ImportFromBufferToWorking: ::std::option::Option u8>, +} +impl ::std::clone::Clone for Struct_VR_IVRChaperoneSetup_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRChaperoneSetup_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRCompositor_FnTable { + pub SetTrackingSpace: ::std::option::Option, + pub GetTrackingSpace: ::std::option::Option + ETrackingUniverseOrigin>, + pub WaitGetPoses: ::std::option::Option EVRCompositorError>, + pub GetLastPoses: ::std::option::Option EVRCompositorError>, + pub GetLastPoseForTrackedDeviceIndex: ::std::option::Option + EVRCompositorError>, + pub Submit: ::std::option::Option EVRCompositorError>, + pub ClearLastSubmittedFrame: ::std::option::Option, + pub PostPresentHandoff: ::std::option::Option, + pub GetFrameTiming: ::std::option::Option u8>, + pub GetFrameTimeRemaining: ::std::option::Option + ::std::os::raw::c_float>, + pub FadeToColor: ::std::option::Option, + pub FadeGrid: ::std::option::Option, + pub SetSkyboxOverride: ::std::option::Option EVRCompositorError>, + pub ClearSkyboxOverride: ::std::option::Option, + pub CompositorBringToFront: ::std::option::Option, + pub CompositorGoToBack: ::std::option::Option, + pub CompositorQuit: ::std::option::Option, + pub IsFullscreen: ::std::option::Option u8>, + pub GetCurrentSceneFocusProcess: ::std::option::Option uint32_t>, + pub GetLastFrameRenderer: ::std::option::Option uint32_t>, + pub CanRenderScene: ::std::option::Option u8>, + pub ShowMirrorWindow: ::std::option::Option, + pub HideMirrorWindow: ::std::option::Option, + pub IsMirrorWindowVisible: ::std::option::Option u8>, + pub CompositorDumpImages: ::std::option::Option, + pub ShouldAppRenderWithLowResources: ::std::option::Option u8>, + pub ForceInterleavedReprojectionOn: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVRCompositor_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRCompositor_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVROverlay_FnTable { + pub FindOverlay: ::std::option::Option EVROverlayError>, + pub CreateOverlay: ::std::option::Option EVROverlayError>, + pub DestroyOverlay: ::std::option::Option EVROverlayError>, + pub SetHighQualityOverlay: ::std::option::Option EVROverlayError>, + pub GetHighQualityOverlay: ::std::option::Option + VROverlayHandle_t>, + pub GetOverlayKey: ::std::option::Option uint32_t>, + pub GetOverlayName: ::std::option::Option uint32_t>, + pub GetOverlayImageData: ::std::option::Option EVROverlayError>, + pub GetOverlayErrorNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub SetOverlayRenderingPid: ::std::option::Option EVROverlayError>, + pub GetOverlayRenderingPid: ::std::option::Option uint32_t>, + pub SetOverlayFlag: ::std::option::Option EVROverlayError>, + pub GetOverlayFlag: ::std::option::Option EVROverlayError>, + pub SetOverlayColor: ::std::option::Option EVROverlayError>, + pub GetOverlayColor: ::std::option::Option EVROverlayError>, + pub SetOverlayAlpha: ::std::option::Option EVROverlayError>, + pub GetOverlayAlpha: ::std::option::Option EVROverlayError>, + pub SetOverlayWidthInMeters: ::std::option::Option + EVROverlayError>, + pub GetOverlayWidthInMeters: ::std::option::Option + EVROverlayError>, + pub SetOverlayAutoCurveDistanceRangeInMeters: ::std::option::Option + EVROverlayError>, + pub GetOverlayAutoCurveDistanceRangeInMeters: ::std::option::Option + EVROverlayError>, + pub SetOverlayTextureColorSpace: ::std::option::Option + EVROverlayError>, + pub GetOverlayTextureColorSpace: ::std::option::Option + EVROverlayError>, + pub SetOverlayTextureBounds: ::std::option::Option + EVROverlayError>, + pub GetOverlayTextureBounds: ::std::option::Option + EVROverlayError>, + pub GetOverlayTransformType: ::std::option::Option + EVROverlayError>, + pub SetOverlayTransformAbsolute: ::std::option::Option + EVROverlayError>, + pub GetOverlayTransformAbsolute: ::std::option::Option + EVROverlayError>, + pub SetOverlayTransformTrackedDeviceRelative: ::std::option::Option + EVROverlayError>, + pub GetOverlayTransformTrackedDeviceRelative: ::std::option::Option + EVROverlayError>, + pub SetOverlayTransformTrackedDeviceComponent: ::std::option::Option + EVROverlayError>, + pub GetOverlayTransformTrackedDeviceComponent: ::std::option::Option + EVROverlayError>, + pub ShowOverlay: ::std::option::Option EVROverlayError>, + pub HideOverlay: ::std::option::Option EVROverlayError>, + pub IsOverlayVisible: ::std::option::Option u8>, + pub GetTransformForOverlayCoordinates: ::std::option::Option + EVROverlayError>, + pub PollNextOverlayEvent: ::std::option::Option u8>, + pub GetOverlayInputMethod: ::std::option::Option EVROverlayError>, + pub SetOverlayInputMethod: ::std::option::Option EVROverlayError>, + pub GetOverlayMouseScale: ::std::option::Option EVROverlayError>, + pub SetOverlayMouseScale: ::std::option::Option EVROverlayError>, + pub ComputeOverlayIntersection: ::std::option::Option u8>, + pub HandleControllerOverlayInteractionAsMouse: ::std::option::Option + u8>, + pub IsHoverTargetOverlay: ::std::option::Option u8>, + pub GetGamepadFocusOverlay: ::std::option::Option + VROverlayHandle_t>, + pub SetGamepadFocusOverlay: ::std::option::Option EVROverlayError>, + pub SetOverlayNeighbor: ::std::option::Option EVROverlayError>, + pub MoveGamepadFocusToNeighbor: ::std::option::Option + EVROverlayError>, + pub SetOverlayTexture: ::std::option::Option EVROverlayError>, + pub ClearOverlayTexture: ::std::option::Option EVROverlayError>, + pub SetOverlayRaw: ::std::option::Option EVROverlayError>, + pub SetOverlayFromFile: ::std::option::Option EVROverlayError>, + pub GetOverlayTexture: ::std::option::Option EVROverlayError>, + pub ReleaseNativeOverlayHandle: ::std::option::Option + EVROverlayError>, + pub CreateDashboardOverlay: ::std::option::Option EVROverlayError>, + pub IsDashboardVisible: ::std::option::Option u8>, + pub IsActiveDashboardOverlay: ::std::option::Option u8>, + pub SetDashboardOverlaySceneProcess: ::std::option::Option + EVROverlayError>, + pub GetDashboardOverlaySceneProcess: ::std::option::Option + EVROverlayError>, + pub ShowDashboard: ::std::option::Option, + pub GetPrimaryDashboardDevice: ::std::option::Option + TrackedDeviceIndex_t>, + pub ShowKeyboard: ::std::option::Option EVROverlayError>, + pub ShowKeyboardForOverlay: ::std::option::Option EVROverlayError>, + pub GetKeyboardText: ::std::option::Option uint32_t>, + pub HideKeyboard: ::std::option::Option, + pub SetKeyboardTransformAbsolute: ::std::option::Option, + pub SetKeyboardPositionForOverlay: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVROverlay_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVROverlay_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRRenderModels_FnTable { + pub LoadRenderModel_Async: ::std::option::Option + EVRRenderModelError>, + pub FreeRenderModel: ::std::option::Option, + pub LoadTexture_Async: ::std::option::Option EVRRenderModelError>, + pub FreeTexture: ::std::option::Option, + pub LoadTextureD3D11_Async: ::std::option::Option + EVRRenderModelError>, + pub LoadIntoTextureD3D11_Async: ::std::option::Option + EVRRenderModelError>, + pub FreeTextureD3D11: ::std::option::Option, + pub GetRenderModelName: ::std::option::Option uint32_t>, + pub GetRenderModelCount: ::std::option::Option uint32_t>, + pub GetComponentCount: ::std::option::Option uint32_t>, + pub GetComponentName: ::std::option::Option uint32_t>, + pub GetComponentButtonMask: ::std::option::Option uint64_t>, + pub GetComponentRenderModelName: ::std::option::Option uint32_t>, + pub GetComponentState: ::std::option::Option u8>, + pub RenderModelHasComponent: ::std::option::Option u8>, +} +impl ::std::clone::Clone for Struct_VR_IVRRenderModels_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRRenderModels_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRNotifications_FnTable { + pub CreateNotification: ::std::option::Option + EVRNotificationError>, + pub RemoveNotification: ::std::option::Option + EVRNotificationError>, +} +impl ::std::clone::Clone for Struct_VR_IVRNotifications_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRNotifications_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } +} +#[repr(C)] +#[derive(Copy)] +pub struct Struct_VR_IVRSettings_FnTable { + pub GetSettingsErrorNameFromEnum: ::std::option::Option + *mut ::std::os::raw::c_char>, + pub Sync: ::std::option::Option u8>, + pub GetBool: ::std::option::Option u8>, + pub SetBool: ::std::option::Option, + pub GetInt32: ::std::option::Option int32_t>, + pub SetInt32: ::std::option::Option, + pub GetFloat: ::std::option::Option ::std::os::raw::c_float>, + pub SetFloat: ::std::option::Option, + pub GetString: ::std::option::Option, + pub SetString: ::std::option::Option, + pub RemoveSection: ::std::option::Option, + pub RemoveKeyInSection: ::std::option::Option, +} +impl ::std::clone::Clone for Struct_VR_IVRSettings_FnTable { + fn clone(&self) -> Self { *self } +} +impl ::std::default::Default for Struct_VR_IVRSettings_FnTable { + fn default() -> Self { unsafe { ::std::mem::zeroed() } } } extern "C" { - pub fn VR_IVRSystem_GetWindowBounds(ptr: *const (), pnX: *mut i32, pnY: *mut i32, pnWidth: *mut u32, pnHeight: *mut u32) ; - pub fn VR_IVRSystem_GetRecommendedRenderTargetSize(ptr: *const (), pnWidth: *mut u32, pnHeight: *mut u32) ; - pub fn VR_IVRSystem_GetEyeOutputViewport(ptr: *const (), eEye: Hmd_Eye, pnX: *mut u32, pnY: *mut u32, pnWidth: *mut u32, pnHeight: *mut u32) ; - pub fn VR_IVRSystem_GetProjectionMatrix(ptr: *const (), eEye: Hmd_Eye, fNearZ: f32, fFarZ: f32, eProjType: GraphicsAPIConvention) -> HmdMatrix44_t; - pub fn VR_IVRSystem_GetProjectionRaw(ptr: *const (), eEye: Hmd_Eye, pfLeft: *mut f32, pfRight: *mut f32, pfTop: *mut f32, pfBottom: *mut f32) ; - pub fn VR_IVRSystem_ComputeDistortion(ptr: *const (), eEye: Hmd_Eye, fU: f32, fV: f32) -> DistortionCoordinates_t; - pub fn VR_IVRSystem_GetEyeToHeadTransform(ptr: *const (), eEye: Hmd_Eye) -> HmdMatrix34_t; - pub fn VR_IVRSystem_GetTimeSinceLastVsync(ptr: *const (), pfSecondsSinceLastVsync: *mut f32, pulFrameCounter: *mut u64) -> bool; - pub fn VR_IVRSystem_GetD3D9AdapterIndex(ptr: *const (), ) -> i32; - pub fn VR_IVRSystem_GetDXGIOutputInfo(ptr: *const (), pnAdapterIndex: *mut i32, pnAdapterOutputIndex: *mut i32) ; - pub fn VR_IVRSystem_AttachToWindow(ptr: *const (), hWnd: *mut ()) -> bool; - pub fn VR_IVRSystem_GetDeviceToAbsoluteTrackingPose(ptr: *const (), eOrigin: TrackingUniverseOrigin, fPredictedSecondsToPhotonsFromNow: f32, pTrackedDevicePoseArray: *mut TrackedDevicePose_t, unTrackedDevicePoseArrayCount: u32) ; - pub fn VR_IVRSystem_ResetSeatedZeroPose(ptr: *const (), ) ; - pub fn VR_IVRSystem_GetSeatedZeroPoseToStandingAbsoluteTrackingPose(ptr: *const (), ) -> HmdMatrix34_t; - pub fn VR_IVRSystem_GetRawZeroPoseToStandingAbsoluteTrackingPose(ptr: *const (), ) -> HmdMatrix34_t; - pub fn VR_IVRSystem_GetSortedTrackedDeviceIndicesOfClass(ptr: *const (), eTrackedDeviceClass: TrackedDeviceClass, punTrackedDeviceIndexArray: *mut TrackedDeviceIndex_t, unTrackedDeviceIndexArrayCount: u32, unRelativeToTrackedDeviceIndex: TrackedDeviceIndex_t) -> u32; - pub fn VR_IVRSystem_GetTrackedDeviceActivityLevel(ptr: *const (), unDeviceId: TrackedDeviceIndex_t) -> EDeviceActivityLevel; - pub fn VR_IVRSystem_ApplyTransform(ptr: *const (), pOutputPose: *mut TrackedDevicePose_t, trackedDevicePose: *const TrackedDevicePose_t, transform: *const HmdMatrix34_t) ; - pub fn VR_IVRSystem_GetTrackedDeviceClass(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t) -> TrackedDeviceClass; - pub fn VR_IVRSystem_IsTrackedDeviceConnected(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRSystem_GetBoolTrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pError: *mut TrackedPropertyError) -> bool; - pub fn VR_IVRSystem_GetFloatTrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pError: *mut TrackedPropertyError) -> f32; - pub fn VR_IVRSystem_GetInt32TrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pError: *mut TrackedPropertyError) -> i32; - pub fn VR_IVRSystem_GetUint64TrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pError: *mut TrackedPropertyError) -> u64; - pub fn VR_IVRSystem_GetMatrix34TrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pError: *mut TrackedPropertyError) -> HmdMatrix34_t; - pub fn VR_IVRSystem_GetStringTrackedDeviceProperty(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, prop: TrackedDeviceProperty, pchValue: *const u8, unBufferSize: u32, pError: *mut TrackedPropertyError) -> u32; - pub fn VR_IVRSystem_GetPropErrorNameFromEnum(ptr: *const (), error: TrackedPropertyError) -> *const u8; - pub fn VR_IVRSystem_PollNextEvent(ptr: *const (), pEvent: *mut VREvent_t) -> bool; - pub fn VR_IVRSystem_PollNextEventWithPose(ptr: *const (), eOrigin: TrackingUniverseOrigin, pEvent: *mut VREvent_t, pTrackedDevicePose: *mut TrackedDevicePose_t) -> bool; - pub fn VR_IVRSystem_GetEventTypeNameFromEnum(ptr: *const (), eType: EVREventType) -> *const u8; - pub fn VR_IVRSystem_GetHiddenAreaMesh(ptr: *const (), eEye: Hmd_Eye) -> HiddenAreaMesh_t; - pub fn VR_IVRSystem_GetControllerState(ptr: *const (), unControllerDeviceIndex: TrackedDeviceIndex_t, pControllerState: *mut VRControllerState_t) -> bool; - pub fn VR_IVRSystem_GetControllerStateWithPose(ptr: *const (), eOrigin: TrackingUniverseOrigin, unControllerDeviceIndex: TrackedDeviceIndex_t, pControllerState: *mut VRControllerState_t, pTrackedDevicePose: *mut TrackedDevicePose_t) -> bool; - pub fn VR_IVRSystem_TriggerHapticPulse(ptr: *const (), unControllerDeviceIndex: TrackedDeviceIndex_t, unAxisId: u32, usDurationMicroSec: u16) ; - pub fn VR_IVRSystem_GetButtonIdNameFromEnum(ptr: *const (), eButtonId: EVRButtonId) -> *const u8; - pub fn VR_IVRSystem_GetControllerAxisTypeNameFromEnum(ptr: *const (), eAxisType: EVRControllerAxisType) -> *const u8; - pub fn VR_IVRSystem_CaptureInputFocus(ptr: *const (), ) -> bool; - pub fn VR_IVRSystem_ReleaseInputFocus(ptr: *const (), ) ; - pub fn VR_IVRSystem_IsInputFocusCapturedByAnotherProcess(ptr: *const (), ) -> bool; - pub fn VR_IVRSystem_DriverDebugRequest(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t, pchRequest: *const u8, pchResponseBuffer: *const u8, unResponseBufferSize: u32) -> u32; - pub fn VR_IVRSystem_PerformFirmwareUpdate(ptr: *const (), unDeviceIndex: TrackedDeviceIndex_t) -> VRFirmwareError; - pub fn VR_IVRSystem_IsDisplayOnDesktop(ptr: *const (), ) -> bool; - pub fn VR_IVRSystem_SetDisplayVisibility(ptr: *const (), bIsVisibleOnDesktop: bool) -> bool; - pub fn VR_IVRApplications_AddApplicationManifest(ptr: *const (), pchApplicationManifestFullPath: *const u8, bTemporary: bool) -> EVRApplicationError; - pub fn VR_IVRApplications_RemoveApplicationManifest(ptr: *const (), pchApplicationManifestFullPath: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_IsApplicationInstalled(ptr: *const (), pchAppKey: *const u8) -> bool; - pub fn VR_IVRApplications_GetApplicationCount(ptr: *const (), ) -> u32; - pub fn VR_IVRApplications_GetApplicationKeyByIndex(ptr: *const (), unApplicationIndex: u32, pchAppKeyBuffer: *const u8, unAppKeyBufferLen: u32) -> EVRApplicationError; - pub fn VR_IVRApplications_GetApplicationKeyByProcessId(ptr: *const (), unProcessId: u32, pchAppKeyBuffer: *const u8, unAppKeyBufferLen: u32) -> EVRApplicationError; - pub fn VR_IVRApplications_LaunchApplication(ptr: *const (), pchAppKey: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_LaunchDashboardOverlay(ptr: *const (), pchAppKey: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_IdentifyApplication(ptr: *const (), unProcessId: u32, pchAppKey: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_GetApplicationProcessId(ptr: *const (), pchAppKey: *const u8) -> u32; - pub fn VR_IVRApplications_GetApplicationsErrorNameFromEnum(ptr: *const (), error: EVRApplicationError) -> *const u8; - pub fn VR_IVRApplications_GetApplicationPropertyString(ptr: *const (), pchAppKey: *const u8, eProperty: EVRApplicationProperty, pchPropertyValueBuffer: *const u8, unPropertyValueBufferLen: u32, peError: *mut EVRApplicationError) -> u32; - pub fn VR_IVRApplications_GetApplicationPropertyBool(ptr: *const (), pchAppKey: *const u8, eProperty: EVRApplicationProperty, peError: *mut EVRApplicationError) -> bool; - pub fn VR_IVRApplications_GetHomeApplication(ptr: *const (), pchAppKeyBuffer: *const u8, unAppKeyBufferLen: u32) -> EVRApplicationError; - pub fn VR_IVRApplications_SetHomeApplication(ptr: *const (), pchAppKey: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_SetApplicationAutoLaunch(ptr: *const (), pchAppKey: *const u8, bAutoLaunch: bool) -> EVRApplicationError; - pub fn VR_IVRApplications_GetApplicationAutoLaunch(ptr: *const (), pchAppKey: *const u8) -> bool; - pub fn VR_IVRApplications_GetStartingApplication(ptr: *const (), pchAppKeyBuffer: *const u8, unAppKeyBufferLen: u32) -> EVRApplicationError; - pub fn VR_IVRApplications_GetTransitionState(ptr: *const (), ) -> EVRApplicationTransitionState; - pub fn VR_IVRApplications_PerformApplicationPrelaunchCheck(ptr: *const (), pchAppKey: *const u8) -> EVRApplicationError; - pub fn VR_IVRApplications_GetApplicationsTransitionStateNameFromEnum(ptr: *const (), state: EVRApplicationTransitionState) -> *const u8; - pub fn VR_IVRChaperone_GetCalibrationState(ptr: *const (), ) -> ChaperoneCalibrationState; - pub fn VR_IVRChaperone_GetPlayAreaSize(ptr: *const (), pSizeX: *mut f32, pSizeZ: *mut f32) -> bool; - pub fn VR_IVRChaperone_GetPlayAreaRect(ptr: *const (), rect: *mut HmdQuad_t) -> bool; - pub fn VR_IVRChaperone_ReloadInfo(ptr: *const (), ) ; - pub fn VR_IVRChaperone_SetSceneColor(ptr: *const (), color: HmdColor_t) ; - pub fn VR_IVRChaperone_GetBoundsColor(ptr: *const (), pOutputColorArray: *mut HmdColor_t, nNumOutputColors: i32) ; - pub fn VR_IVRChaperone_AreBoundsVisible(ptr: *const (), ) -> bool; - pub fn VR_IVRChaperone_ForceBoundsVisible(ptr: *const (), bForce: bool) ; - pub fn VR_IVRCompositor_GetLastError(ptr: *const (), pchBuffer: *const u8, unBufferSize: u32) -> u32; - pub fn VR_IVRCompositor_SetVSync(ptr: *const (), bVSync: bool) ; - pub fn VR_IVRCompositor_GetVSync(ptr: *const (), ) -> bool; - pub fn VR_IVRCompositor_SetGamma(ptr: *const (), fGamma: f32) ; - pub fn VR_IVRCompositor_GetGamma(ptr: *const (), ) -> f32; - pub fn VR_IVRCompositor_WaitGetPoses(ptr: *const (), pRenderPoseArray: *mut TrackedDevicePose_t, unRenderPoseArrayCount: u32, pGamePoseArray: *mut TrackedDevicePose_t, unGamePoseArrayCount: u32) -> VRCompositorError; - pub fn VR_IVRCompositor_Submit(ptr: *const (), eEye: Hmd_Eye, eTextureType: GraphicsAPIConvention, pTexture: *mut (), pBounds: *mut VRTextureBounds_t, nSubmitFlags: VRSubmitFlags_t) -> VRCompositorError; - pub fn VR_IVRCompositor_ClearLastSubmittedFrame(ptr: *const (), ) ; - pub fn VR_IVRCompositor_GetFrameTiming(ptr: *const (), pTiming: *mut Compositor_FrameTiming, unFramesAgo: u32) -> bool; - pub fn VR_IVRCompositor_FadeToColor(ptr: *const (), fSeconds: f32, fRed: f32, fGreen: f32, fBlue: f32, fAlpha: f32, bBackground: bool) ; - pub fn VR_IVRCompositor_FadeGrid(ptr: *const (), fSeconds: f32, bFadeIn: bool) ; - pub fn VR_IVRCompositor_SetSkyboxOverride(ptr: *const (), eTextureType: GraphicsAPIConvention, pFront: *mut (), pBack: *mut (), pLeft: *mut (), pRight: *mut (), pTop: *mut (), pBottom: *mut ()) ; - pub fn VR_IVRCompositor_ClearSkyboxOverride(ptr: *const (), ) ; - pub fn VR_IVRCompositor_CompositorBringToFront(ptr: *const (), ) ; - pub fn VR_IVRCompositor_CompositorGoToBack(ptr: *const (), ) ; - pub fn VR_IVRCompositor_CompositorQuit(ptr: *const (), ) ; - pub fn VR_IVRCompositor_IsFullscreen(ptr: *const (), ) -> bool; - pub fn VR_IVRCompositor_SetTrackingSpace(ptr: *const (), eOrigin: TrackingUniverseOrigin) ; - pub fn VR_IVRCompositor_GetTrackingSpace(ptr: *const (), ) -> TrackingUniverseOrigin; - pub fn VR_IVRCompositor_GetCurrentSceneFocusProcess(ptr: *const (), ) -> u32; - pub fn VR_IVRCompositor_CanRenderScene(ptr: *const (), ) -> bool; - pub fn VR_IVRCompositor_ShowMirrorWindow(ptr: *const (), ) ; - pub fn VR_IVRCompositor_HideMirrorWindow(ptr: *const (), ) ; - pub fn VR_IVRCompositor_CompositorDumpImages(ptr: *const (), ) ; - pub fn VR_IVRCompositor_GetFrameTimeRemaining(ptr: *const (), ) -> f32; - pub fn VR_IVRCompositor_GetLastFrameRenderer(ptr: *const (), ) -> u32; - pub fn VR_IVRCompositor_GetLastPoses(ptr: *const (), pRenderPoseArray: *mut TrackedDevicePose_t, unRenderPoseArrayCount: u32, pGamePoseArray: *mut TrackedDevicePose_t, unGamePoseArrayCount: u32) -> VRCompositorError; - pub fn VR_IVRCompositor_PostPresentHandoff(ptr: *const (), ) ; - pub fn VR_IVROverlay_FindOverlay(ptr: *const (), pchOverlayKey: *const u8, pOverlayHandle: *mut VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_CreateOverlay(ptr: *const (), pchOverlayKey: *const u8, pchOverlayFriendlyName: *const u8, pOverlayHandle: *mut VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_DestroyOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_SetHighQualityOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_GetHighQualityOverlay(ptr: *const (), ) -> VROverlayHandle_t; - pub fn VR_IVROverlay_GetOverlayKey(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pchValue: *const u8, unBufferSize: u32, pError: *mut VROverlayError) -> u32; - pub fn VR_IVROverlay_GetOverlayName(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pchValue: *const u8, unBufferSize: u32, pError: *mut VROverlayError) -> u32; - pub fn VR_IVROverlay_GetOverlayImageData(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pvBuffer: *mut (), unBufferSize: u32, punWidth: *mut u32, punHeight: *mut u32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayErrorNameFromEnum(ptr: *const (), error: VROverlayError) -> *const u8; - pub fn VR_IVROverlay_SetOverlayFlag(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eOverlayFlag: VROverlayFlags, bEnabled: bool) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayFlag(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eOverlayFlag: VROverlayFlags, pbEnabled: *mut bool) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayColor(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, fRed: f32, fGreen: f32, fBlue: f32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayColor(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pfRed: *mut f32, pfGreen: *mut f32, pfBlue: *mut f32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayAlpha(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, fAlpha: f32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayAlpha(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pfAlpha: *mut f32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayGamma(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, fGamma: f32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayGamma(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pfGamma: *mut f32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayWidthInMeters(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, fWidthInMeters: f32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayWidthInMeters(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pfWidthInMeters: *mut f32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayAutoCurveDistanceRangeInMeters(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, fMinDistanceInMeters: f32, fMaxDistanceInMeters: f32) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayAutoCurveDistanceRangeInMeters(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pfMinDistanceInMeters: *mut f32, pfMaxDistanceInMeters: *mut f32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayTextureBounds(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pOverlayTextureBounds: *mut VRTextureBounds_t) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayTextureBounds(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pOverlayTextureBounds: *mut VRTextureBounds_t) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayTransformType(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, peTransformType: *mut VROverlayTransformType) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayTransformAbsolute(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eTrackingOrigin: TrackingUniverseOrigin, pmatTrackingOriginToOverlayTransform: *mut HmdMatrix34_t) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayTransformAbsolute(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, peTrackingOrigin: *mut TrackingUniverseOrigin, pmatTrackingOriginToOverlayTransform: *mut HmdMatrix34_t) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayTransformTrackedDeviceRelative(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, unTrackedDevice: TrackedDeviceIndex_t, pmatTrackedDeviceToOverlayTransform: *mut HmdMatrix34_t) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayTransformTrackedDeviceRelative(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, punTrackedDevice: *mut TrackedDeviceIndex_t, pmatTrackedDeviceToOverlayTransform: *mut HmdMatrix34_t) -> VROverlayError; - pub fn VR_IVROverlay_ShowOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_HideOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_IsOverlayVisible(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> bool; - pub fn VR_IVROverlay_PollNextOverlayEvent(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pEvent: *mut VREvent_t) -> bool; - pub fn VR_IVROverlay_GetOverlayInputMethod(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, peInputMethod: *mut VROverlayInputMethod) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayInputMethod(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eInputMethod: VROverlayInputMethod) -> VROverlayError; - pub fn VR_IVROverlay_GetOverlayMouseScale(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pvecMouseScale: *mut HmdVector2_t) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayMouseScale(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pvecMouseScale: *mut HmdVector2_t) -> VROverlayError; - pub fn VR_IVROverlay_ComputeOverlayIntersection(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pParams: *mut VROverlayIntersectionParams_t, pResults: *mut VROverlayIntersectionResults_t) -> bool; - pub fn VR_IVROverlay_HandleControllerOverlayInteractionAsMouse(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, unControllerDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVROverlay_IsHoverTargetOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> bool; - pub fn VR_IVROverlay_GetGamepadFocusOverlay(ptr: *const (), ) -> VROverlayHandle_t; - pub fn VR_IVROverlay_SetGamepadFocusOverlay(ptr: *const (), ulNewFocusOverlay: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayNeighbor(ptr: *const (), eDirection: EOverlayDirection, ulFrom: VROverlayHandle_t, ulTo: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_MoveGamepadFocusToNeighbor(ptr: *const (), eDirection: EOverlayDirection, ulFrom: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayTexture(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eTextureType: GraphicsAPIConvention, pTexture: *mut ()) -> VROverlayError; - pub fn VR_IVROverlay_ClearOverlayTexture(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayRaw(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pvBuffer: *mut (), unWidth: u32, unHeight: u32, unDepth: u32) -> VROverlayError; - pub fn VR_IVROverlay_SetOverlayFromFile(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, pchFilePath: *const u8) -> VROverlayError; - pub fn VR_IVROverlay_CreateDashboardOverlay(ptr: *const (), pchOverlayKey: *const u8, pchOverlayFriendlyName: *const u8, pMainHandle: *mut VROverlayHandle_t, pThumbnailHandle: *mut VROverlayHandle_t) -> VROverlayError; - pub fn VR_IVROverlay_IsDashboardVisible(ptr: *const (), ) -> bool; - pub fn VR_IVROverlay_IsActiveDashboardOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t) -> bool; - pub fn VR_IVROverlay_SetDashboardOverlaySceneProcess(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, unProcessId: u32) -> VROverlayError; - pub fn VR_IVROverlay_GetDashboardOverlaySceneProcess(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, punProcessId: *mut u32) -> VROverlayError; - pub fn VR_IVROverlay_ShowDashboard(ptr: *const (), pchOverlayToShow: *const u8) ; - pub fn VR_IVROverlay_ShowKeyboard(ptr: *const (), eInputMode: EGamepadTextInputMode, eLineInputMode: EGamepadTextInputLineMode, pchDescription: *const u8, unCharMax: u32, pchExistingText: *const u8, bUseMinimalMode: bool, uUserValue: u64) -> VROverlayError; - pub fn VR_IVROverlay_ShowKeyboardForOverlay(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, eInputMode: EGamepadTextInputMode, eLineInputMode: EGamepadTextInputLineMode, pchDescription: *const u8, unCharMax: u32, pchExistingText: *const u8, bUseMinimalMode: bool, uUserValue: u64) -> VROverlayError; - pub fn VR_IVROverlay_GetKeyboardText(ptr: *const (), pchText: *const u8, cchText: u32) -> u32; - pub fn VR_IVROverlay_HideKeyboard(ptr: *const (), ) ; - pub fn VR_IVRRenderModels_LoadRenderModel(ptr: *const (), pchRenderModelName: *const u8, pRenderModel: *mut RenderModel_t) -> bool; - pub fn VR_IVRRenderModels_FreeRenderModel(ptr: *const (), pRenderModel: *mut RenderModel_t) ; - pub fn VR_IVRRenderModels_GetRenderModelName(ptr: *const (), unRenderModelIndex: u32, pchRenderModelName: *const u8, unRenderModelNameLen: u32) -> u32; - pub fn VR_IVRRenderModels_GetRenderModelCount(ptr: *const (), ) -> u32; - pub fn VR_IVRRenderModels_GetComponentCount(ptr: *const (), pchRenderModelName: *const u8) -> u32; - pub fn VR_IVRRenderModels_GetComponentName(ptr: *const (), pchRenderModelName: *const u8, unComponentIndex: u32, pchComponentName: *const u8, unComponentNameLen: u32) -> u32; - pub fn VR_IVRRenderModels_GetComponentButtonMask(ptr: *const (), pchRenderModelName: *const u8, pchComponentName: *const u8) -> u64; - pub fn VR_IVRRenderModels_GetComponentRenderModelName(ptr: *const (), pchRenderModelName: *const u8, pchComponentName: *const u8, pchComponentRenderModelName: *const u8, unComponentRenderModelNameLen: u32) -> u32; - pub fn VR_IVRRenderModels_GetComponentState(ptr: *const (), pchRenderModelName: *const u8, pchComponentName: *const u8, controllerState: VRControllerState_t, pComponentState: *mut ComponentState_t) -> bool; - pub fn VR_IVRControlPanel_GetDriverCount(ptr: *const (), ) -> u32; - pub fn VR_IVRControlPanel_GetDriverId(ptr: *const (), unDriverIndex: u32, pchBuffer: *const u8, unBufferLen: u32) -> u32; - pub fn VR_IVRControlPanel_GetDriverDisplayCount(ptr: *const (), pchDriverId: *const u8) -> u32; - pub fn VR_IVRControlPanel_GetDriverDisplayId(ptr: *const (), pchDriverId: *const u8, unDisplayIndex: u32, pchBuffer: *const u8, unBufferLen: u32) -> u32; - pub fn VR_IVRControlPanel_GetDriverDisplayModelNumber(ptr: *const (), pchDriverId: *const u8, pchDisplayId: *const u8, pchBuffer: *const u8, unBufferLen: u32) -> u32; - pub fn VR_IVRControlPanel_GetDriverDisplaySerialNumber(ptr: *const (), pchDriverId: *const u8, pchDisplayId: *const u8, pchBuffer: *const u8, unBufferLen: u32) -> u32; - pub fn VR_IVRControlPanel_LoadSharedResource(ptr: *const (), pchResourceName: *const u8, pchBuffer: *const u8, unBufferLen: u32) -> u32; - pub fn VR_IVRControlPanel_GetIPD(ptr: *const (), ) -> f32; - pub fn VR_IVRControlPanel_SetIPD(ptr: *const (), fIPD: f32) ; - //pub fn VR_IVRControlPanel_GetCurrentCompositorInterface(ptr: *const (), pchInterfaceVersion: *const u8) -> *mut class vr::IVRCompositor; - pub fn VR_IVRControlPanel_QuitProcess(ptr: *const (), pidProcessToQuit: u32) -> bool; - pub fn VR_IVRControlPanel_StartVRProcess(ptr: *const (), pchExecutable: *const u8, pchArguments: *const *const u8, unArgumentCount: u32, pchWorkingDirectory: *const u8) -> u32; - pub fn VR_IVRControlPanel_SetMasterProcessToThis(ptr: *const (), ) ; - pub fn VR_IVRNotifications_GetErrorString(ptr: *const (), error: NotificationError_t, pchBuffer: *const u8, unBufferSize: u32) -> u32; - pub fn VR_IVRNotifications_CreateNotification(ptr: *const (), ulOverlayHandle: VROverlayHandle_t, ulUserValue: u64, strType: *const u8, strText: *const u8, strCategory: *const u8, photo: *mut NotificationBitmap, notificationId: *mut VRNotificationId) -> NotificationError_t; - pub fn VR_IVRNotifications_DismissNotification(ptr: *const (), notificationId: VRNotificationId) -> NotificationError_t; - pub fn VR_IVRSettings_GetSettingsErrorNameFromEnum(ptr: *const (), eError: EVRSettingsError) -> *const u8; - pub fn VR_IVRSettings_Sync(ptr: *const (), peError: *mut EVRSettingsError) ; - pub fn VR_IVRSettings_GetBool(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, bDefaultValue: bool, peError: *mut EVRSettingsError) -> bool; - pub fn VR_IVRSettings_SetBool(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, bValue: bool, peError: *mut EVRSettingsError) ; - pub fn VR_IVRSettings_GetInt32(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, nDefaultValue: i32, peError: *mut EVRSettingsError) -> i32; - pub fn VR_IVRSettings_SetInt32(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, nValue: i32, peError: *mut EVRSettingsError) ; - pub fn VR_IVRSettings_GetFloat(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, flDefaultValue: f32, peError: *mut EVRSettingsError) -> f32; - pub fn VR_IVRSettings_SetFloat(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, flValue: f32, peError: *mut EVRSettingsError) ; - pub fn VR_IVRSettings_GetString(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, pchValue: *const u8, unValueLen: u32, pchDefaultValue: *const u8, peError: *mut EVRSettingsError) ; - pub fn VR_IVRSettings_SetString(ptr: *const (), pchSection: *const u8, pchSettingsKey: *const u8, pchValue: *const u8, peError: *mut EVRSettingsError) ; - pub fn VR_IVRTrackedCamera_HasCamera(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_GetCameraFirmwareDescription(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, pBuffer: *const u8, nBufferLen: u32) -> bool; - pub fn VR_IVRTrackedCamera_GetCameraFrameDimensions(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, nVideoStreamFormat: ECameraVideoStreamFormat, pWidth: *mut u32, pHeight: *mut u32) -> bool; - pub fn VR_IVRTrackedCamera_SetCameraVideoStreamFormat(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, nVideoStreamFormat: ECameraVideoStreamFormat) -> bool; - pub fn VR_IVRTrackedCamera_GetCameraVideoStreamFormat(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> ECameraVideoStreamFormat; - pub fn VR_IVRTrackedCamera_EnableCameraForStreaming(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, bEnable: bool) -> bool; - pub fn VR_IVRTrackedCamera_StartVideoStream(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_StopVideoStream(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_IsVideoStreamActive(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_GetVideoStreamElapsedTime(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> f32; - pub fn VR_IVRTrackedCamera_GetVideoStreamFrame(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> *mut CameraVideoStreamFrame_t; - pub fn VR_IVRTrackedCamera_ReleaseVideoStreamFrame(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, pFrameImage: *mut CameraVideoStreamFrame_t) -> bool; - pub fn VR_IVRTrackedCamera_SetAutoExposure(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t, bEnable: bool) -> bool; - pub fn VR_IVRTrackedCamera_SupportsPauseResume(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_PauseVideoStream(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_ResumeVideoStream(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRTrackedCamera_IsVideoStreamPaused(ptr: *const (), nDeviceIndex: TrackedDeviceIndex_t) -> bool; - pub fn VR_IVRChaperoneSetup_CommitWorkingCopy(ptr: *const (), configFile: EChaperoneConfigFile) -> bool; - pub fn VR_IVRChaperoneSetup_RevertWorkingCopy(ptr: *const (), ) ; - pub fn VR_IVRChaperoneSetup_GetWorkingPlayAreaSize(ptr: *const (), pSizeX: *mut f32, pSizeZ: *mut f32) -> bool; - pub fn VR_IVRChaperoneSetup_GetWorkingPlayAreaRect(ptr: *const (), rect: *mut HmdQuad_t) -> bool; - pub fn VR_IVRChaperoneSetup_GetWorkingCollisionBoundsInfo(ptr: *const (), pQuadsBuffer: *mut HmdQuad_t, punQuadsCount: *mut u32) -> bool; - pub fn VR_IVRChaperoneSetup_GetLiveCollisionBoundsInfo(ptr: *const (), pQuadsBuffer: *mut HmdQuad_t, punQuadsCount: *mut u32) -> bool; - pub fn VR_IVRChaperoneSetup_GetWorkingSeatedZeroPoseToRawTrackingPose(ptr: *const (), pmatSeatedZeroPoseToRawTrackingPose: *mut HmdMatrix34_t) -> bool; - pub fn VR_IVRChaperoneSetup_GetWorkingStandingZeroPoseToRawTrackingPose(ptr: *const (), pmatStandingZeroPoseToRawTrackingPose: *mut HmdMatrix34_t) -> bool; - pub fn VR_IVRChaperoneSetup_SetWorkingPlayAreaSize(ptr: *const (), sizeX: f32, sizeZ: f32) ; - pub fn VR_IVRChaperoneSetup_SetWorkingCollisionBoundsInfo(ptr: *const (), pQuadsBuffer: *mut HmdQuad_t, unQuadsCount: u32) ; - pub fn VR_IVRChaperoneSetup_SetWorkingSeatedZeroPoseToRawTrackingPose(ptr: *const (), matSeatedZeroPoseToRawTrackingPose: *const HmdMatrix34_t) ; - pub fn VR_IVRChaperoneSetup_SetWorkingStandingZeroPoseToRawTrackingPose(ptr: *const (), matStandingZeroPoseToRawTrackingPose: *const HmdMatrix34_t) ; - pub fn VR_IVRChaperoneSetup_ReloadFromDisk(ptr: *const (), configFile: EChaperoneConfigFile) ; + pub fn VR_InitInternal(peError: *mut EVRInitError, + eType: EVRApplicationType) -> intptr_t; + pub fn VR_ShutdownInternal(); + pub fn VR_IsHmdPresent() -> u8; + pub fn VR_GetGenericInterface(pchInterfaceVersion: + *const ::std::os::raw::c_char, + peError: *mut EVRInitError) -> intptr_t; + pub fn VR_IsRuntimeInstalled() -> u8; + pub fn VR_GetVRInitErrorAsSymbol(error: EVRInitError) + -> *const ::std::os::raw::c_char; + pub fn VR_GetVRInitErrorAsEnglishDescription(error: EVRInitError) + -> *const ::std::os::raw::c_char; } diff --git a/src/system.rs b/src/system.rs new file mode 100644 index 0000000..8cb5595 --- /dev/null +++ b/src/system.rs @@ -0,0 +1,108 @@ +use openvr_sys; +use openvr_sys::Enum_EGraphicsAPIConvention::*; +use openvr_sys::Enum_ETrackingUniverseOrigin::*; + +use common::*; + +pub struct IVRSystem(*const ()); + +impl IVRSystem { + pub unsafe fn from_raw(ptr: *const ()) -> Self { + IVRSystem(ptr as *mut ()) + } + + /// Get the recommended render target size + pub fn recommended_render_target_size(&self) -> Size { + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + + let mut size = Size{width: 0, height: 0}; + system.GetRecommendedRenderTargetSize.unwrap()( + &mut size.width, + &mut size.height + ); + size + } + } + + + /// Get the projection matrix for an eye + /// supply the near and the far position + /// assumes opengl conventions + pub fn projection_matrix(&self, eye: Eye, near: f32, far: f32) -> [[f32; 4]; 4] { + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + + let mat = system.GetProjectionMatrix.unwrap()( + eye.to_raw(), + near, + far, + EGraphicsAPIConvention_API_OpenGL + ); + mat.m + } + } + + /// Computes the distortion caused by the optics + pub fn compute_distortion(&self, eye: Eye, u: f32, v: f32) -> DistortionCoordinates { + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + let coord = system.ComputeDistortion.unwrap()( + eye.to_raw(), + u, v + ); + DistortionCoordinates { + red: coord.rfRed, + blue: coord.rfBlue, + green: coord.rfGreen + } + } + } + + /// Computes the distortion caused by the optics + pub fn eye_to_head_transform(&self, eye: Eye) -> [[f32; 4]; 3] { + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + let mat = system.GetEyeToHeadTransform.unwrap()( + eye.to_raw(), + ); + mat.m + } + } + + /// Computes the distortion caused by the optics + pub fn time_since_last_vsync(&self) -> Option<(f32, u64)> { + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + let mut frame = 0; + let mut sync = 0.; + let found = system.GetTimeSinceLastVsync.unwrap()( + &mut sync, + &mut frame + ); + + if found > 0 { + Some((sync, frame)) + } else { + None + } + } + } + + /// Fetch the tracked results from the HMD + pub fn tracked_devices(&self, time: f32) -> TrackedDevicePoses { + use std; + + unsafe { + let system = * { self.0 as *mut openvr_sys::Struct_VR_IVRSystem_FnTable }; + let mut data: [openvr_sys::TrackedDevicePose_t; 16] = std::mem::zeroed(); + system.GetDeviceToAbsoluteTrackingPose.unwrap()( + ETrackingUniverseOrigin_TrackingUniverseSeated, + time, + &mut data[0], + 16 + ); + to_tracked(data) + } + } +}