This commit is contained in:
Tungstend 2023-07-24 23:30:32 +08:00
parent 0dc5cb034a
commit 903557dc6a
4 changed files with 18 additions and 17 deletions

View File

@ -1 +1 @@
1690210589680
1690212623003

View File

@ -4376,7 +4376,8 @@ public class GLFW {
*/
@NativeType("uint64_t")
public static long glfwGetTimerFrequency() {
return 60;
long __functionAddress = Functions.GetTimerFrequency;
return invokeJ(__functionAddress);
}
// --- [ glfwMakeContextCurrent ] ---

View File

@ -141,24 +141,24 @@ public class GLFWInputImplementation implements InputImplementation {
}
public void setCursorPos(int x, int y, long nanos) {
y = transformY(y);
if (correctCursor) {
last_x = x;
last_y = transformY(y);
last_y = y;
correctCursor = false;
} else {
y = transformY(y);
int dx = x - last_x;
int dy = y - last_y;
if (dx != 0 || dy != 0) {
accum_dx += dx;
accum_dy += dy;
last_x = x;
last_y = y;
if (grab) {
putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos * 1000000);
} else {
putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos * 1000000);
}
return;
}
int dx = x - last_x;
int dy = y - last_y;
if (dx != 0 || dy != 0) {
accum_dx += dx;
accum_dy += dy;
last_x = x;
last_y = y;
if (grab) {
putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos * 1000000);
} else {
putMouseEventWithCoords((byte)-1, (byte)0, x, y, 0, nanos * 1000000);
}
}
}