SFML community forums

Help => Window => Topic started by: Proply on November 20, 2021, 11:13:44 am

Title: [SOLVED] program execution hangs on RenderWindow construction (sometimes)
Post by: Proply on November 20, 2021, 11:13:44 am
Hi,

I have a very odd problem that has just recently started occurring. When I try to create a RenderWindow variable, my program will simply hang - e.g. the last line of the code below will never execute.

std::cout << "go to here" << std::endl;
sf::RenderWindow window(sf::VideoMode(2560, 1600), "SFML window");
std::cout << "got past here" << std::endl;

Weirdly, if I restart my computer and execute this code, the RenderWindow will be successfully constructed and program execution will continue for the first few times. However, after a couple of minutes, it will start hanging on RenderWindow construction again. Any ideas as to what might be causing this?

Thanks in advance for any replies!
Title: Re: program execution hangs on RenderWindow construction (sometimes)
Post by: eXpl0it3r on November 20, 2021, 11:20:14 am
Might be some background application preventing the execution.
Try disabling your AV software to ensure that's not the source of the error.
And then check other applications like Flux or similar.
Title: Re: program execution hangs on RenderWindow construction (sometimes)
Post by: Ruckamongus on November 22, 2021, 07:14:00 pm
This sounds similar to something I had. Ended up being Corsair's keyboard RGB software of all things. Anything with OpenGL rendering took 30+ seconds to load, it was ridiculous.
Title: Re: program execution hangs on RenderWindow construction (sometimes)
Post by: Proply on December 06, 2021, 05:10:50 am
Thanks, yes I eventually realized that the window would open after waiting a while (~40s), which eventually lead me to identify the keyboard as the culprit. See https://stackoverflow.com/questions/53017551/sfml-renderwindow-taking-a-long-time-to-open-a-window.