Last active
December 30, 2015 00:39
-
-
Save sheva29/fa52bdf7f6830f6a915d to your computer and use it in GitHub Desktop.
oF - Including a variable form the main scope in a particular class
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
//testApp reference from another class: | |
//from a .cpp file, for example, "particle.cpp" you can do two things: | |
//a) include "testApp.h" (so you know what's inside the testApp) | |
//b) cast the ofGetAppPtr as a testApp ptr | |
//This is will be the .cpp of the class particle | |
#include "particle.h" | |
#include "testApp.h" | |
void particle::update(){ | |
((testApp*) ofGetAppPtr())->someVariableThatsInTestApp = 100; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment