Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
LoopTimingData.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_CORE_LOOP_TIMING_DATA_H_
34#define DVD_CORE_LOOP_TIMING_DATA_H_
35
36namespace Divide
37{
42
44{
45 PROPERTY_R( U64, appCurrentTimeUS, 0ULL );
46 PROPERTY_R( U64, gameCurrentTimeUS, 0ULL );
47
49 PROPERTY_R( U64, appTimeDeltaUS, 0ULL );
51 PROPERTY_R( U64, gameTimeDeltaUS, 0ULL );
52
53 PROPERTY_RW( U64, accumulator, 0ULL );
54
55 PROPERTY_RW( U8, updateLoops, 0u );
56 PROPERTY_RW( bool, freezeGameTime, true ); //Pause scene processing
57
58 [[nodiscard]] F32 alpha() const noexcept;
59
60 void update( U64 elapsedTimeUSApp, U64 fixedGameTickDurationUS ) noexcept;
61};
62
63} //namespace Divide
64
65#endif //DVD_CORE_LOOP_TIMING_DATA_H_
constexpr U16 TARGET_FRAME_RATE
Application desired framerate for physics and input simulations.
Definition: config.h:97
constexpr U8 TICK_DIVISOR
Definition: config.h:104
constexpr T SecondsToMicroseconds(U a) noexcept
Definition: MathHelper.inl:767
constexpr T MillisecondsToMicroseconds(U a) noexcept
Definition: MathHelper.inl:749
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
uint8_t U8
constexpr U64 MAX_FRAME_TIME_US
constexpr U32 TICKS_PER_SECOND
Application update rate.
uint32_t U32
uint64_t U64
constexpr U64 FIXED_UPDATE_RATE_US
PROPERTY_R(U64, gameCurrentTimeUS, 0ULL)
PROPERTY_RW(U8, updateLoops, 0u)
PROPERTY_R(U64, appCurrentTimeUS, 0ULL)
F32 alpha() const noexcept
PROPERTY_RW(U64, accumulator, 0ULL)
PROPERTY_R(U64, gameTimeDeltaUS, 0ULL)
Simulated app delta time between frames. Can be paused. (e.g. used by physics)
PROPERTY_RW(bool, freezeGameTime, true)
void update(U64 elapsedTimeUSApp, U64 fixedGameTickDurationUS) noexcept
PROPERTY_R(U64, appTimeDeltaUS, 0ULL)
Real app delta time between frames. Can't be paused (e.g. used by editor)