summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindow.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2024-10-08 17:06:20 +0300
committerGitHub <noreply@github.com>2024-10-08 17:06:20 +0300
commit6ccae2d0ae977965202ecb45de77e46f8d0312b3 (patch)
tree0819595c2a50aa7066b0c75b49d3b6c31f5636b9 /indra/llwindow/llwindow.cpp
parentccc7fffb22b347149bf807b9d92677e5616c5017 (diff)
parent3dca9fc377e855b74a78a5c30464b468dcc82644 (diff)
Merge branch 'develop' into maxim/lua-nearby-avatars
Diffstat (limited to 'indra/llwindow/llwindow.cpp')
-rw-r--r--indra/llwindow/llwindow.cpp47
1 files changed, 25 insertions, 22 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 4016f420e8..93ac58ca6f 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -27,18 +27,19 @@
#include "linden_common.h"
#include "llwindowheadless.h"
-#if LL_MESA_HEADLESS
-#include "llwindowmesaheadless.h"
-#elif LL_SDL
-#include "llwindowsdl.h"
-#elif LL_WINDOWS
+#if LL_WINDOWS
#include "llwindowwin32.h"
#elif LL_DARWIN
#include "llwindowmacosx.h"
+#elif LL_MESA_HEADLESS
+#include "llwindowmesaheadless.h"
+#elif LL_LINUX
+#include "llwindowsdl.h"
#endif
#include "llerror.h"
#include "llkeyboard.h"
+#include "llsdl.h"
#include "llwindowcallbacks.h"
@@ -72,13 +73,13 @@ S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type)
S32 result = 0;
LL_WARNS() << "OSMessageBox: " << text << LL_ENDL;
-#if LL_MESA_HEADLESS // !!! *FIX: (?)
- return OSBTN_OK;
-#elif LL_WINDOWS
+#if LL_WINDOWS
result = OSMessageBoxWin32(text, caption, type);
#elif LL_DARWIN
result = OSMessageBoxMacOSX(text, caption, type);
-#elif LL_SDL
+#elif LL_MESA_HEADLESS // !!! *FIX: (?)
+ return OSBTN_OK;
+#elif LL_LINUX
result = OSMessageBoxSDL(text, caption, type);
#else
#error("OSMessageBox not implemented for this platform!")
@@ -263,7 +264,7 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()
return LLWindowWin32::getDynamicFallbackFontList();
#elif LL_DARWIN
return LLWindowMacOSX::getDynamicFallbackFontList();
-#elif LL_SDL
+#elif LL_LINUX
return LLWindowSDL::getDynamicFallbackFontList();
#else
return std::vector<std::string>();
@@ -342,12 +343,12 @@ bool LLSplashScreen::isVisible()
// static
LLSplashScreen *LLSplashScreen::create()
{
-#if LL_MESA_HEADLESS || LL_SDL // !!! *FIX: (?)
- return 0;
-#elif LL_WINDOWS
+#if LL_WINDOWS
return new LLSplashScreenWin32;
#elif LL_DARWIN
return new LLSplashScreenMacOSX;
+#elif LL_MESA_HEADLESS || LL_LINUX // !!! *FIX: (?)
+ return 0;
#else
#error("LLSplashScreen not implemented on this platform!")
#endif
@@ -415,15 +416,8 @@ LLWindow* LLWindowManager::createWindow(
if (use_gl)
{
-#if LL_MESA_HEADLESS
- new_window = new LLWindowMesaHeadless(callbacks,
- title, name, x, y, width, height, flags,
- fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth);
-#elif LL_SDL
- new_window = new LLWindowSDL(callbacks,
- title, name, x, y, width, height, flags,
- fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
-#elif LL_WINDOWS
+ init_sdl();
+#if LL_WINDOWS
new_window = new LLWindowWin32(callbacks,
title, name, x, y, width, height, flags,
fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples, max_cores, max_gl_version);
@@ -431,6 +425,14 @@ LLWindow* LLWindowManager::createWindow(
new_window = new LLWindowMacOSX(callbacks,
title, name, x, y, width, height, flags,
fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
+#elif LL_MESA_HEADLESS
+ new_window = new LLWindowMesaHeadless(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth);
+#elif LL_LINUX
+ new_window = new LLWindowSDL(callbacks,
+ title, name, x, y, width, height, flags,
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#endif
}
else
@@ -462,6 +464,7 @@ bool LLWindowManager::destroyWindow(LLWindow* window)
window->close();
sWindowList.erase(window);
+ quit_sdl();
delete window;