Signals and slots?

Hi
this is my initial mail in this list :slight_smile:
and I want to know, is there a signals and slots concept
in SDL or is there some other free portable sig & slo lib?

I think such one is essential
for a fluent gameplay, because searching all the time through lists may
decrease the performance.

every assistance in this matter is appreciated :-)–
funthing

Well, paragui is switching to libsig++ in the next
major version if you want to do gui programming for
SDL. As for SDL itself, I don’t think such a paradigm
is supported, since most of the targets use event
queues. I’m sure it would be possible to implement a
layer on top of the SDL event queue, but who knows how
much work it would take.

Andrew.

— Matthias wrote:> Hi

this is my initial mail in this list :slight_smile:
and I want to know, is there a signals and slots
concept
in SDL or is there some other free portable sig &
slo lib?

I think such one is essential
for a fluent gameplay, because searching all the
time through lists may
decrease the performance.

every assistance in this matter is appreciated :slight_smile:

funthing


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup

Well, unless you’re getting hundreds of events per frame, it makes no sense to worry about switch() decoding overhead. I can’t see how it could possibly take more than a few tens of cycles to decode an entire SDL message with arguments.

Also note that if you just sort the cases in your switch()es, there will be a single test and a branch-by-table. No compiler I know of will generate switch() code that searches through any form of structure, ever. An if() chain would be the worst possible result, and that only happens when the case values cannot be used to index a jump table.

Anyway, if switch() overhead really is an issue for you, a signal/slots system is definitely the last thing you want. The function call overhead will eat you alive. Also forget about using a normal operating system; Most events you receive will at the very least have travelled through an interrupt handler, a thread safe kernel/user space “gateway” (the “driver API”), and one or more user space libraries.

//David

.---------------------------------------
| David Olofson
| Programmer

david.olofson at reologica.se
Address:
REOLOGICA Instruments AB
Scheelev?gen 30
223 63 LUND
Sweden
---------------------------------------
Phone: 046-12 77 60
Fax: 046-12 50 57
Mobil:
E-mail: david.olofson at reologica.se
WWW: http://www.reologica.se

`-----> We Make Rheology RealOn Sat, 29/06/2002 19:09:37 , Matthias wrote:

Hi
this is my initial mail in this list :slight_smile:
and I want to know, is there a signals and slots concept
in SDL or is there some other free portable sig & slo lib?

I think such one is essential
for a fluent gameplay, because searching all the time through lists may
decrease the performance.