Permalink
Browse files

Merge pull request #136 from thiagohersan/fix-ofGetAppPtr

add note about casting the return pointer of ofGetAppPtr()
  • Loading branch information...
2 parents bc2ea6c + c0d3d93 commit 0ea139a84c9fe5eba8ef8f8fd7333555a4242125 @arturoc arturoc committed Jan 10, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 _documentation/application/ofAppRunner_functions.markdown
@@ -170,7 +170,7 @@ _advanced: False_
_description: _
-Useful to access the variables in the main app from other classes.
+Useful to access the variables in the main app from other classes. The pointer returned by this function has to be cast from an ofBaseApp pointer, to a pointer to your inherited class, before being used.
ie:
@@ -187,7 +187,7 @@ class testApp: public ofBaseApp{
//myClass.cpp
void myClass::method(){
- doSomething( ofGetAppPtr()->someVar );
+ doSomething( ((testApp*)ofGetAppPtr())->someVar );
}
~~~~

0 comments on commit 0ea139a

Please sign in to comment.