SFML community forums
General => Feature requests => Topic started by: jamba on April 06, 2008, 02:37:11 pm
-
I've just had a wee look at your library and I really like the look of it. I was trying, and failing miserably, to make my own library when my brother suggested I check sfml out and it's great.
The one thing which i think my library did well though was the input handling. Instead of the traditional "while (GetEvents(&event)) {switch (event.type)...}" type thing, you just registered a slot in your initialisation code, and then call "HandleEvents()" and all the signals are emitted.
Is there any chance of anything like this in sfml. IMO it is a much more elegant way of handling events. Boost.Signals is a very nice sig slot library :D
-
I agree, it's much more elegant and flexible. But as I don't want to depend on boost, nor wait for the next C++ standard, nor develop my own signal library (which would be quite complex), I've decided to do event handling this way.
But you can perfectly wrap it in your own code using signals, it's very easy ;)
-
I might just do that then.
I can understand not wanting to wait for the next standard. Or build your own. But can I ask why not depend on boost? It's a great library and almost definately will become standard eventually. And the two systems could easily coexist.
Still, from what i've seen so far this is a pretty good library anyway. :D
-
Boost is very good, but it's a very heavy dependency. And one goal of SFML is to use as few dependencies as possible ;)
-
i agree no dependency on boost please :) and especially not boost.signals .. that lib is slow as hell ...
-
I hate to resurrect a dead topic, but I would love to see signal/slot support as well. I can also understand that you don't want to rely on a huge library, so I found these: http://sigslot.sourceforge.net/, http://www.s11n.net/sigslot/, and http://libsigc.sourceforge.net/. I thought they might be of interest to you if you would still like to implement sigslot event handling.
-
Like he said before you can do it yourself and post your code into the wiki.
-
SFML needs to keep this low-level event handling in order to be easily compatible with other languages.
So if you want signals / slots, you'd better add it yourself on top of SFML.