Resources and hints for understanding "duration"?

Everything about development and the OpenMW source code.
Post Reply
mattwla
Posts: 45
Joined: 17 Jul 2017, 14:45

Resources and hints for understanding "duration"?

Post by mattwla » 21 Dec 2017, 13:54

Hi everyone,

I need some help understanding the concept of "duration" used in OpenMW. A lot of the core gameloop functions take duration as a parameter, or read from a duration member variable.

This is to help with the timing of things regardless of frame rate, right?

How might I go about wrapping my head around the concept. How is duration calculated, is it somehow related to frame rate?

What might be a good function to read through that would clarify how duration is used?

Thanks,

Matt

User avatar
Zini
Posts: 5140
Joined: 06 Aug 2011, 15:16

Re: Resources and hints for understanding "duration"?

Post by Zini » 01 Jan 2018, 15:20

The time between the start of running the main loop for the previous frame and the start of running the main loop for the current frame. Quite simple, actually.

The main loop is a good place to start reading code (OMW::Engine::go, while loop marked with // Start the main rendering loop).

mattwla
Posts: 45
Joined: 17 Jul 2017, 14:45

Re: Resources and hints for understanding "duration"?

Post by mattwla » 05 Jan 2018, 15:49

Thanks for the reply, I've been able to get a pretty general grasp on it and have started using it!

Post Reply

Who is online

Users browsing this forum: Thunderforge, xyzz and 3 guests