Last active
February 5, 2016 00:00
-
-
Save thomasvanta/d05c50a24c2afe0efde1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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