5 changed files with 63 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||
|
#include "ofMain.h" |
||||
|
#include "ofApp.h" |
||||
|
|
||||
|
int main() |
||||
|
{ |
||||
|
ofSetupOpenGL(1024, 768, OF_WINDOW); |
||||
|
ofRunApp(new ofApp()); |
||||
|
} |
@ -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) |
||||
|
{ |
||||
|
//
|
||||
|
} |
@ -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 |
Loading…
Reference in new issue