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 - ItsAme

Pages: [1]
1
General / Re: Unstable frame rate
« on: May 08, 2016, 01:14:27 pm »
My logic works the same. I just use seconds instead of micros to avoid the division. (Also, I don't calculate the fps but the elapsed time since the last frame which should be about 17ms @ 60fps).

Since the slow frame needs up to 100ms, I can also visually see the lag when moving around elements on the screen. So it's definitly a problem and not a false alarm.

2
General / Unstable frame rate
« on: May 08, 2016, 09:28:49 am »
I'm currently experiencing a very strange and annoying problem:

When using SFML, one frame every second is very slow.
What I did:
 
  • I make a new Visual Studio 2015 C++ Application and add SFML 2.3.2 as a dependency.
  • I'm using the new nuget package manager to achieve this and never had any problems before.
  • Afterwards I copy the example code in the main.cpp file, add some frame time measurement logic
       and print it. No custom code or whatsoever.

main.cpp:

int main() {
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);

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

                float elapsedTime = clock.getElapsedTime().asSeconds();
                                if(elapsedTime > 0.040) {
                                        printf("%f\n", elapsedTime);
                                }
                                clock.restart();

                window.clear();
                window.draw(shape);
                window.display();
        }

        return 0;
}

The slow frame usually needs between 60 and 100ms and appears (exacly) once every second. I'm using sfml since 3 years and never had this issue before. The problem also appears when I comment everything except the window.displace() command.

I'm using Windows 10 and there are no other processes running in the background that might cause this issue. It also happens on other PCs.

Pages: [1]
anything