openxr_sys/
platform.rs

1//! Stubbed-out platform types for use in graphics bindings
2//!
3//! Cast to these from your bindings of choice.
4#![allow(non_camel_case_types)]
5
6use std::os::raw::{c_char, c_uint, c_ulong, c_void};
7
8// Vulkan
9pub type VkInstance = *const c_void;
10pub type VkPhysicalDevice = *const c_void;
11pub type VkDevice = *const c_void;
12pub type VkImage = u64;
13pub type VkImageCreateFlags = u64;
14pub type VkImageUsageFlags = u64;
15pub type VkFormat = u32;
16pub type VkInstanceCreateInfo = c_void;
17pub type VkDeviceCreateInfo = c_void;
18pub type VkAllocationCallbacks = c_void;
19pub type VkResult = i32;
20pub type VkSamplerMipmapMode = i32;
21pub type VkSamplerAddressMode = i32;
22pub type VkComponentSwizzle = i32;
23pub type VkFilter = i32;
24pub type VkGetInstanceProcAddr =
25    unsafe extern "system" fn(VkInstance, *const c_char) -> Option<unsafe extern "system" fn()>;
26
27// Xlib
28pub type GLXFBConfig = *mut c_void;
29pub type GLXDrawable = c_ulong;
30pub type GLXContext = *mut c_void;
31pub type Display = std::os::raw::c_void;
32
33// Xcb
34pub type xcb_connection_t = c_void;
35pub type xcb_glx_fbconfig_t = u32;
36pub type xcb_visualid_t = u32;
37pub type xcb_glx_drawable_t = u32;
38pub type xcb_glx_context_t = u32;
39
40// Wayland
41pub type wl_display = c_void;
42
43// Jni
44pub type jobject = *mut c_void;
45
46#[cfg(target_os = "android")]
47pub type AIBinder = c_void;
48
49// Win32
50#[cfg(windows)]
51pub use windows::*;
52#[cfg(windows)]
53#[allow(non_snake_case)]
54mod windows {
55    //! Transcribed from windows-sys
56
57    use std::os::raw::c_void;
58
59    pub type IUnknown = c_void;
60    pub type LARGE_INTEGER = i64;
61    pub type HDC = isize;
62    pub type HGLRC = isize;
63    pub type ID3D11Device = c_void;
64    pub type ID3D11Texture2D = c_void;
65    pub type ID3D12CommandQueue = c_void;
66    pub type ID3D12Device = c_void;
67    pub type ID3D12Resource = c_void;
68    pub type D3D_FEATURE_LEVEL = i32;
69
70    #[derive(Copy, Clone)]
71    #[repr(C)]
72    pub struct LUID {
73        pub LowPart: u32,
74        pub HighPart: i32,
75    }
76}
77
78// EGL
79pub type EGLConfig = *mut c_void;
80pub type EGLContext = *mut c_void;
81pub type EGLDisplay = *mut c_void;
82pub type EGLenum = c_uint;
83pub type EglGetProcAddressMNDX =
84    unsafe extern "system" fn(*const c_char) -> Option<unsafe extern "system" fn()>;