ofLiveApp is Linux-only for now. Tested under Ubuntu 14.04.
Write your code in ofApp.cpp file. Once the code is compiled you can just save the source file and see your changes in your application after ~5 seconds.
If you need an object which should not be resetted on each code update, add it to SERIALIZE macro. You can make as many serializable objects as you want.
You can also compile application without RCC++ by passing -DOF_ENABLE_LIVECODING=OFF to cmake command on project generation step.
Giant thanks to @kritzikratzi for making his code and notes about integrating RCC++ and openFrameworks available to anyone! Check it here:
https://github.com/kritzikratzi/runtimeCPPDraw
And, of course, big thanks to @dougbinks for making RCC++ happen and helping me out with serialization!
Q: My application doesn't change when I save the source file!
A: Check the command line of your application, probably the code can't be compiled at runtime.
Q: My application crashes after a code change!
A: There can be many reasons why it happens, I've noticed only one so far: don't use raw pointers.
Q: ofEasyCam stops working after first code update!
A: Use ofxFirstPersonCamera instead, it was rewritten with ofLiveApp in mind.
Make sure that of and ofApp share the same folder.
Change directory to ofApp and perform these steps:
git submodule update --init --recursive
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release
ninja- Copy all of your files (except for
main.cpp) fromofApp/srctoofLiveApp/srcfolder. - Copy addons folders and
ofxaddon()commands fromofApp/CMakeLists.txttoofLiveApp/CMakeLists.txt. - In
ofLiveApp/src/ofApp.cppaddREGISTERCLASS(ofApp)line after#include "ofApp.h". - In
ofLiveApp/src/ofApp.hchange:
From:
#include "ofMain.h"To:
#include "ofLiveMain.h"From:
class ofApp : public ofBaseAppTo:
class ofApp : public ofLiveApp