wooo stuff yay
This commit is contained in:
parent
b0bf45a8a5
commit
d1bb9d8c67
91 changed files with 17403 additions and 42 deletions
17
engine/src/program.cpp
Normal file
17
engine/src/program.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#include "program.h"
|
||||
|
||||
long long calibrate() {
|
||||
unsigned long long start = __rdtsc();
|
||||
struct timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 100000000L; // 0.1 seconds
|
||||
nanosleep(&ts, NULL);
|
||||
return (__rdtsc() - start) * 10;
|
||||
}
|
||||
const long long enginend::CPUCLOCK=calibrate();
|
||||
void enginend::program::changescene(scene *scn) {
|
||||
this->currentscene->exit();
|
||||
delete this->currentscene;
|
||||
this->currentscene = scn;
|
||||
this->currentscene->boot();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue