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
43pub type jobject = *mut c_void;
44
45// Win32
46#[cfg(windows)]
47pub use windows::*;
48#[cfg(windows)]
49#[allow(non_snake_case)]
50mod windows {
51    //! Transcribed from windows-sys
52
53    use std::os::raw::c_void;
54
55    pub type IUnknown = c_void;
56    pub type LARGE_INTEGER = i64;
57    pub type HDC = isize;
58    pub type HGLRC = isize;
59    pub type ID3D11Device = c_void;
60    pub type ID3D11Texture2D = c_void;
61    pub type ID3D12CommandQueue = c_void;
62    pub type ID3D12Device = c_void;
63    pub type ID3D12Resource = c_void;
64    pub type D3D_FEATURE_LEVEL = i32;
65
66    #[derive(Copy, Clone)]
67    #[repr(C)]
68    pub struct LUID {
69        pub LowPart: u32,
70        pub HighPart: i32,
71    }
72}
73
74// EGL
75pub type EGLConfig = *mut c_void;
76pub type EGLContext = *mut c_void;
77pub type EGLDisplay = *mut c_void;
78pub type EGLenum = c_uint;
79pub type EglGetProcAddressMNDX =
80    unsafe extern "system" fn(*const c_char) -> Option<unsafe extern "system" fn()>;