Skip to content

Commit

Permalink
video/openvr: Avoid type redefinition errors.
Browse files Browse the repository at this point in the history
Also, let SDL handle stdint.h and stdbool.h.
  • Loading branch information
sezero committed Oct 18, 2024
1 parent 2654d5d commit 4fd1132
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
14 changes: 6 additions & 8 deletions src/video/openvr/SDL_openvrvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif


typedef struct SDL_WindowData
struct SDL_WindowData
{
#ifdef SDL_VIDEO_DRIVER_WINDOWS
SDL_Window *window;
Expand All @@ -46,9 +46,9 @@ typedef struct SDL_WindowData
#else
int dummy;
#endif
} SDL_WindowData;
};

typedef struct SDL_VideoData {
struct SDL_VideoData {
void * openVRLIB;
intptr_t vrtoken;
intptr_t (*FN_VR_InitInternal)( EVRInitError *peError, EVRApplicationType eType );
Expand Down Expand Up @@ -97,13 +97,11 @@ typedef struct SDL_VideoData {
EGLDisplay eglDpy;
EGLContext eglCtx;
#endif
} SDL_VideoData;
};


typedef struct SDL_DisplayData
struct SDL_DisplayData
{
int dummy;
} SDL_DisplayData;

};

#endif
15 changes: 2 additions & 13 deletions src/video/openvr/openvr_capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,15 @@
#endif // OPENVR_API_EXPORTS
#endif

#if 0 /* SDL handles these, already. */
#include <stdint.h>

#if defined( __WIN32 )
typedef char bool;
#else
#include <stdbool.h>
#endif

typedef uint64_t PropertyContainerHandle_t;
typedef uint32_t PropertyTypeTag_t;
typedef uint64_t VRActionHandle_t;
typedef uint64_t VRActionSetHandle_t;
typedef uint64_t VRInputValueHandle_t;
typedef uint64_t PathHandle_t;

#endif /**/

// OpenVR Constants

Expand Down Expand Up @@ -1837,10 +1831,6 @@ typedef enum EBlockQueueCreationFlag

// OpenVR typedefs

typedef uint32_t TrackedDeviceIndex_t;
typedef uint32_t VRNotificationId;
typedef uint64_t VROverlayHandle_t;

typedef uint32_t PropertyTypeTag_t;
typedef uint32_t SpatialAnchorHandle_t;
typedef void * glSharedTextureHandle_t;
Expand All @@ -1851,7 +1841,6 @@ typedef uint32_t DriverId_t;
typedef uint32_t TrackedDeviceIndex_t;
typedef uint64_t WebConsoleHandle_t;
typedef uint64_t PropertyContainerHandle_t;
typedef uint32_t PropertyTypeTag_t;
typedef PropertyContainerHandle_t DriverHandle_t;
typedef uint64_t VRActionHandle_t;
typedef uint64_t VRActionSetHandle_t;
Expand Down

0 comments on commit 4fd1132

Please sign in to comment.