If I remember correctly the event queues (at least the keyboard event queue) only queue up to some 10 (or so) events...
I'd say there is no need to "pseudo" process them just to make them go away !?
LastBoyScout
Interesting.
I checked memory usage & it didn't seem to grow significantly during game play without emptying the event queues.
Looking at the source we have (for keyboard)
1 2 3 4 5 6 7 8 9 10 11 12 13
| public static void poll() { if (!created) throw new IllegalStateException("Keyboard must be created before you can poll the device"); Display.getImplementation().pollKeyboard(keyDownBuffer); read(); }
private static void read() { readBuffer.compact(); int numEvents = Display.getImplementation().readKeyboard(readBuffer, readBuffer.position()); readBuffer.position(readBuffer.position() + numEvents*EVENT_SIZE); readBuffer.flip(); } |
I guess I need to check what happens if you try to write past the end of a NIO buffer

Alan

/Edit BufferOverflowException it seems - so why didn't this happen?