Removed OS message polls from mouse and keyboard poll() and read(), since they can be quite expensive

This commit is contained in:
Elias Naur 2008-01-19 08:49:10 +00:00
parent d184509ac7
commit e448bb0c29
2 changed files with 1 additions and 9 deletions

View File

@ -693,7 +693,6 @@ final class LinuxDisplay implements DisplayImplementation {
} }
public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) { public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
update();
lockAWT(); lockAWT();
try { try {
mouse.poll(grab, coord_buffer, buttons); mouse.poll(grab, coord_buffer, buttons);
@ -703,7 +702,6 @@ final class LinuxDisplay implements DisplayImplementation {
} }
public void readMouse(ByteBuffer buffer) { public void readMouse(ByteBuffer buffer) {
update();
lockAWT(); lockAWT();
try { try {
mouse.read(buffer); mouse.read(buffer);
@ -865,7 +863,6 @@ final class LinuxDisplay implements DisplayImplementation {
} }
public void pollKeyboard(ByteBuffer keyDownBuffer) { public void pollKeyboard(ByteBuffer keyDownBuffer) {
update();
lockAWT(); lockAWT();
try { try {
keyboard.poll(keyDownBuffer); keyboard.poll(keyDownBuffer);
@ -875,7 +872,6 @@ final class LinuxDisplay implements DisplayImplementation {
} }
public void readKeyboard(ByteBuffer buffer) { public void readKeyboard(ByteBuffer buffer) {
update();
lockAWT(); lockAWT();
try { try {
keyboard.read(buffer); keyboard.read(buffer);

View File

@ -354,7 +354,7 @@ final class WindowsDisplay implements DisplayImplementation {
/** /**
* WORKAROUND: * WORKAROUND:
* Making the context current (redundantly) when the window * Making the context current (redundantly) when the window
* is maximized helps some gfx recover from fullscreen * is maximized helps some gfx cards recover from fullscreen
*/ */
try { try {
if (Display.getDrawable().getContext() != null && Display.getDrawable().getContext().isCurrent()) if (Display.getDrawable().getContext() != null && Display.getDrawable().getContext().isCurrent())
@ -393,12 +393,10 @@ final class WindowsDisplay implements DisplayImplementation {
} }
public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) { public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) {
update();
mouse.poll(coord_buffer, buttons); mouse.poll(coord_buffer, buttons);
} }
public void readMouse(ByteBuffer buffer) { public void readMouse(ByteBuffer buffer) {
update();
mouse.read(buffer); mouse.read(buffer);
} }
@ -481,12 +479,10 @@ final class WindowsDisplay implements DisplayImplementation {
} }
public void pollKeyboard(ByteBuffer keyDownBuffer) { public void pollKeyboard(ByteBuffer keyDownBuffer) {
update();
keyboard.poll(keyDownBuffer); keyboard.poll(keyDownBuffer);
} }
public void readKeyboard(ByteBuffer buffer) { public void readKeyboard(ByteBuffer buffer) {
update();
keyboard.read(buffer); keyboard.read(buffer);
} }