SFML community forums

Help => Window => Topic started by: RaptorIV on February 13, 2012, 11:59:35 pm

Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 13, 2012, 11:59:35 pm
I recently updated my game engine with SFML 2.0 and after updating for all the API changes and compiling, I noticed a drastic drop in framerate (Before it was capped at 30fps, not I get 7-9 fps). I've tried commenting large sections of code just to see if it may be causing the framerate drop, but the only thing that makes a difference is if comment my Window.Clear(), Window.Draw() loop, and Window.Display() all together. Just commenting one (I.E. just the Draw loop) doesn't make any change.

The Frame is drawn in a separate thread.

Compiling on Windows 7 64bit (32bit exe)  Intel Core i7-2600k

Any reason why this may be happening?
Title: Framerate drops from 1.6 to 2.0
Post by: Amadeus on February 14, 2012, 06:55:56 am
Do you compile your code with DEBUG mode or RELEASE mode?
Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 14, 2012, 06:00:57 pm
debug

EDIT
Just tested, release build has the same framerate
Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 14, 2012, 11:22:22 pm
Right now I am calling the Render thread in the main thread when it is not running, I changed it to call the render thread once and have a while Window->IsOpen() in the render thread. This restores framerate but causes the program to not respond.
Title: Framerate drops from 1.6 to 2.0
Post by: Mario on February 15, 2012, 02:47:38 am
Are you handling events? Sounds like a infinite graphics loop without event handling and no VSync.
Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 15, 2012, 02:59:40 am
Events are handled in the main thread and graphics are handled in a separate thread.
Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 16, 2012, 06:52:08 pm
Also, graphics are not drawn in a a while loop within the graphics thread, the graphics thread is perpetually launched from the main thread.
Title: Framerate drops from 1.6 to 2.0
Post by: RaptorIV on February 18, 2012, 09:16:31 pm
Sorry to keep bumping, but:

Is it better to call the render thread over and over from the main thread, or to call it once and have a while loop in the render thread?
Title: Framerate drops from 1.6 to 2.0
Post by: b3ngr33ni3r on February 24, 2012, 12:50:10 am
Please Help?! I am also having this problem, essentially the exact same thing! any help would be much appreciated.