Difference between PollEvent() and WaitEvent()?

BlitzMax Forums/BlitzMax Programming/Difference between PollEvent() and WaitEvent()?

Gabriel(Posted 2005) [#1]
*** PLEASE READ *** - I KNOW THAT WAITEVENT GIVES TIME BACK TO THE SYSTEM IF THERE IS NO EVENT WHEREAS POLLEVENT WILL GO ON WITH A NULL EVENT. THAT IS -NOT- WHAT I'M ASKING.


I'm running a dual core CPU so PollEvent has been working just fine up till now, but I'm going to be testing soon, so I decided to switch over the WaitEvent. Problem is.. it misses a lot of events that PollEvent catches. Why? Buttons being clicked, tabs being clicked. These are just examples of things which get ignored when I replace PollEvent() with WaitEvent() and I can't find anything in the docs to suggest that there is ( or could be ) any other difference apart from that noted above in caps.


skidracer(Posted 2005) [#2]
PollEvent does not remove the events from the event queue so I would be very suspect how you could keep a MaxGUI program functioning reliable with just the PollEvent command.


DStastny(Posted 2005) [#3]
Skid,

PollEvent does remove event from queue. PeekEvent doest not.

Doug Stastny


Gabriel(Posted 2005) [#4]
Well the docs say :

PollEvent removes an event from the event queue and updates the CurrentEvent global variable.

If there are no events in the event queue, PollEvent returns Null.


And it's working just great.

It's giving me zero CPU time too, so maybe I'll just stick with PollEvent.