Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Thor 2.0 released!  (Read 266262 times)

0 Members and 2 Guests are viewing this topic.


  • SFML Team
  • Hero Member
  • *****
  • Posts: 6272
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0 released!
« Reply #480 on: December 18, 2016, 05:37:50 pm »
The Thor.Action system is built around callbacks, so you're right, thor::ActionContext is indeed the intended way to get access to the original event information. With lambda expressions and std::bind(), it should be possible to use it in a quite compact and concise way.

ActionMap::isActive() is for very simple use cases and does not provide the same level of features as callbacks. Using a procedural approach like this is already quite limited due to its nature. For example, it cannot track whether an event has occured one or multiple times, the boolean return type just allows to query whether it has been fired at least once. In contrast, a callback is invoked exactly once per event.

In order to support such scenarios procedurally, a different paradigma similar to SFML's while (window.pollEvent(event)) would be necessary, but this somehow misses the point of Thor's event-dispatcher abstraction. On the other hand, one might ask why isActive() is still there. And one could be right, it may not fit entirely, but it could help users understand the concept of combining actions and checking if they trigger.

A while ago I considered a design for a slightly higher-level abstraction that would be simpler to use. In particular, it would get rid of boilerplate code such as defining identifiers, and let you directly map from thor::Action to a callback. If you think about it, user-chosen identifiers don't make much sense if they're not queried in a isActive()-style way. In my opinion, such a action->listener map would rather be the way to go for Thor.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:


  • Newbie
  • *
  • Posts: 49
    • View Profile
Re: Thor 2.0 released!
« Reply #481 on: December 05, 2021, 07:10:32 pm »
I admit it: I haven't visited the forum for a long time.  I'm happy that, after so long, SFML still has updates.

And indeed the latest SFML version change has affected the building of this splendid derivative project.

(Its particle system made me very happy in the past :-D Thank you @Nexus. I don't know if there is now any new other alternative based on SFML. ).

Maybe the author is willing to do any maintenance work... :-) Thanks!



  • SFML Team
  • Hero Member
  • *****
  • Posts: 10051
    • View Profile
    • development blog
    • Email
Re: Thor 2.0 released!
« Reply #482 on: December 05, 2021, 09:41:55 pm »
SFML is in the process of being updated, it's not exactly the best idea to already adapt libraries for the newest versions, while the whole API is not yet defined and things will keep breaking a lot. ;)

Make sure to use the SFML 2.6.x branch with Thor or any of the older SFML releases for now.
Official FAQ: https://www.sfml-dev.org/faq.php
Nightly Builds: https://www.nightlybuilds.ch/
Dev Blog: https://dev.my-gate.net/
Thor: http://www.bromeon.ch/libraries/thor/