Skip to content

Commit

Permalink
Fixed Unciv not starting on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
yairm210 committed Feb 1, 2025
1 parent 80ced8f commit a3f83a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions desktop/src/com/unciv/app/desktop/DesktopLauncher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.unciv.ui.screens.basescreen.BaseScreen
import com.unciv.utils.Display
import com.unciv.utils.Log
import org.lwjgl.system.Configuration
import java.awt.GraphicsEnvironment
import java.io.File
import kotlin.system.exitProcess

Expand All @@ -29,6 +30,9 @@ internal object DesktopLauncher {
fun main(arg: Array<String>) {
if (SharedLibraryLoader.isMac) {
Configuration.GLFW_LIBRARY_NAME.set("glfw_async")
// Since LibGDX 1.13.1 on Mac you cannot call Lwjgl3ApplicationConfiguration.getPrimaryMonitor()
// before GraphicsEnvironment.getLocalGraphicsEnvironment().
GraphicsEnvironment.getLocalGraphicsEnvironment()
}

// The uniques checker requires the file system to be seet up, which happens after lwjgw initializes it
Expand Down Expand Up @@ -78,6 +82,8 @@ internal object DesktopLauncher {
config.setHdpiMode(HdpiMode.Logical)
config.setWindowSizeLimits(WindowState.minimumWidth, WindowState.minimumHeight, -1, -1)



// LibGDX not yet configured, use regular java class
val maximumWindowBounds = getMaximumWindowBounds()

Expand Down

0 comments on commit a3f83a7

Please sign in to comment.