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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - szpaq234

Pages: [1]
1
General / Re: window.poll() lags on my desktop PC
« on: April 09, 2016, 07:24:38 pm »
It might be it. I unplugged and it works normally. That would also explain why it works normally on my laptop.

2
General / Re: window.poll() lags on my desktop PC
« on: April 09, 2016, 09:07:34 am »
On both machines I run SFML in 64bit mode with DLLs. I mentioned OS. Only hardware that can impact this in any way is Radeon R9 on my desktop.

3
General / window.poll() lags on my desktop PC
« on: April 09, 2016, 05:06:38 am »
window.poll() sometimes gets stuck. What exactly happens is program spins in the while loop and occasionally window.poll() takes up to 7s !!! to execute. Below is minimal code that causes the problem and as you can see, there's nothing that would interfere with the window even remotely. It seems that sfml doesn't like my PC. This happens only on my desktop running Win10. It work normally on my laptop that also runs win10. Any thoughts ?

I did a quick test, no event is actually being caught during the lag.

#include <SFML/Graphics.hpp>
#include <chrono>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
    while (window.isOpen())
    {
        std::chrono::milliseconds t1 = std::chrono::duration_cast<std::chrono::milliseconds>
            (std::chrono::system_clock::now().time_since_epoch());

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

        std::chrono::milliseconds t2 = std::chrono::duration_cast<std::chrono::milliseconds>
            (std::chrono::system_clock::now().time_since_epoch());
        int dur = (int)((t2 - t1).count());
        if (dur > 20)
            printf("%d\n", dur);

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

    return 0;
}
 

Pages: [1]