Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
FrameRateHandler.inl
Go to the documentation of this file.
1/*
2Copyright (c) 2018 DIVIDE-Studio
3Copyright (c) 2009 Ionut Cava
4
5This file is part of DIVIDE Framework.
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software
9and associated documentation files (the "Software"), to deal in the Software
10without restriction,
11including without limitation the rights to use, copy, modify, merge, publish,
12distribute, sublicense,
13and/or sell copies of the Software, and to permit persons to whom the
14Software is furnished to do so,
15subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED,
22INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23PARTICULAR PURPOSE AND NONINFRINGEMENT.
24IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25DAMAGES OR OTHER LIABILITY,
26WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27IN CONNECTION WITH THE SOFTWARE
28OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30*/
31
32#ifndef DVD_CORE_TIME_FRAMERATE_HANDLER_INL_
33#define DVD_CORE_TIME_FRAMERATE_HANDLER_INL_
34
35namespace Divide {
36namespace Time {
37
38inline F32 FrameRateHandler::minFrameRate() const noexcept {
39 return _minFPS;
40}
41
42inline F32 FrameRateHandler::maxFrameRate() const noexcept {
43 return _maxFPS;
44}
45
46inline F32 FrameRateHandler::frameRate() const noexcept {
47 return _framerate;
48}
49
50inline F32 FrameRateHandler::frameTime() const noexcept {
51 return 1000.0f / frameRate();
52}
53
54inline void FrameRateHandler::frameRateAndTime(F32& fpsOut, F32& frameTimeOut) const noexcept {
55 fpsOut = frameRate();
56 frameTimeOut = frameTime();
57}
58
59inline F32 FrameRateHandler::averageFrameRate() const noexcept {
61}
62
63inline void FrameRateHandler::frameStates(F32& avgFPSOut, F32& minFPSOut, F32& maxFPSOut) const noexcept {
64 avgFPSOut = averageFrameRate();
65 minFPSOut = _minFPS;
66 maxFPSOut = _maxFPS;
67}
68
69} //namespace Time
70} //namespace Divide
71
72
73#endif //DVD_CORE_TIME_FRAMERATE_HANDLER_INL_
void frameRateAndTime(F32 &fpsOut, F32 &frameTimeOut) const noexcept
F32 averageFrameRate() const noexcept
F32 minFrameRate() const noexcept
F32 maxFrameRate() const noexcept
void frameStates(F32 &avgFPSOut, F32 &minFPSOut, F32 &maxFPSOut) const noexcept
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
constexpr F32 to_F32(const T value)