Browse Source

Add -f flag option to RPi version of he example

master
Krisjanis Rijnieks 11 years ago
parent
commit
dde5819576
  1. 34
      example/src/main.cpp

34
example/src/main.cpp

@ -1,12 +1,34 @@
#include "ofMain.h"
#include "ofApp.h"
#include <string>
int main()
{
#ifdef TARGET_RASPBERRY_PI
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
// Accept arguments in the Pi version
int main(int argc, char* argv[]) {
bool fullscreen = false;
if (argc > 0) {
std::string fullscreenFlag = "-f";
for (int i = 0; i < argc; i++) {
if (strcmp(argv[i], fullscreenFlag.c_str()) == 0) {
fullscreen = true;
break;
}
}
}
if (fullscreen) {
ofSetupOpenGL(600, 500, OF_FULLSCREEN);
} else {
ofSetupOpenGL(800, 450, OF_WINDOW);
}
ofRunApp(new ofApp());
}
#else
ofSetupOpenGL(600, 500, OF_WINDOW);
int main() {
ofSetupOpenGL(800, 600, OF_WINDOW);
ofRunApp(new ofApp());
}
#endif
ofRunApp(new ofApp());
}
Loading…
Cancel
Save