From ee65d5ca7ecdd8d739c864f837a62fb37bde72bc Mon Sep 17 00:00:00 2001 From: XProger Date: Wed, 25 Sep 2019 02:48:08 +0300 Subject: [PATCH] fixed #212 --- src/core.h | 15 +++++++++++++-- src/platform/nix/main.cpp | 4 ---- src/platform/sdl2/main.cpp | 4 ---- src/platform/win/main.cpp | 8 -------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/core.h b/src/core.h index a541c1d..b8f7799 100644 --- a/src/core.h +++ b/src/core.h @@ -22,11 +22,16 @@ #undef OS_PTHREAD_MT + #ifdef _GAPI_GL + #define VR_SUPPORT + #endif #elif ANDROID #define _OS_ANDROID 1 #define _GAPI_GL 1 #define _GAPI_GLES 1 //#define _GAPI_VULKAN + + #define VR_SUPPORT #elif __SDL2__ #define _GAPI_GL 1 #ifdef SDL2_GLES @@ -127,8 +132,6 @@ #define SHADOW_TEX_SIZE 2048 #endif -extern void osToggleVR(bool enable); - extern void* osMutexInit (); extern void osMutexFree (void *obj); extern void osMutexLock (void *obj); @@ -330,6 +333,14 @@ namespace Core { } } +#ifdef VR_SUPPORT +extern void osToggleVR(bool enable); +#else +void osToggleVR(bool enable) { + Core::settings.detail.stereo = Core::Settings::STEREO_OFF; +} +#endif + #ifdef PROFILE struct TimingCPU { int &result; diff --git a/src/platform/nix/main.cpp b/src/platform/nix/main.cpp index 4aae57d..e5fbd3f 100644 --- a/src/platform/nix/main.cpp +++ b/src/platform/nix/main.cpp @@ -130,10 +130,6 @@ void osJoyVibrate(int index, float L, float R) { joyDevice[index].vR = R; } -void osToggleVR(bool enable) { - Core::settings.detail.stereo = Core::Settings::STEREO_OFF; -} - void joyInit() { LOG("init gamepads:\n"); char name[128]; diff --git a/src/platform/sdl2/main.cpp b/src/platform/sdl2/main.cpp index 2034ecf..42eca0f 100644 --- a/src/platform/sdl2/main.cpp +++ b/src/platform/sdl2/main.cpp @@ -103,10 +103,6 @@ void osJoyVibrate(int index, float L, float R) { // TODO } -void osToggleVR(bool enable) { - // TODO -} - bool isKeyPressed (SDL_Scancode scancode) { const Uint8 *state = SDL_GetKeyboardState(NULL); if (state[scancode]) { diff --git a/src/platform/win/main.cpp b/src/platform/win/main.cpp index 5469ef9..ab3ee1f 100644 --- a/src/platform/win/main.cpp +++ b/src/platform/win/main.cpp @@ -661,10 +661,6 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara } //VR Support -#ifdef _GAPI_GL - #define VR_SUPPORT -#endif - #ifdef VR_SUPPORT // TODO: fix depth precision // TODO: fix water surface rendering @@ -886,10 +882,6 @@ void osToggleVR(bool enable) { #else -void osToggleVR(bool enable) { - Core::settings.detail.stereo = Core::Settings::STEREO_OFF; -} - void vrUpdate() {} void vrCompose() {}