LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: P_Hansson on January 21, 2010, 15:06:59

Title: Display.processMessages + Display.swapBuffers != Display.update?
Post by: P_Hansson on January 21, 2010, 15:06:59
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.
Title: Re: Display.processMessages + Display.swapBuffers != Display.update?
Post by: Fool Running on January 21, 2010, 18:14:20
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