diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 158a60a..54a66e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,7 @@ jobs: steps: - name: 'Build GLFW from source' run: | + sudo apt update sudo apt install libvulkan-dev doxygen xorg-dev libglu1-mesa-dev gcc-multilib curl -L https://github.com/glfw/glfw/releases/download/3.3/glfw-3.3.zip -s -o glfw-3.3.zip diff --git a/kgl-glfw/src/commonMain/kotlin/com/kgl/glfw/Window.kt b/kgl-glfw/src/commonMain/kotlin/com/kgl/glfw/Window.kt index 79359bb..d6a86ab 100644 --- a/kgl-glfw/src/commonMain/kotlin/com/kgl/glfw/Window.kt +++ b/kgl-glfw/src/commonMain/kotlin/com/kgl/glfw/Window.kt @@ -64,7 +64,7 @@ expect class Window( var rawMouseButtonEnabled: Boolean fun swapBuffers() - fun setMonitor(monitor: Monitor, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) + fun setMonitor(monitor: Monitor?, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) fun setTitle(title: String) fun setSizeLimits(minWidth: Int, minHeight: Int, maxWidth: Int, maxHeight: Int) fun setAspectRatio(number: Int, denom: Int) diff --git a/kgl-glfw/src/jvmMain/kotlin/com/kgl/glfw/Window.kt b/kgl-glfw/src/jvmMain/kotlin/com/kgl/glfw/Window.kt index 49cfba2..bb2a248 100644 --- a/kgl-glfw/src/jvmMain/kotlin/com/kgl/glfw/Window.kt +++ b/kgl-glfw/src/jvmMain/kotlin/com/kgl/glfw/Window.kt @@ -249,8 +249,8 @@ actual class Window private constructor(val ptr: Long) : Closeable { glfwSetInputMode(ptr, GLFW_RAW_MOUSE_MOTION, if (value) GLFW_TRUE else GLFW_FALSE) } - actual fun setMonitor(monitor: Monitor, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) { - glfwSetWindowMonitor(ptr, monitor.ptr, xpos, ypos, width, height, refreshRate) + actual fun setMonitor(monitor: Monitor?, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) { + glfwSetWindowMonitor(ptr, monitor?.ptr ?: 0L, xpos, ypos, width, height, refreshRate) } actual fun setTitle(title: String) { diff --git a/kgl-glfw/src/nativeMain/kotlin/com/kgl/glfw/Window.kt b/kgl-glfw/src/nativeMain/kotlin/com/kgl/glfw/Window.kt index b11f11f..fc47535 100644 --- a/kgl-glfw/src/nativeMain/kotlin/com/kgl/glfw/Window.kt +++ b/kgl-glfw/src/nativeMain/kotlin/com/kgl/glfw/Window.kt @@ -279,8 +279,8 @@ actual class Window private constructor(val ptr: CPointer) : Closeab } - actual fun setMonitor(monitor: Monitor, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) { - glfwSetWindowMonitor(ptr, monitor.ptr, xpos, ypos, width, height, refreshRate) + actual fun setMonitor(monitor: Monitor?, xpos: Int, ypos: Int, width: Int, height: Int, refreshRate: Int) { + glfwSetWindowMonitor(ptr, monitor?.ptr, xpos, ypos, width, height, refreshRate) } actual fun setTitle(title: String) {