-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathRendererLinux.cpp
More file actions
executable file
·71 lines (52 loc) · 1.81 KB
/
RendererLinux.cpp
File metadata and controls
executable file
·71 lines (52 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "Aluminum/Includes.hpp"
//namespace Aluminum {
using std::chrono::duration_cast;
using std::chrono::nanoseconds;
using std::chrono::milliseconds;
using std::chrono::system_clock;
RendererLinux::RendererLinux() {
printf("in RendererLinux constructor\n");
}
void RendererLinux::start() {
printf("in RendererLinux::start()\n");
FreeGlutGLView::start(this);
}
void RendererLinux::start(std::string name) {
printf("in RendererLinux::start(%s)\n", name.c_str());
FreeGlutGLView::start(this, name);
}
void RendererLinux::onFrame() { printf("you should overwrite me in the subclass!\n"); }
void RendererLinux::onCreate() { }
//prob can delete this "accessView" method now...
void RendererLinux::accessView() {
printf("about to access freeglutGL view...\n");
//[view printView];
}
long RendererLinux::nowPlusMillis(long millis) {
return currentTick + millis;
}
long RendererLinux::millisToNano(long millis) {
return millis;
}
long RendererLinux::now() {
return currentTick;
}
long RendererLinux::setStartTick() {
system_clock::time_point clock = system_clock::now();
startTick = duration_cast<milliseconds>(clock.time_since_epoch()).count();
//startTick = duration_cast<nanoseconds>(clock.time_since_epoch()).count();
currentTick = 0;
std::cout << "startTick is " << startTick << std::endl;
return startTick;
}
long RendererLinux::tick() {
currentTick = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count() - startTick;
//currentTick = duration_cast<nanoseconds>(system_clock::now().time_since_epoch()).count() - startTick;
//printf("currentTick is %i\n", currentTick);
return currentTick;
}
void RendererLinux::mouseDragged(int px, int py) {}
void RendererLinux::mouseDown(int px, int py) {}
void RendererLinux::mouseUp(int px, int py) {}
void RendererLinux::mouseMoved(int px, int py) {}
//}