SFML RenderWindow taking inconsistent time to display

≡放荡痞女 提交于 2019-12-02 16:23:17

问题


I started a project a few days ago to get to grips with SFML. When I was working on it then, the main sf::RenderWindow constructor would be called instantly. Now that I've come back to the project, it's taking up to 42 seconds in Debug mode to continue beyond the sf::RenderWindow constructor function.

So whenever I run the console appears and 40 seconds later the RenderWindow will appear.

It can't be my computer specifications as I have a very high end PC.

Here's the code in my main function:

int main()
    {
    sf::RenderWindow window(sf::VideoMode(960, 640), "proj v0.0.1"); 

    while (window.isOpen())
    {

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

        window.clear(sf::Color::Black);

        window.display();

    }

    return 0;
}

I'm honestly just very confused as to why there's such a long delay and it's making testing new features very difficult.

来源:https://stackoverflow.com/questions/50988505/sfml-renderwindow-taking-inconsistent-time-to-display

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!