Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Clock.hpp
Go to the documentation of this file.
1/*
2Copyright (C) 2012,2019,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_CLOCK_H
17#define AEONGAMES_CLOCK_H
23
24#include <cstdint>
26
27namespace AeonGames
28{
30 class Clock
31 {
32 public:
34 DLL Clock();
38 DLL explicit Clock ( double starttime );
41 DLL uint64_t GetTime() const;
45 DLL double GetDelta ( const Clock& clock );
49 DLL double GetDelta ( const uint64_t& start_time );
50
53 DLL void Update ( double seconds );
58 DLL void Pause ( bool pause = true );
60 DLL bool IsPaused();
67 DLL void SetTimeScale ( double timescale );
71 DLL double GetTimeScale();
76 DLL void SingleStep();
77 private:
79 uint64_t mTime;
81 double mScale;
83 bool mPaused;
84 };
85}
86#endif
Platform-specific macros, includes, and DLL export/import definitions.
DLL uint64_t GetTime() const
Definition Clock.cpp:33
DLL bool IsPaused()
Definition Clock.cpp:61
DLL void SetTimeScale(double timescale)
Definition Clock.cpp:66
DLL void Update(double seconds)
Definition Clock.cpp:48
DLL void Pause(bool pause=true)
Definition Clock.cpp:56
DLL void SingleStep()
Single step the clock when paused.
Definition Clock.cpp:76
DLL double GetTimeScale()
Definition Clock.cpp:71
DLL Clock()
Construct a clock with local time 0.
Definition Clock.cpp:22
DLL double GetDelta(const Clock &clock)
Definition Clock.cpp:38
<- This is here just for the literals
Definition AABB.hpp:31