From 2cd1e740ee3265ee7514a4b096679ee64ea2cd4f Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 28 Apr 2005 11:57:38 +0000 Subject: [PATCH] Removed cached width and height from Mouse --- src/java/org/lwjgl/input/Mouse.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/java/org/lwjgl/input/Mouse.java b/src/java/org/lwjgl/input/Mouse.java index c20800c1..ae0bcacf 100644 --- a/src/java/org/lwjgl/input/Mouse.java +++ b/src/java/org/lwjgl/input/Mouse.java @@ -59,9 +59,6 @@ import org.lwjgl.opengl.Display; * @version $Revision$ */ public class Mouse { - /** Mouse constraint */ - private static int width, height; - /** Has the mouse been created? */ private static boolean created; @@ -299,8 +296,8 @@ public class Mouse { x = poll_coord1; y = poll_coord2; } - x = Math.min(width - 1, Math.max(0, x)); - y = Math.min(height - 1, Math.max(0, y)); + x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, x)); + y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, y)); dwheel += poll_dwheel; read(); } @@ -373,8 +370,8 @@ public class Mouse { event_x = readBuffer.get(); event_y = readBuffer.get(); } - event_x = Math.min(width - 1, Math.max(0, event_x)); - event_y = Math.min(height - 1, Math.max(0, event_y)); + event_x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, event_x)); + event_y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, event_y)); event_dwheel = readBuffer.get(); return true; } else