Scene::OnUpdate

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Scene::OnUpdate

      Quick question and I am sure I am just not seeing something or I skimmed over the explanation without realising.

      The function Scene::OnUpdate takes in a variable for the delta in time but then doesn't use this variable and instead uses the timeGetTime function to calculate the change since it was last called.

      Could someone explain what I am missing here?
    • Without looking at it, there is most likely a default value for the delta time, this would ideally have the variable used and have the delta time passed in that way, possibly it is something that just never got changed in their source code
      PC - Custom Built
      CPU: 3rd Gen. Intel i7 3770 3.4Ghz
      GPU: ATI Radeon HD 7959 3GB
      RAM: 16GB

      Laptop - Alienware M17x
      CPU: 3rd Gen. Intel i7 - Ivy Bridge
      GPU: NVIDIA GeForce GTX 660M - 2GB GDDR5
      RAM: 8GB Dual Channel DDR3 @ 1600mhz
    • I'm not sure why Mike used timeGetTime() here. My guess is that it's an oversight and that deltaMilliseconds would be just fine, but I'll let him weigh in on the reason.

      -Rez
    • I checked out the code and it looks like the D3D framework is calculating elapsed time as a float, and sending that in to GameCodeApp::OnUpdate(). That gets passed down and eventually ignored by Scene::OnUpdate(), and replaced with a calculated elapsed time in milliseconds via a call to timeGetTime().

      This looks like a holdover perhaps from an earlier version of the code that perhaps needed to calculate this value explicitly, rather than using a passed in value.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Nope - it seemed to have been me that missed something obvious!
      Mr.Mike
      Author, Programmer, Brewer, Patriot