SFML community forums

Help => General => Topic started by: Kanoha on November 20, 2016, 12:53:04 pm

Title: SFML 2.4 bugged?
Post by: Kanoha on November 20, 2016, 12:53:04 pm
Hello everyone. I saw that sfml 2.4 was released a few days ago, so I decided to try it out. I installed it and copied/pasted the example code of the sfml tutorial to see if it works. But the console said that he failed to open window's context or something like that. So I thought that maybe, it was my installation of the new sfml that was wrong. I installed the sfml 2.2 again to test, but with the old version, it works perfecty. Am I just stupid, or is it a real problem?
Title: SFML 2.4 bugged?
Post by: eXpl0it3r on November 20, 2016, 01:28:54 pm
SFML 2.4.1 was recently released and we aren't aware of any major issues. Did you use SFML 2.4 or 2.4.1? What was the example code? What was the error?
Title: Re: SFML 2.4 bugged?
Post by: Kanoha on November 20, 2016, 10:40:44 pm
I tried the version 2.4.1, with this code:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

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

    return 0;
}
 

It's directly taken from the learn page of this site. I use Code::Blocks with the dynamic version of the sfml. There was no compile errors, but instead of having a green CircleShape, the window was blank. In the console, it was written this message: "Failed to open window's context" that usually appears in multi threading or something like that. And the message was written over and over, at each frame.
Title: Re: SFML 2.4 bugged?
Post by: jamesL on November 21, 2016, 12:38:27 am
where are your dlls

did you have any 2.2 dlls in your path or in system32 or anywhere else ?

Title: Re: SFML 2.4 bugged?
Post by: eXpl0it3r on November 21, 2016, 12:53:17 am
What OS are you using? If Linux, try updating. :)
Title: Re: SFML 2.4 bugged?
Post by: Kanoha on November 26, 2016, 12:50:37 pm
My dlls are the good ones in the right place, because with the 2.2 version it works (if I replace the 2.4 dlls with those of the 2.2 of course). I'm using windows 7, not linux, sorry!
Title: Re: SFML 2.4 bugged?
Post by: miroalex on January 31, 2017, 03:18:27 pm
I receive the same result at the same code example (big amount of messages: "Failed to open window's context")
Windows 7, SFML-2.4.1, Eclipse, static library linking (or dynamically -all the same)
Title: Re: SFML 2.4 bugged?
Post by: miroalex on January 31, 2017, 04:06:14 pm
Now code example works (green circle)
Windows 7, Eclipse, SFML-2.2(GCC 4.9.2 MinGW (DW2) - 32-bit)
Static libraries(sfml-graphics-s,glew,sfml-window-s,sfml-system-s,opengl32,winmm.......). I had to add 'glew' after 'sfml-graphics'
Update 01.02.17:
Windows 7, Eclipse, SFML-2.2(GCC 4.9.2 MinGW (DW2) - 32-bit), also SFML-2.3 or SFML-2.4.0
Static libraries(sfml-graphics-s,sfml-window-s,sfml-system-s,opengl32,winmm.......). - Successful program's operation.
Only  SFML-2.4.1 cannot be used.
Title: Re: SFML 2.4 bugged?
Post by: eXpl0it3r on February 01, 2017, 02:02:18 pm
Well sure, since you use SFML 2.2 now you'll have to link glew.

"Failed to open window's context" sounds a bit odd, because usually that would be "failed to activate", or maybe we changed that just recently.

If you're using an Nvidia card, make sure to update your 5+ years old graphics driver and/or try using this PR (https://github.com/SFML/SFML/pull/1186).
Title: Re: SFML 2.4 bugged?
Post by: miroalex on February 01, 2017, 05:50:27 pm
If you're using an Nvidia card, make sure to update your 5+ years old graphics driver and/or try using this PR (https://github.com/SFML/SFML/pull/1186).
Thank You!
After updating my Geforce card driver, my problem is gone.
And example-program works with SFML-2.4.1 now.