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

Author Topic: [SOLVED] program execution hangs on RenderWindow construction (sometimes)  (Read 10126 times)

0 Members and 1 Guest are viewing this topic.

Proply

  • Newbie
  • *
  • Posts: 7
    • View Profile
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!
« Last Edit: December 06, 2021, 05:11:10 am by Proply »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: program execution hangs on RenderWindow construction (sometimes)
« Reply #1 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Ruckamongus

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: program execution hangs on RenderWindow construction (sometimes)
« Reply #2 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.

Proply

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: program execution hangs on RenderWindow construction (sometimes)
« Reply #3 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.

 

anything