From 4687e756cef943d36433e4e13db00885174aa5cb Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Wed, 11 Jan 2017 23:26:07 +0100 Subject: [PATCH] Add example-custom-shorcuts base source files --- example-custom-shortcuts/src/main.cpp | 7 ++++++ example-custom-shortcuts/src/ofApp.cpp | 34 ++++++++++++++++++++++++++ example-custom-shortcuts/src/ofApp.h | 20 +++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 example-custom-shortcuts/src/main.cpp create mode 100644 example-custom-shortcuts/src/ofApp.cpp create mode 100644 example-custom-shortcuts/src/ofApp.h diff --git a/example-custom-shortcuts/src/main.cpp b/example-custom-shortcuts/src/main.cpp new file mode 100644 index 0000000..a26fe86 --- /dev/null +++ b/example-custom-shortcuts/src/main.cpp @@ -0,0 +1,7 @@ +#include "ofMain.h" +#include "ofApp.h" + +int main(){ + ofSetupOpenGL(800, 450, OF_WINDOW); + ofRunApp(new ofApp()); +} diff --git a/example-custom-shortcuts/src/ofApp.cpp b/example-custom-shortcuts/src/ofApp.cpp new file mode 100644 index 0000000..a902f47 --- /dev/null +++ b/example-custom-shortcuts/src/ofApp.cpp @@ -0,0 +1,34 @@ +#include "ofApp.h" + +void ofApp::setup(){ + ofBackground(0); + piMapper.setup(); +} + +void ofApp::update(){ + piMapper.update(); +} + +void ofApp::draw(){ + piMapper.draw(); +} + +void ofApp::keyPressed(int key){ + piMapper.keyPressed(key); +} + +void ofApp::keyReleased(int key){ + piMapper.keyReleased(key); +} + +void ofApp::mousePressed(int x, int y, int button){ + piMapper.mousePressed(x, y, button); +} + +void ofApp::mouseReleased(int x, int y, int button){ + piMapper.mouseReleased(x, y, button); +} + +void ofApp::mouseDragged(int x, int y, int button){ + piMapper.mouseDragged(x, y, button); +} diff --git a/example-custom-shortcuts/src/ofApp.h b/example-custom-shortcuts/src/ofApp.h new file mode 100644 index 0000000..18790b1 --- /dev/null +++ b/example-custom-shortcuts/src/ofApp.h @@ -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 mouseReleased(int x, int y, int button); + void mouseDragged(int x, int y, int button); + + ofxPiMapper piMapper; +};