2014-01-06 02:40:24 +00:00
|
|
|
#include "testApp.h"
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
// TODO
|
|
|
|
|
// ====
|
2014-01-14 19:44:05 +00:00
|
|
|
// - Add text planes
|
|
|
|
|
// - Add animated camera
|
|
|
|
|
// - Colour range - tweet between 3 points
|
2014-01-12 20:08:05 +00:00
|
|
|
//
|
2014-01-06 02:40:24 +00:00
|
|
|
//--------------------------------------------------------------
|
2014-01-12 20:08:05 +00:00
|
|
|
void testApp::setup()
|
|
|
|
|
{
|
|
|
|
|
ofSetFrameRate(30);
|
|
|
|
|
ofSetLogLevel(OF_LOG_SILENT);
|
|
|
|
|
ofSetWindowPosition(0, 100);
|
|
|
|
|
ofEnableSmoothing();
|
|
|
|
|
ofSeedRandom(ofRandom(23243));
|
|
|
|
|
ofSetFullscreen(true);
|
|
|
|
|
ofSetVerticalSync(true);
|
|
|
|
|
|
|
|
|
|
dataManager.setup();
|
|
|
|
|
scene.setup();
|
|
|
|
|
gui.setup();
|
|
|
|
|
|
|
|
|
|
isPaused = false;
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
void testApp::update()
|
|
|
|
|
{
|
|
|
|
|
if (isPaused) return;
|
|
|
|
|
|
|
|
|
|
dataManager.update();
|
|
|
|
|
scene.update();
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
|
|
|
|
|
void testApp::draw()
|
|
|
|
|
{
|
|
|
|
|
dataManager.draw();
|
|
|
|
|
scene.draw();
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
|
|
|
|
|
void testApp::mousePressed(int x, int y, int button)
|
|
|
|
|
{
|
|
|
|
|
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
|
|
|
|
|
void testApp::keyPressed(int key)
|
|
|
|
|
{
|
|
|
|
|
if (key == 'p')
|
|
|
|
|
isPaused = !isPaused;
|
|
|
|
|
else if (key == 'f')
|
|
|
|
|
ofToggleFullscreen();
|
|
|
|
|
else if (key == 'c')
|
|
|
|
|
scene.clearGraphData();
|
|
|
|
|
|
|
|
|
|
scene.keyPressed(key);
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-12 20:08:05 +00:00
|
|
|
|
|
|
|
|
void testApp::windowResized(int w, int h)
|
|
|
|
|
{
|
2014-01-14 15:12:43 +00:00
|
|
|
scene.setViewport();
|
2014-01-06 02:40:24 +00:00
|
|
|
}
|