Tab -> spaces; Set win size also set monitor size

This commit is contained in:
Duy Tran Khanh 2021-02-21 09:51:32 +07:00 committed by GitHub
parent 9bc686b591
commit 871e97fe9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -638,6 +638,13 @@ public class GLFW
return GLFW; return GLFW;
} }
public static void internalChangeMonitorSize(int width, int height) {
mGLFWWindowWidth = width;
mGLFWWindowHeight = height;
memPutInt(mGLFWVideoMode.address() + (long) mGLFWVideoMode.WIDTH, mGLFWWindowWidth);
memPutInt(mGLFWVideoMode.address() + (long) mGLFWVideoMode.HEIGHT, mGLFWWindowHeight);
}
public static GLFWWindowProperties internalGetWindow(long window) { public static GLFWWindowProperties internalGetWindow(long window) {
GLFWWindowProperties win = mGLFWWindowMap.get(window); GLFWWindowProperties win = mGLFWWindowMap.get(window);
if (win == null) { if (win == null) {
@ -1118,8 +1125,7 @@ public class GLFW
break; break;
case CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE: case CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE:
case CallbackBridge.EVENT_TYPE_WINDOW_SIZE: case CallbackBridge.EVENT_TYPE_WINDOW_SIZE:
mGLFWWindowWidth = dataArr[1]; internalChangeMonitorSize(dataArr[1], dataArr[2]);
mGLFWWindowHeight = dataArr[2];
glfwSetWindowSize(ptr, mGLFWWindowWidth, mGLFWWindowHeight); glfwSetWindowSize(ptr, mGLFWWindowWidth, mGLFWWindowHeight);
if (dataArr[0] == CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE && mGLFWFramebufferSizeCallback != null) { if (dataArr[0] == CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE && mGLFWFramebufferSizeCallback != null) {
mGLFWFramebufferSizeCallback.invoke(ptr, mGLFWWindowWidth, mGLFWWindowHeight); mGLFWFramebufferSizeCallback.invoke(ptr, mGLFWWindowWidth, mGLFWWindowHeight);