SFML community forums

Help => Window => Topic started by: Maksat on October 08, 2019, 09:51:55 am

Title: RenderWindow crashes when creating in fullscreen style on Intel GPU
Post by: Maksat on October 08, 2019, 09:51:55 am
Hello! I've finally released my EasyPianoGame on Steam: https://store.steampowered.com/app/1126220/EasyPianoGame/

I knew a problem about crashing in fullscreen style for a long time. I could not solve it at that moment and just used
sf::RenderWindow window (FSModes[0], "", sf::Style::None);
and forgot afbout it.

After launch, some players started complaining about resolution problems and I decided to add resolution change feature.
So what is going on: When I create fullscreen window like this
sf::RenderWindow window(sf::VideoMode::getFullscreenModes()[0], "", sf::Style::Fullscreen);
it crashes. Not necessarily every time but often enough. And also some times the program crashes when the window closes. It happens when I run program on Intel GPU. In AMD GPU it works fine, but super slow and heavily loads the CPU, this is another problem.

Here is example code:
#include <SFML/Graphics.hpp>

int main()
        auto FSModes = sf::VideoMode::getFullscreenModes();

        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");

        sf::CircleShape shape(100.f);

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

                        if (event.type == sf::Event::KeyPressed)
                                switch (event.key.code)
                                case sf::Keyboard::Escape:
                                case sf::Keyboard::Num1:
                                        window.create(FSModes[3], "", sf::Style::None);
                                case sf::Keyboard::Num2:
                                        window.create(FSModes[3], "", sf::Style::Default);
                                case sf::Keyboard::Num3:
                                        window.create(FSModes[3], "", sf::Style::Fullscreen);
                                case sf::Keyboard::Num4:
                                        window.create(FSModes[0], "", sf::Style::None);
                                case sf::Keyboard::Num5:
                                        window.create(FSModes[0], "", sf::Style::Fullscreen);

                        if (event.type == sf::Event::MouseButtonPressed)
                                auto pos = sf::Mouse::getPosition();
                                shape.setPosition(pos.x - shape.getRadius(), pos.y - shape.getRadius());


        return 0;

Non full-screen window style switches work fine, but when you switch to full-screen style, with a probability of 50% it will crash. Debugger shows unhandled exception in ig7icd32.dll
Title: Re: RenderWindow crashes when creating in fullscreen style on Intel GPU
Post by: eXpl0it3r on October 08, 2019, 11:29:51 am
Congrats on the Early Access! I'll definitely give it a try later.

Sounds like an outdated & buggy Intel driver.
What's your Intel Graphics Chip and what driver version are you running?
Title: Re: RenderWindow crashes when creating in fullscreen style on Intel GPU
Post by: Maksat on October 08, 2019, 01:46:47 pm
Thank you!

OMG! A year ago, I tried a lot of different driver versions for Intel HD graphics 4000 and did not succeed. This time I was sure that the matter was not in the driver and did not touch it. When I saw your reply, I decided to check and update if there are new versions. Problem solved! The new driver was 6 months older. Thanks for the quick response!

But why in other applications I did not notice problems with the full screen mode? After all, at a lower level, it all comes down to using the same piece of code (commands for full-screen mode in our case)?

And why it's working so slow on AMD discrete graphics card? The simple example above runs at about 40-50 FPS whith a long lags and uses 30% of my laptops i3-3120M CPU. Yes it is very old, but when it's running on integrated Intel GPU it uses almost 0%. I'll try to update AMD driver too, just in case =)