diff --git a/src/video/openvr/SDL_openvrvideo.c b/src/video/openvr/SDL_openvrvideo.c index a3afd4d50d..393ab1c238 100644 --- a/src/video/openvr/SDL_openvrvideo.c +++ b/src/video/openvr/SDL_openvrvideo.c @@ -34,13 +34,21 @@ #include "../SDL_egl_c.h" #include "SDL_openvrvideo.h" +#ifdef SDL_VIDEO_DRIVER_WINDOWS +// Currently only OpenGL, not EGL, is supported on Windows #include +#else +// Currently only EGL, not OpenGL, is supported on other platforms +#include +#include +#endif #ifdef SDL_VIDEO_DRIVER_WINDOWS -#include "../windows/SDL_windowsopengles.h" #include "../windows/SDL_windowsopengl.h" #include "../windows/SDL_windowsvulkan.h" + #define DEFAULT_OPENGL "OPENGL32.DLL" + static bool OPENVR_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); static SDL_GLContext OPENVR_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); @@ -48,10 +56,9 @@ struct SDL_GLContextState { HGLRC hglrc; }; +#endif // SDL_VIDEO_DRIVER_WINDOWS + -#else -#include -#endif #ifdef SDL_PLATFORM_WINDOWS #define SDL_OPENVR_DRIVER_DYNAMIC "openvr_api.dll" @@ -1626,16 +1633,8 @@ static SDL_VideoDevice *OPENVR_CreateDevice(void) device->GL_GetSwapInterval = OPENVR_GL_GetSwapInterval; device->GL_SwapWindow = OPENVR_GL_SwapWindow; device->GL_DestroyContext = OPENVR_GL_DestroyContext; -#elif SDL_VIDEO_OPENGL_EGL - device->GL_LoadLibrary = WIN_GLES_LoadLibrary; - device->GL_GetProcAddress = WIN_GLES_GetProcAddress; - device->GL_UnloadLibrary = WIN_GLES_UnloadLibrary; - device->GL_CreateContext = WIN_GLES_CreateContext; - device->GL_MakeCurrent = WIN_GLES_MakeCurrent; - device->GL_SetSwapInterval = WIN_GLES_SetSwapInterval; - device->GL_GetSwapInterval = WIN_GLES_GetSwapInterval; - device->GL_SwapWindow = WIN_GLES_SwapWindow; - device->GL_DestroyContext = WIN_GLES_DestroyContext; +#else +#error Needs more work to support EGL #endif #else device->GL_LoadLibrary = OVR_EGL_LoadLibrary;