And as a complete surprise, I've actually been doing some game-related programming this week :)
It isn't exactly interesting programming, but it's been fun doing it. I've been recreating my event-dispatcher and input manager code around SFML and, due to how easy SFML makes creating thread-safe code, I've even turned it into a threaded system while I was at it.
I've still got a bit left to do with my input-action code (namely, actually re-write it :)) but so far it's been going well. It took me very little time and effort to wrap an SFML event source (i.e. a window) into a class that would translate the event structure into a series of Event-derived classes and dispatch them to registered listeners. Then a little bit more to write listeners that would let you register multiple other listeners (multiple dispatch) to get events around the entire system.
I've almost finished with my input code as well now, with a keyboard and mouse class that can be registered as event listeners and give you input references to check if a button or key has been pressed (request a key input, it gives you back an input object that is bound to the key... a nice amalgam of polling and events I reckon :). The last section that I've just started on is to bind the inputs into named actions, which will allow a config file to load a set of actions and key mappings into the events and check for the actions by name rather than by key. It should be nicely configurable by the time I finish, unless something shiny distracts me sometime in the next week and I abandon it again :)
After that, I'll start working on some graphical stuff, although I am also thinking of some network engine stuff that I want to add to allow for even more ease of use with networking. If I do that next, I'll do a review on the SFML network package.
Other news: Wedding is getting closer and closer, and I have a hamster show to attend this weekend. Lots of fun :P
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment