diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/CMakeLists.txt | 3 | ||||
-rw-r--r-- | indra/llwindow/llwindow.cpp | 26 | ||||
-rw-r--r-- | indra/llwindow/llwindow.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowheadless.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 15 |
6 files changed, 32 insertions, 18 deletions
diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 1f0820a9f6..6debd54665 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -55,6 +55,7 @@ set(llwindow_LINK_LIBRARIES llfilesystem llxml ll::glm + ll::glext ll::uilibraries ll::SDL ) @@ -63,7 +64,7 @@ include_directories(${CMAKE_SOURCE_DIR}/llrender) # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -if (NOT DARWIN) +if (NOT (DARWIN OR WINDOWS)) list(APPEND viewer_SOURCE_FILES llkeyboardsdl.cpp llwindowsdl.cpp diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 4f3cc69c75..bff559591f 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -74,12 +74,12 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) LL_WARNS() << "OSMessageBox: " << text << LL_ENDL; #if LL_MESA_HEADLESS // !!! *FIX: (?) return OSBTN_OK; +#elif LL_SDL + result = OSMessageBoxSDL(text, caption, type); #elif LL_WINDOWS result = OSMessageBoxWin32(text, caption, type); -#elif LL_DARWIN && !LL_SDL +#elif LL_DARWIN result = OSMessageBoxMacOSX(text, caption, type); -#elif LL_SDL - result = OSMessageBoxSDL(text, caption, type); #else #error("OSMessageBox not implemented for this platform!") #endif @@ -259,12 +259,12 @@ bool LLWindow::copyTextToPrimary(const LLWString &src) // static std::vector<std::string> LLWindow::getDynamicFallbackFontList() { -#if LL_WINDOWS +#if LL_SDL + return LLWindowSDL::getDynamicFallbackFontList(); +#elif LL_WINDOWS return LLWindowWin32::getDynamicFallbackFontList(); -#elif LL_DARWIN && !LL_SDL +#elif LL_DARWIN return LLWindowMacOSX::getDynamicFallbackFontList(); -#elif LL_SDL - return LLWindowSDL::getDynamicFallbackFontList(); #else return std::vector<std::string>(); #endif @@ -273,12 +273,12 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList() // static std::vector<std::string> LLWindow::getDisplaysResolutionList() { -#if LL_WINDOWS +#if LL_SDL + return std::vector<std::string>(); +#elif LL_WINDOWS return LLWindowWin32::getDisplaysResolutionList(); -#elif LL_DARWIN && !LL_SDL +#elif LL_DARWIN return LLWindowMacOSX::getDisplaysResolutionList(); -#else - return std::vector<std::string>(); #endif } @@ -346,7 +346,7 @@ LLSplashScreen *LLSplashScreen::create() return 0; #elif LL_WINDOWS return new LLSplashScreenWin32; -#elif LL_DARWIN && !LL_SDL +#elif LL_DARWIN return new LLSplashScreenMacOSX; #else #error("LLSplashScreen not implemented on this platform!") @@ -359,7 +359,7 @@ void LLSplashScreen::show() { if (!gSplashScreenp) { -#if LL_WINDOWS && !LL_MESA_HEADLESS +#if LL_WINDOWS && !LL_MESA_HEADLESS && !LL_SDL gSplashScreenp = new LLSplashScreenWin32; #elif LL_DARWIN && !LL_SDL gSplashScreenp = new LLSplashScreenMacOSX; diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 5e06e665f3..37e681c41b 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -92,7 +92,7 @@ public: virtual bool setCursorPosition(LLCoordWindow position) = 0; virtual bool getCursorPosition(LLCoordWindow *position) = 0; -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL virtual bool getCursorDelta(LLCoordCommon* delta) = 0; #endif virtual void showCursor() = 0; diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 5696b69a59..acec401133 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -60,7 +60,7 @@ public: /*virtual*/ void toggleVSync(bool enable_vsync) override { } /*virtual*/ bool setCursorPosition(LLCoordWindow position) override {return false;} /*virtual*/ bool getCursorPosition(LLCoordWindow *position) override {return false;} -#if LL_WINDOWS +#if LL_WINDOWS && !LL_SDL /*virtual*/ bool getCursorDelta(LLCoordCommon* delta) override { return false; } #endif /*virtual*/ void showCursor() override {} diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 144216f658..076d7234bc 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -32,7 +32,7 @@ #include "llwindow.h" #include "lltimer.h" -#if !defined(__i386__) && !defined(__x86_64__) +#if !defined(__i386__) && !defined(__x86_64__) && !_M_X64 #define SDL_DISABLE_IMMINTRIN_H #endif #include "SDL2/SDL.h" diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index d237fdb334..725184eda4 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -160,7 +160,18 @@ HGLRC SafeCreateContext(HDC &hdc) GLuint SafeChoosePixelFormat(HDC &hdc, const PIXELFORMATDESCRIPTOR *ppfd) { - return LL::seh::catcher([hdc, ppfd]{ return ChoosePixelFormat(hdc, ppfd); }); + __try + { + return ChoosePixelFormat(hdc, ppfd); + } + __except (EXCEPTION_EXECUTE_HANDLER) + { + // convert to C++ styled exception + // C exception don't allow classes, so it's a regular char array + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } } //static @@ -570,6 +581,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, // Make an instance of our window then define the window class mhInstance = GetModuleHandle(NULL); +#if !_M_ARM64 // Init Direct Input - needed for joystick / Spacemouse LPDIRECTINPUT8 di8_interface; @@ -584,6 +596,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, { gDirectInput8 = di8_interface; } +#endif mSwapMethod = SWAP_METHOD_UNDEFINED; |