3 changed files with 78 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||
|
#include "ofMain.h" |
||||
|
#include "ofApp.h" |
||||
|
#include <string> |
||||
|
#include <vector> |
||||
|
|
||||
|
int main(int argc, char * argv[]){ |
||||
|
bool fullscreen = false; |
||||
|
|
||||
|
vector<string> arguments = vector<string>(argv, argv + argc); |
||||
|
for(int i = 0; i < arguments.size(); ++i){ |
||||
|
if(arguments.at(i) == "-f"){ |
||||
|
fullscreen = true; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if(fullscreen){ |
||||
|
ofSetupOpenGL(800, 450, OF_FULLSCREEN); |
||||
|
}else{ |
||||
|
ofSetupOpenGL(800, 450, OF_WINDOW); |
||||
|
} |
||||
|
|
||||
|
ofRunApp(new ofApp()); |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
#include "ofApp.h" |
||||
|
|
||||
|
void ofApp::setup(){ |
||||
|
ofBackground(0); |
||||
|
mapper.setup(); |
||||
|
} |
||||
|
|
||||
|
void ofApp::update(){ |
||||
|
mapper.update(); |
||||
|
} |
||||
|
|
||||
|
void ofApp::draw(){ |
||||
|
mapper.draw(); |
||||
|
} |
||||
|
|
||||
|
void ofApp::keyPressed(int key){ |
||||
|
mapper.keyPressed(key); |
||||
|
} |
||||
|
|
||||
|
void ofApp::keyReleased(int key){ |
||||
|
mapper.keyReleased(key); |
||||
|
} |
||||
|
|
||||
|
void ofApp::mousePressed(int x, int y, int button){ |
||||
|
mapper.mousePressed(x, y, button); |
||||
|
} |
||||
|
|
||||
|
void ofApp::mouseDragged(int x, int y, int button){ |
||||
|
mapper.mouseDragged(x, y, button); |
||||
|
} |
||||
|
|
||||
|
void ofApp::mouseReleased(int x, int y, int button){ |
||||
|
piMapper.mouseReleased(x, y, button); |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
#pragma once |
||||
|
|
||||
|
#include "ofMain.h" |
||||
|
#include "ofxPiMapper.h" |
||||
|
|
||||
|
class ofApp : public ofBaseApp { |
||||
|
public: |
||||
|
void setup(); |
||||
|
void update(); |
||||
|
void draw(); |
||||
|
|
||||
|
void keyPressed(int key); |
||||
|
void keyReleased(int key); |
||||
|
|
||||
|
void mousePressed(int x, int y, int button); |
||||
|
void mouseDragged(int x, int y, int button); |
||||
|
void mouseReleased(int x, int y, int button); |
||||
|
|
||||
|
ofxPiMapper mapper; |
||||
|
}; |
Loading…
Reference in new issue