Display.processMessages + Display.swapBuffers != Display.update?

Started by P_Hansson, January 21, 2010, 15:06:59

Previous topic - Next topic

P_Hansson

Hi!

I've decided to use LWJGL for my game, since it's scope seems appropriate for what I have in mind (not too much, not too little, exposes OpenGL and OpenAL which I'm used to).

Anyway, a somewhat basic question:

If I call Display.update I can get key events using Keyboard.next, supposedly because (according to Javadoc) it calls Display.processMessages internally. If I call Display.processMessages and Display.swapBuffers() separately no keyboard input gets registered...

I can use update() if it's really necessary but I'd prefer to process input before rendering/swapping to screen.

Fool Running

I think Display.update() also does a poll on the input (keyboard, mouse, controllers). I think Display.processMessages() just processes the OS messages for the display. What you need that you are missing is a call to Keyboard.poll(), I think.

If you couldn't tell, I'm not sure of all that. :P
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D