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

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

0 Members and 2 Guests are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • 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:

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Thor 2.0 released!
« Reply #481 on: December 05, 2021, 07:10:32 pm »
Hello!
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!



DJuego


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • 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
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DJuego

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Thor 2.0 released!
« Reply #483 on: April 16, 2022, 12:19:18 pm »
Quote
I am no longer actively developing Thor.

I feel sad but I understand. This project has given me a lot of happiness. :-*

I have used with intensity almost all its modules, although I have a special affection for the particle system. Without knowing OpenGL it has allowed me to work with particles. I know of no other alternative in the SFML universe.

Quote
There's a chance I will update Thor for SFML 3 once it becomes more stable, but only if there is significant interest and I find the time to work on it.

Yes! I would be very interested in at least support for SFML 3.

Thank you very much for this great project.

DJuego
« Last Edit: April 16, 2022, 12:52:20 pm by DJuego »