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

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

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6278
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #60 on: April 13, 2012, 05:21:06 pm »
Thank you a lot for all the feedback! :)

IMO, that's not always linked and in the case of a RessourceManager it mean exactly what it mean and everybody knows what it is exactly.
Yes, "resource manager" is a spread term, nevertheless one could describe the mechanics more clearly. For example, thor::ResourceManager doesn't own the resources (the smart pointers do), it just provides an interface to acquire resources without the need to check if it has already been acquired. That's also why I like the name ResourceCache.

Are there further ideas about how to name the all-in-one manager? Is "multi" an acceptable prefix? The alternative would also be to name the generic one only "ResourceCache" and find another identifier for the specific ones.


- "Provider" would be a slightly more precise name than "Manager"
That's also an option, thanks. It doesn't express the cache semantics either, but maybe that's obvious anyway...


- If you provide an all-in-one manager, you must still provide the individual ones in the public API, for people who split audio and graphics into independant modules
I'm not sure if I've understood that correctly. The all-in-one manager won't be a merge of the single SFML resource managers (like thor::ResourceManager<sf::Texture>), but rather a frontend to interact with multiple resource types of any kind. For example, if one loads the first time a sf::Texture, a corresponding resource manager is created internally, to which the acquire() call is forwarded.

That is, one can actually do everything with the all-in-one manager that is possible with the single specializations, only that the API isn't constrained to one type.


- Don't bother with sf::Music and its openFromFile function, it's not a candidate for being managed by your class. It would be wrong to share sf::Music instances, you need a new instance everytime you want to play a music. And nothing's pre-loaded anyway, audio data is streamed, so there's no point keeping unused musics.
That's true, I remember this statement some time ago. The only reason to manage sf::Music instances would be the uniformity with other resources (for example, the same exception is thrown at loading failure). But it's probably not worth to unify sf::Music at all costs, in this respect it's a nice feature that thor::ResourceManager<sf::Music> won't compile ;)

And are there particular practices to consider at sf::Shader? I have to admit I'm not familiar with shader use cases...
« Last Edit: April 13, 2012, 05:23:56 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Thor 2.0
« Reply #61 on: April 13, 2012, 05:29:14 pm »
Quote
And are there particular practices to consider at sf::Shader? I have to admit I'm not familiar with shader use cases...
Hmm no, as long as you forward all the available loadFromXxx functions, everything should be ok.
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Thor 2.0
« Reply #62 on: April 14, 2012, 09:49:52 pm »
I wish I had time to play with this lib! Looks really cool!

One remark though : you should use spaces instead of tabulation 'cause it looks ugly on github.  ;)
SFML / OS X developer

kkiikki

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Thor 2.0
« Reply #63 on: April 15, 2012, 05:34:53 am »
Okay, so for the past three days now I've been trying to build Thor 1.1 and just can't get it to work. Whenever I click configure the "SFML_INCLUDE_DIR" option gives me an error. I've set that option to C:\SFML\SFML2\include (that where its stored on my computer) and it always just says its not found . :-\

So could ya help tell me what mistakes I'm making? Also I am using SFML 2.0 and followed this tutorial
 http://sfmlcoder.wordpress.com/2011/06/15/building-sfml-2-nmake/
 Sorry for being incompetent  :'(

Astrof

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Thor 2.0
« Reply #64 on: April 15, 2012, 07:33:57 am »
Make sure to copy the FindSFML.cmake file to the cmake modules folder (search earlier in this thread for more details on this). 

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6278
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #65 on: April 15, 2012, 11:35:21 am »
I wish I had time to play with this lib! Looks really cool!
Thank you :)
I know the problem, there are so many interesting projects out there... I hope I'm able to experiment with them one day ;)

One remark though : you should use spaces instead of tabulation 'cause it looks ugly on github.  ;)
No, I don't like spaces. It is sad enough I often do ugly things in my code to create a clean Doxygen output, I won't do the same with GitHub. It should rather provide an option to set the tab width :P

Okay, so for the past three days now I've been trying to build Thor 1.1 and just can't get it to work.
What generator do you use? For Visual Studio 2010 and g++ there are precompiled libraries, so there's no need to build.

In case you want to use the newest SFML, you should rather checkout the Thor 2.0 development version. For Thor 1.1, you must use the SFML revision provided with Thor.
« Last Edit: April 15, 2012, 11:38:10 am by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

kkiikki

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Thor 2.0
« Reply #66 on: April 15, 2012, 07:09:29 pm »
Quote
Make sure to copy the FindSFML.cmake file to the cmake modules folder (search earlier in this thread for more details on this).
I found the post thanks.


Quote
What generator do you use? For Visual Studio 2010 and g++ there are precompiled libraries, so there's no need to build.

In case you want to use the newest SFML, you should rather checkout the Thor 2.0 development version. For Thor 1.1, you must use the SFML revision provided with Thor.

and I do use Visual Studio so yeah, guess I'll be getting Thor 2.0 instead.

Thanks for your help  :D

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: Thor 2.0
« Reply #67 on: April 16, 2012, 09:53:00 pm »
Don't most IDEs have an option to treat n spaces as a tab when editing but stored as n spaces when saving?
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

guiguizmo91

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Thor 2.0
« Reply #68 on: April 26, 2012, 09:24:37 pm »
Hi ! :)

First of all, this library is really interesting.

Now for the noob question... I followed the tutorial about how to install Thor, I'm based on the last version of SFML (from Github), same for Thor. Everything went fine, it's just that I can't figure how to link the Thor library... I tried to compile by myself one of the examples:
Code: [Select]
g++ Action.cpp -o Action -std=c++0x -<thor> -lsfml-window -lsfml-system
So, my question is, what am I supposed to type to link correctly thor? I'm running an up to date xubuntu.

Thanks.

EDIT: Okay, it was -lthor, makes sense. :)

I tried to compile on Windows Seven, but even though I have set SFML with the path of my fresh SFML install (also made with Cmake), Cmake cannot locate the SFML to generate Thor makefiles. :/ Any idea ?
« Last Edit: April 27, 2012, 12:40:12 pm by guiguizmo91 »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6278
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #69 on: April 27, 2012, 07:49:41 pm »
So, my question is, what am I supposed to type to link correctly thor?
It is explained in the tutorial. I know the one for version 1.1 is slightly outdated, but most parts have remained the same. I'll write one for 2.0 as soon as possible.

I tried to compile on Windows Seven, but even though I have set SFML with the path of my fresh SFML install (also made with Cmake), Cmake cannot locate the SFML to generate Thor makefiles. :/ Any idea ?
First, update to the newest SFML and Thor revisions, I have just changed some CMake code. If SFML isn't found, an error will appear (which should describe what to do, unless its one of the confusing error messages of CMake itself).

In short, define SFML_ROOT to the directory of SFML (containing "include", "lib", "examples" etc.).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

guiguizmo91

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Thor 2.0
« Reply #70 on: April 30, 2012, 09:01:32 pm »
Thanks, it worked like a charm.

About the Windows part, everytime I quit the examples, I get the "Example.exe has stopped functionning." message. I don't really care as I am just toying around for now, but I like things clean.

Any idea why I get the message ?
« Last Edit: May 01, 2012, 12:04:31 am by guiguizmo91 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10390
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #71 on: May 04, 2012, 01:27:07 am »
It seems you're kinda busy but I still want to point out:

Quote
Meanwhile, I have thought about an implementation of a combined resource manager, and it probably won't be a big problem. The old managers are further used in the implementation, and maybe I'll provide them also in the API.
Is this coming any time soon? :D

Also an updated version of the resource tutorial could've been usefull but I got it in the end. ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://dev.my-gate.net/

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6278
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #72 on: May 04, 2012, 05:35:07 pm »
Hey, I've already written the combined resource manager implementation, but haven't had much time to test it yet. But even before I read your post, I had planned to push it today... I hope I can keep this promise ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10390
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #73 on: May 04, 2012, 05:44:56 pm »
Hey, I've already written the combined resource manager implementation, but haven't had much time to test it yet. But even before I read your post, I had planned to push it today... I hope I can keep this promise ;)

Looking forward to it!
Although it means I'll 'have to' refractor my application. ::)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://dev.my-gate.net/

fallahn

  • Sr. Member
  • ****
  • Posts: 476
  • Buns.
    • View Profile
    • Trederia
Re: Thor 2.0
« Reply #74 on: May 05, 2012, 11:26:14 am »
Hey there!
I downloaded Thor yesterday and have been playing with it for a while, it's a great lib :) One thing that struck me though was that I felt it was a bit inflexible to render particle systems to a RenderWindow only, so I changed
Code: [Select]
ParticleSystem::draw(sf::RenderWindow& renderWindow) to
Code: [Select]
ParticleSystem::draw(sf::RenderTarget& renderTarget, sf::RenderStates& renderStates)This way I can render a particle system to a RenderTexture as well as a RenderWindow, change the BlendMode and use shaders for post FX during off screen rendering. Sorry if I've missed something and there's already a better way to do this, but I've only been using Thor for a few hours. I will definitely being using this lib a lot :D