Results 1 to 6 of 6

Thread: Timer

  1. #1

    Timer

    Asphyre timer. Quick question. What exactly is onprocess? And what is "speed" for opposed to maxfps?

    If I want agame to run at 100 fps with minimal cpu, what should I set to?

  2. #2

    Re: Timer

    Quote Originally Posted by seiferalmasy
    Asphyre timer. Quick question. What exactly is onprocess? And what is "speed" for opposed to maxfps?

    If I want agame to run at 100 fps with minimal cpu, what should I set to?

    MaxFPS sets the upper bound for rendering speed. Sometimes it is not necessary to render your scene with 100000 FPS so you may drop it to the value assigned to MaxFPS.

    Speed is the frequency of OnProcess calling. So if you set up Speed = 100 than it should be called 100 times per second.

    If you want to run your game with 100 FPS then set up MaxFPS = 100.

    You may do the rendering of your scene in OnProcess event but I would not advice that.

    Personaly, I am doing in the OnProcess other not-so-important things. For example, keyboard handling in some static strategy game. 30 times per second is enough and it could save you some FPS if you do the handling in the OnProcess rather than in OnTimer.

  3. #3

    Timer

    You see that is what I thought....

    But guess what....when I place a little test in there like c:=c+1;

    Nothing is added up. Nothing is being done in "onprocess" (speed set to say 60)

    why is that?

  4. #4

    Timer

    Quote Originally Posted by seiferalmasy
    But guess what....when I place a little test in there like c:=c+1;

    Nothing is added up. Nothing is being done in "onprocess" (speed set to say 60)

    why is that?
    You need to call Timer.Process() in your OnTimer event.

  5. #5

  6. #6

    Timer

    Which version are you using, BTW? The Asphyre 3.1 timer doesn't implement max FPS correctly. Not sure if this has been fixed in later versions or not. If you want to get an accurate frame count, check the Latency property each frame and divide 1000 by that number. You'll want to average it out over several frames, though, as latency of individual frames can vary wildly due to thread scheduling, but overall speed remains pretty consistent.

    (It was driving me crazy! I was trying to make an image move on-screen, and it was moving much too fast. Finally I wrote a routine to call outputDebugString every frame with a readout from the system clock, starting from a certain keypress and going until one second had passed. I consistently got 47 responses, even though the timer said it was running at 32 FPS.)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •