-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNodes_BoostApp.cpp
66 lines (48 loc) · 1.14 KB
/
Nodes_BoostApp.cpp
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
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Rand.h"
#include "Nodes.h"
using namespace ci;
using namespace ci::app;
using namespace std;
class Nodes_BoostApp : public AppNative
{
public:
void setup();
void mouseDown(MouseEvent event);
void update();
void draw();
void prepareSettings(Settings *settings);
void keyUp(KeyEvent event);
Nodes mNodes;
};
void Nodes_BoostApp::prepareSettings(Settings *settings) {
settings->enableConsoleWindow();
}
void Nodes_BoostApp::setup() {
mNodes.init();
gl::enableAlphaBlending(true);
}
void Nodes_BoostApp::mouseDown(MouseEvent event) {}
void Nodes_BoostApp::update() {
}
void Nodes_BoostApp::draw() {
gl::clear(Color::white());
mNodes.draw();
}
void Nodes_BoostApp::keyUp(KeyEvent event) {
switch (event.getCode()) {
case KeyEvent::KEY_ESCAPE:
quit();
break;
case KeyEvent::KEY_i:
mNodes.printInfos();
break;
case KeyEvent::KEY_RETURN:
mNodes.addNode(Vec2f(Rand::randFloat(getWindowWidth()), Rand::randFloat(getWindowWidth())), "teh new dude");
break;
default:
break;
}
}
CINDER_APP_NATIVE(Nodes_BoostApp, RendererGl)