Resources and hints for understanding "duration"?

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

Resources and hints for understanding "duration"?

Post by mattwla »

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: 5538
Joined: 06 Aug 2011, 15:16

Re: Resources and hints for understanding "duration"?

Post by Zini »

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: 59
Joined: 17 Jul 2017, 14:45

Re: Resources and hints for understanding "duration"?

Post by mattwla »

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