Here’s a pair of utility addons I’m throwing out there. As always feel free to fork and make pull requests via Github.
As my advanced logger was causing problems within OF 007 and has been removed for now, I’ve spun it out as an addon for use and testing. I have used it in a few projects and not had any problems so far. You’re fine as long as you don’t try to call it in a destructor since the main logger object is in a singleton object and, as such, you can never know when it will be destroyed.
Additionally, there is an ofxBitmapString which provides a C++ ostream interface to ofDrawBitmap string. I grew tired of having to add a stringstream every time I wanted to draw some text, so this does it for you.
I updated ofAppUtils so that you use the ofBaseApp callbacks functions directly (as opposed to the old method of renaming them). Another big update is that *all* the ofBaseApp functions are handled down to the scene level which should make combining several apps into a multiscene app relatively trivial.
You cast the ofxApp& reference back to a testApp& reference:
testApp& myApp = dyamic_cast<testApp&>(app);
This is noted farther down in both scene files. Also, I removed the explicit ofxApp reference from ofxSceneManager and ofxScene, so you’e not forced to work this way. The example scenes still do this, but using a testApp& reference directly, thus avoiding the cast.
After being prompted via email, I updated the AppUtils to play nicely on iOS. Everything works and calling runAppWithAppUtils() now dosen’t bork … I also created a new iOS example and added projects files for Windows and Linux.
ofxAppUtils now updated so that ofxControlPanel is not required by default:
the OFX_APP_UTILS_NO_CONTROL_PANEL define is now OFX_APP_UTILS_USE_CONTROL_PANEL
I’m moving forward to eventually remove the ofxControlPanel requirement code and perhaps replace it with ofxUI.
Also, ofxGetAppPtr() (note the “x”) has been added which returns the correct pointer to the running app, where as ofGetAppPtr() does not since the app is inside a wrapper class when you use ofRunAppWithAPpUtils(). The examples have been updated to reflect this.
Thanks for the excellent addon. I was looking all over the placed for very similar utilities for Cinder, and found this for oF. Ended up deciding to switch my entire project over to oF just so I could use this addon.
@danomatika, how would i go about including the transform panel (as a panel or group) to my main gui, defined in ofApp.h, rather than to the gui defined in ofxTransformPanel.h? ofApp *mainApp = (ofApp *)ofxGetAppPtr(); only works from scene header files but not from the ofxTransformPanel.h
The transformer panel is already an ofxGui panel. As in the example, you should be able to create it and pass in a reference to the transformer you want it to control as well as set a custom panel name.
If you want to add all the settings to your own panel, you’ll need to do that manually. Look inside the ofxTransformPanel class.