From 715072f90901a615b08f71903dd3ef7c0abbd6cb Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sun, 22 Jan 2023 10:46:06 +0000 Subject: [PATCH] Add dummy bytebuffers to the Mouse class for mods that access them via reflection --- src/main/java/org/lwjglx/input/Mouse.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/lwjglx/input/Mouse.java b/src/main/java/org/lwjglx/input/Mouse.java index 00b6009..36e81c5 100644 --- a/src/main/java/org/lwjglx/input/Mouse.java +++ b/src/main/java/org/lwjglx/input/Mouse.java @@ -1,5 +1,8 @@ package org.lwjglx.input; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; +import org.lwjgl.BufferUtils; import org.lwjgl.glfw.GLFW; import org.lwjglx.LWJGLException; import org.lwjglx.Sys; @@ -7,6 +10,12 @@ import org.lwjglx.opengl.Display; public class Mouse { + // Fields for reflection compatibility with lwjgl2 + public static final int EVENT_SIZE = 1 + 1 + 4 + 4 + 4 + 8; + private static ByteBuffer buttons = BufferUtils.createByteBuffer(32); + private static IntBuffer coord_buffer = BufferUtils.createIntBuffer(32); + private static ByteBuffer readBuffer = BufferUtils.createByteBuffer(32); + private static boolean grabbed = false; private static int lastX = 0;