[Gambas-user] [Gambas-User] StarField Example

Benoît Minisini gambas at ...1...
Fri Feb 14 23:35:09 CET 2014


Le 14/02/2014 23:01, Paul Horechuk a écrit :
> Could someone please explain the program flow for the
> Examples/Games/Starfield project? I've stepped through the code after
> setting a breakpoint. The screen_draw procedure executes immediately
> following the Public Sub Main() procedure when it finishes. What
> triggers the Public Sub screen_draw procedure to start and loop?
>

It's a SDL project : when using the gb.sdl component, you create a 
unique window object (the 'screen' global variable), and then this 
object will raise its Draw event automatically at each event loop tick.

The window object has a "FrameRate" property that allows to define the 
frequency of that event (for example, 60 draws by second).

-- 
Benoît Minisini




More information about the User mailing list