Skip to content

Instantly share code, notes, and snippets.

@thomasvanta
Last active February 5, 2016 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasvanta/d05c50a24c2afe0efde1 to your computer and use it in GitHub Desktop.
Save thomasvanta/d05c50a24c2afe0efde1 to your computer and use it in GitHub Desktop.
//created by jvcleave
//edited by Thomas Van Ta
//openFrameworks 0.8-0.9 main.cpp
#include "ofMain.h"
#include "ofApp.h"
#if (OF_VERSION_MINOR != 9) && defined(TARGET_OPENGLES)
#include "ofGLProgrammableRenderer.h"
#endif
#define FORCE_PROGRAMMMABLE 1
#ifdef FORCE_PROGRAMMMABLE
#include "ofGLProgrammableRenderer.h"
#endif
int width = 1280;
int height = 720;
int main()
{
ofSetLogLevel(OF_LOG_VERBOSE);
#if defined(TARGET_OPENGLES)
#if (OF_VERSION_MINOR == 9)
ofGLESWindowSettings settings;
settings.width = width;
settings.height = height;
settings.setGLESVersion(2);
ofCreateWindow(settings);
#else
ofSetLogLevel("ofThread", OF_LOG_ERROR);
ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
ofSetupOpenGL(width, height, OF_WINDOW);
#endif
#else
#ifdef FORCE_PROGRAMMMABLE
ofGLWindowSettings glWindowSettings;
glWindowSettings.width = width;
glWindowSettings.height = height;
glWindowSettings.setGLVersion(3, 2);
ofCreateWindow(glWindowSettings);
#else
ofSetLogLevel("ofThread", OF_LOG_ERROR);
ofSetupOpenGL(width, height, OF_WINDOW);
#endif
#endif
ofRunApp( new ofApp() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment