nngn
Loading...
Searching...
No Matches
limit.h
Go to the documentation of this file.
1#ifndef NNGN_TIMING_LIMIT_H
2#define NNGN_TIMING_LIMIT_H
3
4#include "timing.h"
5
6namespace nngn {
7
20public:
21 int interval(void) const { return this->m_interval; }
23 void set_interval(int i) { this->m_interval = i; }
25 void limit(void);
26private:
30 int m_interval = 1;
31 time_point last = clock::now();
32};
33
34}
35
36#endif
Simulates a v-sync pause using sleep.
Definition limit.h:19
nngn::Timing::duration duration
Definition limit.h:29
void limit(void)
Sleeps for as long as necessary to maintain a constant frame rate.
Definition limit.cpp:10
nngn::Timing::clock clock
Definition limit.h:28
time_point last
Definition limit.h:31
int m_interval
Definition limit.h:30
nngn::Timing::time_point time_point
Definition limit.h:27
void set_interval(int i)
Definition limit.h:23
int interval(void) const
Definition limit.h:21
for i
Definition font.lua:5
Definition audio.cpp:7
clock::time_point time_point
Definition timing.h:22
std::chrono::steady_clock clock
Definition timing.h:21
clock::duration duration
Definition timing.h:23