ofxPiMapper fixed for C++17 & oF 12.0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1.5 KiB

#include "ProjectionMappingState.h"
namespace ofx {
namespace piMapper {
ProjectionMappingState * ProjectionMappingState::_instance = 0;
ProjectionMappingState * ProjectionMappingState::instance() {
if (_instance == 0) {
_instance = new ofx::piMapper::ProjectionMappingState();
}
return _instance;
}
void ProjectionMappingState::draw(Application * app) {}
void ProjectionMappingState::onKeyPressed(Application * app, ofKeyEventArgs & args) {
switch (args.key) {
case 't':
app->getOfxPiMapper()->getCmdManager().exec(
new AddSurfaceCmd(
app->getOfxPiMapper(),
SurfaceType::TRIANGLE_SURFACE)
);
break;
case 'q':
app->getOfxPiMapper()->getCmdManager().exec(
new AddSurfaceCmd(
app->getOfxPiMapper(),
SurfaceType::QUAD_SURFACE)
);
break;
case OF_KEY_BACKSPACE:
app->getOfxPiMapper()->getCmdManager().exec(
new RmSurfaceCmd(app->getOfxPiMapper()));
break;
default:
break;
}
}
}
}