Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

make Monitor parameter of Window::setMonitor nullable #34

Merged
merged 2 commits into from
Jan 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion kgl-glfw/src/commonMain/kotlin/com/kgl/glfw/Window.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions kgl-glfw/src/jvmMain/kotlin/com/kgl/glfw/Window.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions kgl-glfw/src/nativeMain/kotlin/com/kgl/glfw/Window.kt
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ actual class Window private constructor(val ptr: CPointer<GLFWwindow>) : 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) {
Expand Down