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

Author Topic: Framerate drops from 1.6 to 2.0  (Read 4156 times)

0 Members and 2 Guests are viewing this topic.

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« 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?

Amadeus

  • Newbie
  • *
  • Posts: 5
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #1 on: February 14, 2012, 06:55:56 am »
Do you compile your code with DEBUG mode or RELEASE mode?

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #2 on: February 14, 2012, 06:00:57 pm »
debug

EDIT
Just tested, release build has the same framerate

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #3 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.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #4 on: February 15, 2012, 02:47:38 am »
Are you handling events? Sounds like a infinite graphics loop without event handling and no VSync.

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #5 on: February 15, 2012, 02:59:40 am »
Events are handled in the main thread and graphics are handled in a separate thread.

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #6 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.

RaptorIV

  • Newbie
  • *
  • Posts: 30
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #7 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?

b3ngr33ni3r

  • Newbie
  • *
  • Posts: 6
    • View Profile
Framerate drops from 1.6 to 2.0
« Reply #8 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.