summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleviathan <leviathan@lindenlab.com>2024-10-18 10:26:53 -0700
committerleviathan <leviathan@lindenlab.com>2024-10-18 10:26:53 -0700
commitf9dc4f40b8dc36b0436e8cf7412626f290743722 (patch)
tree1257b7cfe383fef951e4fa6353b76da6236a2e50
parent99937bf3d4c68fa32cdc888b8cd9b9ed9d43fdbf (diff)
temporary workaround for #2870: disable SDL2 on mac
-rw-r--r--indra/llwindow/llgamecontrol.cpp8
-rw-r--r--indra/llwindow/llwindow.cpp4
2 files changed, 12 insertions, 0 deletions
diff --git a/indra/llwindow/llgamecontrol.cpp b/indra/llwindow/llgamecontrol.cpp
index 9d3c854ca2..67847600e7 100644
--- a/indra/llwindow/llgamecontrol.cpp
+++ b/indra/llwindow/llgamecontrol.cpp
@@ -1530,6 +1530,9 @@ void LLGameControl::init(const std::string& gamecontrollerdb_path,
llassert(saveObject);
llassert(updateUI);
+#ifndef LL_DARWIN
+ // SDL2 is temporarily disabled on Mac, so this needs to be a no-op on that platform
+
int result = SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR);
if (result < 0)
{
@@ -1555,6 +1558,7 @@ void LLGameControl::init(const std::string& gamecontrollerdb_path,
LL_INFOS("SDL2") << "Total " << count << " mappings added from " << gamecontrollerdb_path << LL_ENDL;
}
}
+#endif // LL_DARWIN
g_gameControl = LLGameControl::getInstance();
@@ -1614,6 +1618,9 @@ void LLGameControl::clearAllStates()
// static
void LLGameControl::processEvents(bool app_has_focus)
{
+#ifndef LL_DARWIN
+ // SDL2 is temporarily disabled on Mac, so this needs to be a no-op on that platform
+
// This method used by non-linux platforms which only use SDL for GameController input
SDL_Event event;
if (!app_has_focus)
@@ -1631,6 +1638,7 @@ void LLGameControl::processEvents(bool app_has_focus)
{
handleEvent(event, app_has_focus);
}
+#endif // LL_DARWIN
}
void LLGameControl::handleEvent(const SDL_Event& event, bool app_has_focus)
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 93ac58ca6f..066d29c624 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -416,7 +416,11 @@ LLWindow* LLWindowManager::createWindow(
if (use_gl)
{
+#ifndef LL_DARWIN
+ // SDL2 is temporarily disabled on Mac
init_sdl();
+#endif
+
#if LL_WINDOWS
new_window = new LLWindowWin32(callbacks,
title, name, x, y, width, height, flags,