I’m looking for ways to make my OF project compatible both with my preferred development environment (OS X) and my destination platform (RPi 3) so that I can develop and deploy more swiftly. Right now i’m doing a lot of commenting and uncommenting of code to make it work on the two platforms, but there must be a better way.
My RPi build requires special addOns (e.g. ofxRPiCameraVideoGrabber
); the videoGrabber
class for the RPi is a bit different than the one for “normal” computers so some lines should only be executed on some platforms.
Is there something analogous to this code block that one uses to distinguish between OpenGL flavors, but for knowing what processor one is on?
#ifdef TARGET_OPENGLES
shader.load("shadersES2/livedraw");
#else
if(ofIsGLProgrammableRenderer()){
shader.load("shadersGL3/livedraw");
}else{
shader.load("shadersGL2/livedraw");
}
#endif