matthieu.dufourneaud at fnac.net
Tue Apr 10 02:08:36 PDT 2001
Is it a good method to put my event handler in a separate thread?
In fact what I want is a way to handle events while a function is still
Dave a écrit:
> On Mon, Apr 09, 2001 at 11:18:26PM +0200, Matthieu DUFOURNEAUD wrote:
> >>> How is it possible to handle SDL events like Java AWT events?
> A suggestion, avoid doing it like Java.
> To do it like java, you first have to write an event dispatcher,
> and then have your objects wait on IPC. Java's event model is
> heavily thread oriented, and makes sense for that language, but
> not as much when threading is done on say a process level.
> If you are writing something in C, you are probably better off
> with callback lists which gui elements register for, as with
> typical X programming. If you are doing this in C++ its not
> that hard to write an interface class to handle all this, and
> then derive the various event types.
> These two approaches may simply seem semantically different, but
> that is because the java class libraries have hidden the nasty
> interface to the underlying event system from you...
> david j. goehrig bit twiddler www.valinux.com
> "There was nothing creative, charming, admirable or innovative in
> Pokémon except that it parted small children from their
> money with brutal efficiency. It inexplicably featured the
> dramatic story of cockfighting monsters who lived in your pants..."
> - John Tynes
49, boulevard Normandie Niemen
Tel: +33 (0)4 77 34 15 24
Email: matthieu.dufourneaud at fnac.net
Faculte des Sciences et Techniques de Saint-Etienne
More information about the SDL