77 lines
1.2 KiB
C++
Raw Normal View History

2014-01-06 02:40:24 +00:00
#include "testApp.h"
// TODO
// ====
2014-01-21 02:25:38 +00:00
// - Add data points to graph as they arrive instead of at fixed points
// - Animate new values
// - Colour range - tween between 2 points
//
2014-01-06 02:40:24 +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();
scene.graphManager.updateInfoText();
2014-01-21 02:25:38 +00:00
scene.setupTitleFbo();
isPaused = false;
2014-01-06 02:40:24 +00:00
}
void testApp::update()
{
if (isPaused) return;
dataManager.update();
scene.update();
if(gui.isVisible)
ofShowCursor();
else
ofHideCursor();
2014-01-06 02:40:24 +00:00
}
void testApp::draw()
{
dataManager.draw();
scene.draw();
2014-01-06 02:40:24 +00:00
}
void testApp::mousePressed(int x, int y, int button)
{
2014-01-06 02:40:24 +00:00
}
void testApp::keyPressed(int key)
{
if (key == 'p')
isPaused = !isPaused;
else if (key == 'f')
ofToggleFullscreen();
else if (key == 'c')
scene.clearGraphData();
else if (key == 't')
scene.graphManager.updateInfoText();
else if (key == 'o')
scene.graphManager.outputData();
scene.keyPressed(key);
2014-01-06 02:40:24 +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
}