Created
June 1, 2010 03:15
-
-
Save soundkitchen/420520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "testApp.h" | |
void testApp::setup() | |
{ | |
updateHandler = drawHandler = &testApp::empty; | |
} | |
void testApp::update() | |
{ | |
(this->*updateHandler)(); | |
} | |
void testApp::draw() | |
{ | |
(this->*drawHandler)(); | |
} | |
void testApp::mousePressed(int x, int y, int button) | |
{ | |
updateHandler = &testApp::updateSomething; | |
drawHandler = &testApp::drawSomething; | |
} | |
void testApp::mouseReleased(int x, int y, int button) | |
{ | |
updateHandler = drawHandler = &testApp::empty; | |
} | |
void testApp::updateSomething() | |
{ | |
// (snip) | |
} | |
void testApp::drawSomething() | |
{ | |
// (snip) | |
} | |
void testApp::empty() | |
{ | |
// do nothing. | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofMain.h" | |
class testApp:public ofBaseApp | |
{ | |
// (snip) | |
private: | |
void updateSomething(); | |
void drawSomething(); | |
void empty(); | |
void (testApp::*updateHandler)(); | |
void (testApp::*drawHandler)(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment