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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gadam

Pages: [1]
1
Graphics / Re: weird crash in sf::thread
« on: October 04, 2016, 10:19:33 am »
@DarkRoku : static_cast solves it indeed
@binary1248 : Looking forward for it

Thanks for your help :)
And good work guys, SFML rocks

2
Graphics / [SOLVED] weird crash in sf::thread
« on: October 03, 2016, 07:07:27 pm »
Hi,

While switching from SFML 2.3.2 to 2.4.0 on a big project, I run in a rather weird crash...

Here is a simple version :
class Base
{
public :
    virtual void foo(){};
};

class Deriv
    : public Base
{
public :
    virtual void foo(){
        printf( "hello\n" );
        sf::Font zFont;
        zFont.loadFromFile( "depend/calibri.ttf" ); //ok!
        sf::Text zText( "yolo", zFont );
        zText.getGlobalBounds();    //crash
    }
};

int main()
{
    Deriv instance;

    sf::Thread thread( &Deriv::foo, &instance );
    thread.launch();

}

1. In this example, the program crash as sool as getGlobalBounds is called.
(More precisely, it only works fine if we remove this call - my debugger is lost and cannot help more)

2. When creating the thread, if we give Base::foo instead of Deriv::foo (which should be the same), I get an error on the SFML code.
error: must use '.*' or '->*' to call pointer-to-member function ...

Note : everything was fine on SFML 2.3.2

I use Code::Blocks with mingw32-gcc-4.9.2

Have you a clue where it can come from ?
Can it be because of a bad library/compiler configuration ?

Pages: [1]
anything