From 5c17102f0b62c67707873d062605fce0e821918e Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 29 Apr 2014 15:12:30 +0200 Subject: [PATCH] Add basic code to example --- example/src/main.cpp | 8 ++++++++ example/src/ofApp.cpp | 36 ++++++++++++++++++++++++++++++++++++ example/src/ofApp.h | 19 +++++++++++++++++++ example/src/ofxPiMapper.cpp | 0 example/src/ofxPiMapper.h | 0 5 files changed, 63 insertions(+) create mode 100644 example/src/ofApp.cpp create mode 100644 example/src/ofApp.h delete mode 100644 example/src/ofxPiMapper.cpp delete mode 100644 example/src/ofxPiMapper.h diff --git a/example/src/main.cpp b/example/src/main.cpp index e69de29..f7292b9 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -0,0 +1,8 @@ +#include "ofMain.h" +#include "ofApp.h" + +int main() +{ + ofSetupOpenGL(1024, 768, OF_WINDOW); + ofRunApp(new ofApp()); +} \ No newline at end of file diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp new file mode 100644 index 0000000..b0c6ee6 --- /dev/null +++ b/example/src/ofApp.cpp @@ -0,0 +1,36 @@ +#include "ofApp.h" + +void ofApp::setup() +{ + cout << "Hello World!" << endl; +} + +void ofApp::update() +{ + ofBackground(0); +} + +void ofApp::draw() +{ + ofRect(100, 100, ofGetWidth()-200, ofGetHeight()-200); +} + +void ofApp::keyPressed(int key) +{ + cout << "Key pressed: " << static_cast(key) << endl; +} + +void ofApp::mousePressed(int x, int y, int button) +{ + cout << "Mouse pressed." << endl; +} + +void ofApp::mouseReleased(int x, int y, int button) +{ + cout << "Mouse released." << endl; +} + +void ofApp::mouseDragged(int x, int y, int button) +{ + // +} \ No newline at end of file diff --git a/example/src/ofApp.h b/example/src/ofApp.h new file mode 100644 index 0000000..4a8c97a --- /dev/null +++ b/example/src/ofApp.h @@ -0,0 +1,19 @@ +#ifndef H_OF_APP +#define H_OF_APP + +#include "ofMain.h" + +class ofApp : public ofBaseApp +{ +public: + void setup(); + void update(); + void draw(); + + void keyPressed(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); +}; + +#endif \ No newline at end of file diff --git a/example/src/ofxPiMapper.cpp b/example/src/ofxPiMapper.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/example/src/ofxPiMapper.h b/example/src/ofxPiMapper.h deleted file mode 100644 index e69de29..0000000