Browse Source

Add basic code to example

master
Krisjanis Rijnieks 11 years ago
parent
commit
5c17102f0b
  1. 8
      example/src/main.cpp
  2. 36
      example/src/ofApp.cpp
  3. 19
      example/src/ofApp.h
  4. 0
      example/src/ofxPiMapper.cpp
  5. 0
      example/src/ofxPiMapper.h

8
example/src/main.cpp

@ -0,0 +1,8 @@
#include "ofMain.h"
#include "ofApp.h"
int main()
{
ofSetupOpenGL(1024, 768, OF_WINDOW);
ofRunApp(new ofApp());
}

36
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<char>(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)
{
//
}

19
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

0
example/src/ofxPiMapper.cpp

0
example/src/ofxPiMapper.h

Loading…
Cancel
Save