[Gambas-devel] Wait statement changes in recent revision

Benoît Minisini gambas at ...1...
Mon Apr 18 10:31:43 CEST 2011


> Alright Benoît, what changed in the recent revision? ;)
> 
> I noticed before that supposedly recursive Wait statements were
> not-so-recursive, and that I had to call them multiple times to allow
> various events to trigger. If I had two events that had queued, for
> example, I'd have to call Wait twice per frame for each to execute. Now
> calling Wait several times seems to trigger the first event over and
> over without triggering the second. I even had a stack overflow early
> on, which I hadn't seen since my earliest days of programming. I can
> adapt to the new way of things, but I'm not sure exactly what is
> happening now. All I could think of was a GOSUB without a RETURN, haha.
> 
> Specifically the Draw event of the SDL screen executes each time Wait is
> called, without regard to queued device events from the gamepad. If the
> SDL screen Draw event takes 0.125 seconds to execute, but the gamepad
> Read event occurs 30 times per second, is it possible to call Wait
> between frames to drop the excessive gamepad input? This worked before
> but now it just queues the gamepad input for eternity, executing only
> the SDL screen refresh.
> 
> I'm thinking I need to add code to the gamepad processing procedure to
> ignore input if the rendering frame hasn't been updated since the
> previous gamepad input. Good idea, or am I missing something?

Now WAIT should behave as specified in the documentation :

1) With no argument, it will process only (one?) refresh event. Input events 
(mouse, keyboard, joystick) are queued.

2) With a time argument, it will process all events during the specified time.

Normally, joystick events are queud by SDL. Why do you need to ignore them 
from time to time?

-- 
Benoît Minisini




More information about the Devel mailing list