[WF-General] WFTK: [patch 04] event cleanup?

Vassilis Virvilis vasvir at iit.demokritos.gr
Fri Jul 1 05:39:08 PDT 2005


Since this class is not needed anywhere in WFTK sources or demos,
I think it is ok to clean it up.
Especially since there is a duplicate of it in wftk/event_gen.h.

But I will admit it anyway. The reason for this patch is to spark
discussion about WFTK event model.

Follow the chain of motives

1) My application is slow -->
   1a) I don't know why -->
2) I can't profile the damn thing reliably -->
   2a) There are two main suspects event loop, invalidate and redraw code
3) WFTK imposes its own event loop on top of SDL

Let's talk about 3

SDL provides for events like key pres/release, mouse move/press/release/drug?.
That's cool. SDL also provides for user events that SDL doesn't know off. This
is even cooler because we can extend SDL events.

Now WFTK on the other hand defines a base Event and 3 children of it (with
some template stuff). Those are SDLhandler, Timer, Poll. So SDLhandler
handles all SDL events, Timer handles the timer callbacks and Poll is the network
layer.

I am advocating for an implementation  / SDL interface change. Instead of defining
extra events and extra queue to use directly the SDL event queue and extension
mechanism (SDL user events). This way we can even use fast events if desired
http://www.gameprogrammer.com/fastevents/fastevents1.html
since now it is not possible.

I volunteer of course to do it. In such a case it would be nice if somebody can give
me a hint to some WFTK clients so I can test my changes for source compatibility.

Disclaimer: Although I am relatively certain that I can do it in backward
compatible manner for the Timer class I am not so sure for the Poll class since I
lack familiarity

so what do you think? Does anybody remember the arguments behind this design decision?

      .bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wftk-event-cleanup.patch
Type: text/x-patch
Size: 1217 bytes
Desc: not available
Url : http://mail.worldforge.org/pipermail/general/attachments/20050701/e0d9f4c4/wftk-event-cleanup.bin


More information about the General mailing list