summaryrefslogtreecommitdiff
path: root/contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
committer3gg <3gg@shellblade.net>2025-12-27 12:03:39 -0800
commit5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch)
tree8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h')
-rw-r--r--contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h b/contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h
new file mode 100644
index 0000000..6eade3e
--- /dev/null
+++ b/contrib/SDL-3.2.8/src/video/openvr/SDL_openvrvideo.h
@@ -0,0 +1,106 @@
1#ifndef _SDL_OPENVRVIDEO_H
2#define _SDL_OPENVRVIDEO_H
3
4#ifdef SDL_VIDEO_DRIVER_WINDOWS
5#ifdef EXTERN_C
6#undef EXTERN_C
7#endif
8#endif
9
10// OpenVR has a LOT of unused variables that GCC will freak out on.
11#ifdef __GNUC__
12#pragma GCC diagnostic push
13#pragma GCC diagnostic ignored "-Wunused-variable"
14#endif
15
16#define USE_SDL
17#include "openvr_capi.h"
18
19#ifdef __GNUC__
20#pragma GCC diagnostic pop
21#endif
22
23#include <stdint.h>
24
25#ifndef SDL_VIDEO_DRIVER_WINDOWS
26
27#include <GLES3/gl3.h>
28#include <GLES3/gl32.h>
29#include <EGL/egl.h>
30#include <GLES2/gl2.h>
31#include <GLES2/gl2ext.h>
32#include <GLES2/gl2ext.h>
33
34#endif
35
36
37struct SDL_WindowData
38{
39#ifdef SDL_VIDEO_DRIVER_WINDOWS
40 SDL_Window *window;
41 HWND hwnd;
42 HWND parent;
43 HDC hdc;
44 HDC mdc;
45#else
46 int dummy;
47#endif
48};
49
50struct SDL_VideoData {
51 void * openVRLIB;
52 intptr_t vrtoken;
53 intptr_t (*FN_VR_InitInternal)( EVRInitError *peError, EVRApplicationType eType );
54 const char *(*FN_VR_GetVRInitErrorAsEnglishDescription)( EVRInitError error );
55 intptr_t (*FN_VR_GetGenericInterface)( const char *pchInterfaceVersion, EVRInitError *peError );
56
57 int is_buffer_rendering;
58
59 unsigned int overlaytexture;
60
61 unsigned int fbo, rbo;
62
63 int saved_texture_state;
64
65 struct VR_IVRSystem_FnTable *oSystem;
66 struct VR_IVROverlay_FnTable *oOverlay;
67 struct VR_IVRInput_FnTable * oInput;
68 VROverlayHandle_t overlayID, thumbID, cursorID;
69
70 char * sOverlayName;
71
72 VRActionSetHandle_t input_action_set;
73 VRActionHandle_t * input_action_handles_buttons;
74 int input_action_handles_buttons_count;
75 VRActionHandle_t * input_action_handles_axes;
76 int input_action_handles_axes_count;
77 VRActionHandle_t input_action_handles_haptics[2];
78
79 bool bKeyboardShown;
80 bool bHasShownOverlay;
81 int targw, targh;
82 int last_targw, last_targh;
83 int swap_interval;
84
85 bool bDidCreateOverlay;
86 bool renderdoc_debugmarker_frame_end;
87 bool bIconOverridden;
88
89 SDL_Window * window;
90
91 SDL_Joystick *virtual_joystick;
92#ifdef SDL_VIDEO_DRIVER_WINDOWS
93 HDC hdc;
94 HGLRC hglrc;
95#else
96 EGLDisplay eglDpy;
97 EGLContext eglCtx;
98#endif
99};
100
101struct SDL_DisplayData
102{
103 int dummy;
104};
105
106#endif