Set GLFW window attrib; Proper external mouse lock

Setting window attribute fixes DynamicFPS mod being broken
This commit is contained in:
Duy Tran Khanh committed 2022-03-17 07:24:41 +07:00
1 parent a6c9648345
commit 580da57855
6 files changed
+52 -6

No files matched your search

@@ -873,7 +873,7 @@ public class GLFW
}
public static int glfwGetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib) {
return internalGetWindow(window).windowAttribs.get(attrib);
return internalGetWindow(window).windowAttribs.getOrDefault(attrib, 0);
}
public static void glfwSetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib, int value) {
@@ -977,6 +977,9 @@ public class GLFW
win.title = title;
win.windowAttribs.put(GLFW_HOVERED, 1);
win.windowAttribs.put(GLFW_VISIBLE, 1);
mGLFWWindowMap.put(ptr, win);
mainContext = ptr;
return ptr;