Removed cached width and height from Mouse

This commit is contained in:
Elias Naur 2005-04-28 11:57:38 +00:00
parent 8ae988494b
commit 2cd1e740ee
1 changed files with 4 additions and 7 deletions

View File

@ -59,9 +59,6 @@ import org.lwjgl.opengl.Display;
* @version $Revision$ * @version $Revision$
*/ */
public class Mouse { public class Mouse {
/** Mouse constraint */
private static int width, height;
/** Has the mouse been created? */ /** Has the mouse been created? */
private static boolean created; private static boolean created;
@ -299,8 +296,8 @@ public class Mouse {
x = poll_coord1; x = poll_coord1;
y = poll_coord2; y = poll_coord2;
} }
x = Math.min(width - 1, Math.max(0, x)); x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, x));
y = Math.min(height - 1, Math.max(0, y)); y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, y));
dwheel += poll_dwheel; dwheel += poll_dwheel;
read(); read();
} }
@ -373,8 +370,8 @@ public class Mouse {
event_x = readBuffer.get(); event_x = readBuffer.get();
event_y = readBuffer.get(); event_y = readBuffer.get();
} }
event_x = Math.min(width - 1, Math.max(0, event_x)); event_x = Math.min(Display.getDisplayMode().getWidth() - 1, Math.max(0, event_x));
event_y = Math.min(height - 1, Math.max(0, event_y)); event_y = Math.min(Display.getDisplayMode().getHeight() - 1, Math.max(0, event_y));
event_dwheel = readBuffer.get(); event_dwheel = readBuffer.get();
return true; return true;
} else } else