Fix hidden mouse cursor.
Cursor is now properly hidden, instead of being a single black pixel. Credits to davedes. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
parent
169e9c192a
commit
47cf4f4af3
|
@ -22,6 +22,7 @@ import itdelatrisu.opsu.states.Options;
|
||||||
|
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.nio.IntBuffer;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -144,7 +145,9 @@ public class Utils {
|
||||||
// set the cursor
|
// set the cursor
|
||||||
try {
|
try {
|
||||||
// hide the native cursor
|
// hide the native cursor
|
||||||
Cursor emptyCursor = new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1), null);
|
int min = Cursor.getMinCursorSize();
|
||||||
|
IntBuffer tmp = BufferUtils.createIntBuffer(min * min);
|
||||||
|
Cursor emptyCursor = new Cursor(min, min, min/2, min/2, 1, tmp, null);
|
||||||
container.setMouseCursor(emptyCursor, 0, 0);
|
container.setMouseCursor(emptyCursor, 0, 0);
|
||||||
} catch (LWJGLException e) {
|
} catch (LWJGLException e) {
|
||||||
Log.error("Failed to set the cursor.", e);
|
Log.error("Failed to set the cursor.", e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user