From 742559fe20f701470fc574b89daa775667d93135 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 3 Nov 2004 13:49:08 +0000 Subject: [PATCH] Don't set native cursor if not supported by the platform --- src/java/org/lwjgl/input/Mouse.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/java/org/lwjgl/input/Mouse.java b/src/java/org/lwjgl/input/Mouse.java index 03f6010b..0a173068 100644 --- a/src/java/org/lwjgl/input/Mouse.java +++ b/src/java/org/lwjgl/input/Mouse.java @@ -194,7 +194,7 @@ public class Mouse { */ public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException { if ((getNativeCursorCaps() & CURSOR_ONE_BIT_TRANSPARENCY) == 0) - throw new IllegalStateException("Mouse doesn't support native cursors"); + throw new IllegalStateException("Mouse doesn't support native cursors"); Cursor oldCursor = currentCursor; currentCursor = cursor; if (isCreated()) { @@ -275,7 +275,8 @@ public class Mouse { buttonCount = Display.getImplementation().getButtonCount(); buttons = BufferUtils.createByteBuffer(buttonCount); coord_buffer = BufferUtils.createIntBuffer(3); - setNativeCursor(currentCursor); + if (currentCursor != null) + setNativeCursor(currentCursor); setGrabbed(isGrabbed); }