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.


Topics - Ltp0wer

Pages: [1]
1
General / Polling for events drastically lowers frame rate
« on: October 14, 2011, 01:29:54 am »
I am having a strange problem.

Anytime I am polling for events, my frame rate drops incredibly. Even more so if I am moving the mouse while polling for events.

For example, with this code:
Code: [Select]

#include <SFML/Graphics.hpp>


int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 800), "SFML window");


    while (window.IsOpened())
    {
        window.Clear();


        /*
        sf::Event event;
        while (window.PollEvent(event))
        {
            if (event.Type == sf::Event::Closed)
                window.Close();

            if (event.Type == sf::Event::KeyPressed)
            {
                if (event.Key.Code == sf::Keyboard::Key::Escape)
                    window.Close();
            }
        }
        */

        window.Display();
    }

    return EXIT_SUCCESS;


I get well over 1000 FPS with this code. When I uncomment the block polling for events, I get around 50 fps, and if I move my mouse around the window (slowly or quickly), it drops to a range of 1-20.

My specs are:
Q6600 Intel Core2Quad 2.66ghz
Nvidia GeForce GTX 260
3.5GB of RAM

I am using SFML 2.0

I don't think this is an SFML problem, as old programs I made in SFML 1.6 on a different computer, run slow as well on this computer. Also, my friend who also uses SFML 2.0, sent me a program he made that just displays the FPS in the graphics window. As I expected, I get the same low fps problem.

Are there any known issues that would cause this? I've already tried updating my graphics card drivers, and it hasn't helped.

Thanks.

Edit:

Operating system is Windows 7 32bit

Also, I have tried compiling my programs in both debug and release mode, as well as both dynamic linking and static linking, and I have the same issue.

Pages: [1]
anything