7 Replies - 242 Views - Last Post: 09 May 2013 - 04:03 PM Rate Topic: -----

#1 RCQ Games  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 33
  • Joined: 28-March 09

Whats a good method to implement an animation timer

Posted 09 May 2013 - 08:17 AM

Whats a good method to implement an animation timer?
Should i use a different thread for the timer or is it better to keep it simple and just create a function that doesn't end until the animation time length has past

Im using C++ programming on windows with DirectX 11

Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Whats a good method to implement an animation timer

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: -1
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 09:19 AM

Well, it would be easier to know how many times per second you would like your animations updated and integrate that into the main game loop.
Was This Post Helpful? 0
  • +
  • -

#3 RCQ Games  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 33
  • Joined: 28-March 09

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 10:33 AM

but if i want the animation updated by a button press should i go by a timer that is running in the main loop or create a new function especially for tracking animation time
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8837
  • View blog
  • Posts: 33,091
  • Joined: 12-June 08

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 10:43 AM

Why would there be an animation timer? Shouldn't everything be using the core game's timer?
Was This Post Helpful? 0
  • +
  • -

#5 RCQ Games  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 33
  • Joined: 28-March 09

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 11:12 AM

it isn't really another timer so to speak but the return value calculated from the function is different it still uses the same function for actually getting the time

eg. FPS_Timer() divides time by frameCount
AnimationTimer() would return true so the new pose is drawn

This post has been edited by RCQ Games: 09 May 2013 - 11:13 AM

Was This Post Helpful? 0
  • +
  • -

#6 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: -1
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 12:58 PM

AnimationTimer() should only be returning something related to elapsed time, and hold no information regarding knowing when a new animation is drawn. You are using poor logic.
Was This Post Helpful? 0
  • +
  • -

#7 RCQ Games  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 33
  • Joined: 28-March 09

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 02:03 PM

with AnimationTimer() i pass in the time duration of the animation and it calls my GetTime() function until more time has passed that the animation length, it then returns and the new pose is drawn with the rest of the scene
Is this still bad?
Was This Post Helpful? 0
  • +
  • -

#8 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: -1
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Whats a good method to implement an animation timer

Posted 09 May 2013 - 04:03 PM

I don't know what you're doing to be honest.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1