Try to get mouse works without trigger callback

This commit is contained in:
Duy Tran Khanh committed 2021-02-04 20:46:10 +07:00
1 parent 54a9e40c9f
commit b1c0530aed
3 files changed
+15 -10

No files matched your search

+2
View File
@@ -73,6 +73,8 @@ public class HelloWorld {
// Get the resolution of the primary monitor
GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
System.out.println("Actual width=" + vidmode.width() + ", height=" + vidmode.height());
// Center the window
glfwSetWindowPos(
+5 -10
View File
@@ -500,11 +500,6 @@ public class GLFW
public static final byte[] keyDownBuffer = new byte[316];
public static long mainContext = 0;
static {
// Minecraft triggers a glfwPollEvents() on splash screen, so update window size there.
CallbackBridge.receiveCallback(CallbackBridge.EVENT_TYPE_FRAMEBUFFER_SIZE, mGLFWWindowWidth, mGLFWWindowHeight, 0, 0);
CallbackBridge.receiveCallback(CallbackBridge.EVENT_TYPE_WINDOW_SIZE, mGLFWWindowWidth, mGLFWWindowHeight, 0, 0);
try {
System.loadLibrary("pojavexec");
} catch (UnsatisfiedLinkError e) {
@@ -967,13 +962,13 @@ public class GLFW
long ptr = nativeEglCreateContext(share);
//nativeEglMakeCurrent(ptr);
GLFWWindowProperties win = new GLFWWindowProperties();
// win.width = width;
// win.height = height;
win.width = mGLFWWindowWidth;
win.height = mGLFWWindowHeight;
win.width = width;
win.height = height;
win.title = title;
System.out.println("GLFW: Created window " + title + ", " + win.toString());
mGLFWWindowMap.put(ptr, win);
mainContext = ptr;
@@ -1009,7 +1004,7 @@ public class GLFW
}
public static void glfwShowWindow(long window) {
System.out.println("GLFW: Showing window " + window + ", x=" + internalGetWindow(window).x + ", y=" + internalGetWindow(window).y);
System.out.println("GLFW: Showing window " + window + ", " + internalGetWindow(window).toString());
nglfwSetShowingWindow(window);
}
public static void glfwWindowHint(int hint, int value) {}
@@ -10,4 +10,12 @@ public class GLFWWindowProperties {
public boolean shouldClose, isInitialSizeCalled, isCursorEntered;
public Map<Integer, Integer> inputModes = new HashMap<>();
public Map<Integer, Integer> windowAttribs = new HashMap<>();
@Override
public String toString() {
return "width=" + width + ", " +
"height=" + height + ", " +
"x=" + x + ", " +
"y=" + y + ", ";
}
}