diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-06-21 17:40:58 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-06-27 15:11:17 +0800 |
commit | 161935f3178f343848839ad93ccaa6c1988bdef6 (patch) | |
tree | a8ce522cef705028801c63ca6f2d088a9c245f59 /indra/newview | |
parent | d9325eb964d07edb773dee23f196452874ea2b62 (diff) |
Revert to using Cocoa instead of SDL2 for macOS
Our SDL2-based code is kept Darwin-ready. This move was triggered
by the merge with SLv's release/maint-b branch causing the viewer
to show only a black screen, even though everything else seemed to
be working (logging in, streaming, quitting the app). This decision
also has caused numerous MPv specific window-related macOS bugs to
be fixed. I wanted to commit this on the main branch, but somehow
it failed to build. This move was bound to happen at the arrival of
Maintenance B after all.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/CMakeLists.txt | 12 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 352dd4a5ee..2ea0ef19d3 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1421,15 +1421,15 @@ set_source_files_properties( ) if (DARWIN) - if (NOT USESYSTEMLIBS) +# if (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.mm) LIST(APPEND viewer_SOURCE_FILES llappviewermacosx-objc.h) - endif (NOT USESYSTEMLIBS) +# endif (NOT USESYSTEMLIBS) LIST(APPEND viewer_SOURCE_FILES llfilepicker_mac.mm) LIST(APPEND viewer_HEADER_FILES llfilepicker_mac.h) - if (NOT USESYSTEMLIBS) +# if (NOT USESYSTEMLIBS) # This should be compiled with the viewer. LIST(APPEND viewer_SOURCE_FILES llappdelegate-objc.mm) set_source_files_properties( @@ -1444,7 +1444,7 @@ if (DARWIN) # warnings. COMPILE_FLAGS "-fmodules -fcxx-modules -Wno-nullability-completeness" ) - endif (NOT USESYSTEMLIBS) +# endif (NOT USESYSTEMLIBS) # Add resource files to the project. set(viewer_RESOURCE_FILES @@ -1464,7 +1464,7 @@ if (DARWIN) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) endif (DARWIN) -if (USESYSTEMLIBS) +if (USESYSTEMLIBS AND NOT DARWIN) LIST(APPEND viewer_SOURCE_FILES llappviewerlinux.cpp) set_source_files_properties( llappviewerlinux.cpp @@ -1476,7 +1476,7 @@ if (USESYSTEMLIBS) SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") endif () -endif (USESYSTEMLIBS) +endif (USESYSTEMLIBS AND NOT DARWIN) if (WINDOWS) list(APPEND viewer_SOURCE_FILES diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 326ffa917a..601caddc7f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -138,7 +138,11 @@ #include "vlc/libvlc_version.h" #if LL_DARWIN +#if LL_SDL #include "llwindowsdl.h" +#else +#include "llwindowmacosx.h" +#endif // LL_SDL #endif // Third party library includes @@ -567,7 +571,11 @@ static void settings_to_globals() LLWorldMapView::setScaleSetting(gSavedSettings.getF32("MapScale")); #if LL_DARWIN +#if LL_SDL LLWindowSDL::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#else + LLWindowMacOSX::sUseMultGL = gSavedSettings.getBOOL("RenderAppleUseMultGL"); +#endif // LL_SDL gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); #endif } |