Skip to content

Commit

Permalink
bumped lwjgl to 3.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fabmax committed Dec 16, 2024
1 parent 46c23c9 commit d67837d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kotlin-serialization = "1.7.3"
kotlin-datetime = "0.6.1"
kotlin-atomicfu = "0.26.1"
kotlin-dokka = "1.9.20"
lwjgl = "3.3.4"
lwjgl = "3.3.5"
jsvg = "1.6.1"
androidsvg = "1.4"
physxjni = "2.4.2"
Expand All @@ -32,7 +32,6 @@ lwjgl-vma = { group = "org.lwjgl", name = "lwjgl-vma", version.ref = "lwjgl" }
lwjgl-shaderc = { group = "org.lwjgl", name = "lwjgl-shaderc", version.ref = "lwjgl" }
lwjgl-nfd = { group = "org.lwjgl", name = "lwjgl-nfd", version.ref = "lwjgl" }
lwjgl-stb = { group = "org.lwjgl", name = "lwjgl-stb", version.ref = "lwjgl" }
lwjgl-ktx = { group = "org.lwjgl", name = "lwjgl-ktx", version = "3.3.3" } # with 3.3.4 ktx crashes on windows when compressing textures to basis format
physxjni = { group = "de.fabmax", name = "physx-jni", version.ref = "physxjni" }
physxjswebidl = { group = "npm", name = "physx-js-webidl", version.ref = "physxjswebidl" }

Expand All @@ -44,4 +43,4 @@ plugindep-dokka = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin",
plugindep-android-library = { group = "com.android.library", name = "com.android.library.gradle.plugin", version.ref = "agp" }

[bundles]
lwjgl = ["lwjgl-core", "lwjgl-glfw", "lwjgl-jemalloc", "lwjgl-opengl", "lwjgl-vulkan", "lwjgl-vma", "lwjgl-shaderc", "lwjgl-nfd", "lwjgl-stb", "lwjgl-ktx"]
lwjgl = ["lwjgl-core", "lwjgl-glfw", "lwjgl-jemalloc", "lwjgl-opengl", "lwjgl-vulkan", "lwjgl-vma", "lwjgl-shaderc", "lwjgl-nfd", "lwjgl-stb"]
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PlatformWindowHelperWindows(val glfwWindow: GlfwWindow) : PlatformWindowHe

override fun hideTitleBar(windowPtr: Long) {
val glfwHWnd = glfwGetWin32Window(windowPtr)
val originalWndProcPtr = GetWindowLongPtr(glfwHWnd, GWL_WNDPROC)
val originalWndProcPtr = GetWindowLongPtr(null, glfwHWnd, GWL_WNDPROC)

val wndProc = WindowProc.create { hWnd, uMsg, wParam, lParam ->
when (uMsg) {
Expand Down Expand Up @@ -105,7 +105,7 @@ class PlatformWindowHelperWindows(val glfwWindow: GlfwWindow) : PlatformWindowHe
}
}

SetWindowLongPtr(glfwHWnd, GWL_WNDPROC, wndProc.address())
SetWindowLongPtr(null, glfwHWnd, GWL_WNDPROC, wndProc.address())
isHiddenTitleBar = true
}

Expand All @@ -119,15 +119,15 @@ class PlatformWindowHelperWindows(val glfwWindow: GlfwWindow) : PlatformWindowHe
return memStack {
val hWnd = glfwGetWin32Window(windowPtr)
val rect = RECT.calloc(this)
GetWindowRect(hWnd, rect)
GetWindowRect(null, hWnd, rect)
Vec2i(rect.left(), rect.top())
}
}

override fun setWindowPos(windowPtr: Long, x: Int, y: Int) {
if (isHiddenTitleBar) {
val hWnd = glfwGetWin32Window(windowPtr)
SetWindowPos(hWnd, 0L, x, y, 0, 0, SWP_FRAMECHANGED or SWP_NOSIZE)
SetWindowPos(null, hWnd, 0L, x, y, 0, 0, SWP_FRAMECHANGED or SWP_NOSIZE)
} else {
super.setWindowPos(windowPtr, x, y)
}
Expand All @@ -136,7 +136,7 @@ class PlatformWindowHelperWindows(val glfwWindow: GlfwWindow) : PlatformWindowHe
override fun setWindowSize(windowPtr: Long, width: Int, height: Int) {
if (isHiddenTitleBar) {
val hWnd = glfwGetWin32Window(windowPtr)
SetWindowPos(hWnd, 0L, 0, 0, width + nonTopBorder * 2, height + nonTopBorder + topBorder, SWP_FRAMECHANGED or SWP_NOMOVE)
SetWindowPos(null, hWnd, 0L, 0, 0, width + nonTopBorder * 2, height + nonTopBorder + topBorder, SWP_FRAMECHANGED or SWP_NOMOVE)
} else {
super.setWindowSize(windowPtr, width, height)
}
Expand Down

0 comments on commit d67837d

Please sign in to comment.