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

Author Topic: Release build slower than debug...  (Read 2349 times)

0 Members and 1 Guest are viewing this topic.

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Release build slower than debug...
« on: March 28, 2010, 06:51:56 am »
Well, this one's definitely different.  The debug build of my game runs at the correct 65 fps.  The release one will either run at 50 or 32.  If I remove the framerate cap, it naturally flies, so no way it's a memory issue...

I naturally tried commenting out things, but nothing helped.

All the game even does is move the player around.  I could post the code for while the game is running unless someone has a good idea what it could be.

UPDATE:  I actually re-implemented my old idea of having a time check at the end, rather than regulating the framerate to be 60 and this fixes the problem...  I don't know if this is the best fix, but for now I'll take it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Release build slower than debug...
« Reply #1 on: March 28, 2010, 02:18:16 pm »
What CPU / OS do you have?
Laurent Gomila - SFML developer

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Release build slower than debug...
« Reply #2 on: March 28, 2010, 08:13:54 pm »
Quote from: "Laurent"
What CPU / OS do you have?


WinXP Pro SP3.  CPU is an Intel dual core like...  2.13ghz or so.  It's around  4 years old.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Release build slower than debug...
« Reply #3 on: March 28, 2010, 08:41:30 pm »
This is weird, I don't know what's happening.

Quote
I actually re-implemented my old idea of having a time check at the end, rather than regulating the framerate to be 60 and this fixes the problem...

Can you tell me more about what you did exactly?
Laurent Gomila - SFML developer

Sivak

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Release build slower than debug...
« Reply #4 on: March 29, 2010, 01:17:30 am »
Quote from: "Laurent"
This is weird, I don't know what's happening.

Can you tell me more about what you did exactly?


Okay, basically at the end of my game loop, after drawing EVERYTHING, I have this:

Code: [Select]

bool bGo = true;
while (bGo)
{ float Time = Clock.GetElapsedTime();
if (Time >= 0.0166)
bGo = false;
}
cmnFunc.CommonFunctionClass::DisplayFPS(Clock);


Basically it "waits" for 1/60th of a second if it needs to and then reports the FPS as the final step before App.Display();

It works and has worked consistently on other people's machines.  Sure, it's 60.2 fps, but that's close enough.