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

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

0 Members and 4 Guests are viewing this topic.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #135 on: August 11, 2012, 10:41:15 pm »
Thor 2.0 works only with the latest SFML 2.0 version (directly from GitHub). sf::Keyboard::Unknow was introduced after the RC release. Of course you can change/delete that line yourself if you don't want to build SFML. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

frapa

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Frapa website
    • Email
Re: Thor 2.0
« Reply #136 on: August 12, 2012, 09:31:44 pm »
Oh, that's why... I got the RC release... waiting for the official 2.0 release to rebuild SFML  :-[

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #137 on: August 13, 2012, 09:23:44 pm »
You can just pull the latest Git revision of SFML, no need to wait for the release.

By the way, please read my installation tutorial, it explicitly states that you need a recent SFML revision in order to compile the latest Thor ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

frapa

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Frapa website
    • Email
Re: Thor 2.0
« Reply #138 on: August 13, 2012, 11:29:32 pm »
I thought that RC was quite recent... It dates back to April... and since it is an RC there should be just bug fixes right? I did not expect an API change (if this can be considered API change...).

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #139 on: August 14, 2012, 12:15:52 am »
In an active development 4 month is quite a lot of time. Also RC does not mean there can't be any changes to the API, it's just a tag that implies that there won't be any major changes, like going back to the CamelCase naming convention or similar. Additionally if you want to get picking the adding of sf::Keyboard::Unknown isn't a change but an addition. :P

If you want to wait for the release you maybe waiting two weeks but you could also be waiting half a year, Laurent doesn't set a fix date and since it's so simple to compile it yourself, it doesn't really bother me (anymore). :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

frapa

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Frapa website
    • Email
Re: Thor 2.0
« Reply #140 on: August 14, 2012, 11:48:09 am »
Yeah, actually it is very simple to compile it... and since Ubuntu sucks as long as packages update is concerned, we have to compile it ourselves! Archlinux is much better in this aspect (for developers and pro users!).

Anyway I compiled SFML only a month ago I think, and I'm not going to compile it every week!!!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #141 on: August 14, 2012, 12:01:05 pm »
Anyway I compiled SFML only a month ago I think, and I'm not going to compile it every week!!!
Suit yourself. ;)
I don't mind to type every now end then:
git pull
cmake ./
make install

:D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Orwel

  • Full Member
  • ***
  • Posts: 208
    • View Profile
Re: Thor 2.0
« Reply #142 on: August 29, 2012, 08:08:35 pm »
Hello,

i have problem to compil Thor in dynamic.

In tutorial, i dont have make this action :
Quote
Important: Do not only compile SFML, but also install it. That means, you have to build the install target. You do that as follows:

But it is not problem i think, because i can compil Thor in static.

I cut error message, because he are long and repeat same sentence :
...
CMakeFiles\thor.dir/objects.a(StopWatch.cpp.obj):StopWatch.cpp:(.text+0xfd): und
efined reference to `_imp___ZN2sf5Clock7restartEv'
CMakeFiles\thor.dir/objects.a(Timer.cpp.obj):Timer.cpp:(.text+0x7a): undefined r
eference to `_imp___ZN2sf4Time4ZeroE'
CMakeFiles\thor.dir/objects.a(Timer.cpp.obj):Timer.cpp:(.text+0xf8): undefined r
eference to `_imp___ZN2sfmiENS_4TimeES0_'
CMakeFiles\thor.dir/objects.a(Timer.cpp.obj):Timer.cpp:(.text+0x106): undefined
reference to `_imp___ZN2sf4Time4ZeroE'
CMakeFiles\thor.dir/objects.a(Timer.cpp.obj):Timer.cpp:(.text+0x120): undefined
reference to `_imp___ZN2sfltENS_4TimeES0_'
CMakeFiles\thor.dir/objects.a(Timer.cpp.obj):Timer.cpp:(.text+0x162): undefined
reference to `_imp___ZN2sfgeENS_4TimeES0_'
collect2: ld returned 1 exit status
mingw32-make[2]: *** [src/libthor.dll] Error 1
mingw32-make[1]: *** [src/CMakeFiles/thor.dir/all] Error 2
mingw32-make: *** [all] Error 2
 

I think this problem is file's name of dynamic SFML library. See :
libsfml-audio.a
libsfml-graphics.a
libsfml-main.a
libsfml-system.a
libsfml-window.a
 

In debug, replace ".a" by "-d.a".

Result is :
libthor.dll.a
 

But not ".dll"  :(

If you need other information, dont hesitated  ;)

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #143 on: August 29, 2012, 09:53:26 pm »
In tutorial, i dont have make this action :
Then please try it now. Do everything as described in the tutorial, install SFML also in dynamic release mode (the same configuration as Thor). There is a reason why I wrote the tutorial ;)

If this doesn't work, describe exactly each step you performed. I have tested MingW dynamic release just now, there have been no problems.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Thor 2.0
« Reply #144 on: September 08, 2012, 04:35:23 pm »
I don't know whether this has already been reported but... I get a crash with the Events module with Visual Studio 2010. I built Thor and SFML with the latest sources from the Git repositories. It crashes when leaving the handleEvents() function if I use an action that is registered in the ActionMap (ie. press Escape to crash in this example). I wasn't getting any crash when using Thor on OS X though.

From the call stack I saw in the original program it looks like it crashes on a temporary object destruction. However with this sample program I get a "naked" call stack so I'll post the one from the other program.

#include <SFML/Graphics.hpp>
#include <Thor/Events.hpp>

sf::RenderWindow window(sf::VideoMode(640, 480), "window");
thor::ActionMap<std::string>::CallbackSystem m_callbackSystem;
thor::ActionMap<std::string> m_actionsTable(window);
bool run = true;

void someAction(void)
{
        run = false;
}

void handleEvents(void)
{
        m_actionsTable.update();
        m_actionsTable.invokeCallbacks(m_callbackSystem);
}

int main(int argc, char **argv)
{
        m_actionsTable["exit"] = thor::Action(sf::Keyboard::Escape, thor::Action::PressOnce) || thor::Action(sf::Event::Closed);
        m_callbackSystem.connect("exit", std::bind(&someAction));
       
        while (window.isOpen() && run)
        {
                handleEvents();
               
                window.clear();
                window.display();
        }
       
        return 0;
}

Want to play movies in your SFML application? Check out sfeMovie!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Thor 2.0
« Reply #145 on: September 08, 2012, 05:07:50 pm »
Does it happen in debug mode as well as in release mode?
Have tried to wrap things into a class rather than having everything in the global scope (for me any application with sf::RenderWindow or sf::Texture crashes at the beginning in debug mode VS10 x64 ATI)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Thor 2.0
« Reply #146 on: September 08, 2012, 05:12:30 pm »
Yes it happens in both modes, although it can needs a few more times (key presses) in release mode before it crashes.

And everything was originally wrapped in a class. I put everything like that to shorten the source code as much as possible. And I'm not using an ATI graphics card so it can't be related. Moreover the crash does not happen if I press keys that don't match any registered action.
Want to play movies in your SFML application? Check out sfeMovie!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #147 on: September 08, 2012, 05:18:02 pm »
At me, in static debug mode, even the pure SFML code
#include <SFML/Window.hpp>

sf::Window window(sf::VideoMode(640, 480), "window");

int main() {}
crashes before reaching main(). That's why I always avoid globals, and you should try it without, too.

Does this code, where I moved all the class instances to local scope, work for you?
#include <SFML/Graphics.hpp>
#include <Thor/Events.hpp>

bool run = true;

void someAction()
{
        run = false;
}

int main()
{
        sf::RenderWindow window(sf::VideoMode(640, 480), "window");
        thor::ActionMap<std::string>::CallbackSystem m_callbackSystem;
        thor::ActionMap<std::string> m_actionsTable(window);

        m_actionsTable["exit"] = thor::Action(sf::Keyboard::Escape, thor::Action::PressOnce) || thor::Action(sf::Event::Closed);
        m_callbackSystem.connect("exit", std::bind(&someAction));

        while (window.isOpen() && run)
        {
                m_actionsTable.update();
                m_actionsTable.invokeCallbacks(m_callbackSystem);

                window.clear();
                window.display();
        }
}

Do you link SFML and Thor statically or dynamically?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: Thor 2.0
« Reply #148 on: September 08, 2012, 05:48:22 pm »
Your code crashes when I try it, without changing anything. I don't think I did anything special except maybe enabling static stdlib in both SFML and Thor. I also added /MT flag for code generation in order to build against Intel TBB, but this is already the default for SFML with static stdlib. SFML and Thor are both built and linked dynamically though. And I'm running Visual Studio 2010 on Windows 7 x64.

In debug mode I link against debug libraries only (sfml-graphics-d.lib, sfml-window-d.lib, sfml-system-d.lib, sfml-main-d.lib, thor-d.lib) and release libraries for release mode.


Edit: I rebuilt both SFML and Thor without static stdlib and thus removed the /MT flag (and corresponding flag in debug mode) and now it works fine. I thought I had to specify /MT because of Intel TBB (against which I was linking my program) but as a matter of fact it was because I had enabled static stdlib. I'm still wondering why I can't use Thor with static stdlib enabled though.
Want to play movies in your SFML application? Check out sfeMovie!

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor 2.0
« Reply #149 on: September 09, 2012, 12:30:10 pm »
I'm still wondering why I can't use Thor with static stdlib enabled though.
Me too.

I have built SFML and Thor with static standard libraries and I have reproduced your error. I have absolutely no idea why it occurs though, but I think it's rather a configuration/link problem than code...

Has anyone encountered similar issues with static standard library linkage? I have often heard that it is not recommended since different runtime versions might conflict. But when SFML, Thor and the end-user project all use /MT (or /MTd in debug mode), this should be ok, shouldn't it? Are the external libraries used by SFML a possible cause of trouble?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: