Skip to content

Instantly share code, notes, and snippets.

@thomasvanta
Last active February 5, 2016 00:00
Show Gist options
  • Save thomasvanta/d05c50a24c2afe0efde1 to your computer and use it in GitHub Desktop.
Save thomasvanta/d05c50a24c2afe0efde1 to your computer and use it in GitHub Desktop.

Revisions

  1. thomasvanta revised this gist Feb 5, 2016. 1 changed file with 16 additions and 8 deletions.
    24 changes: 16 additions & 8 deletions main.cpp
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    //created by jvcleave
    //openFramewroks 0.8-0.9 main.cpp
    //edited by Thomas Van Ta
    //openFrameworks 0.8-0.9 main.cpp

    #include "ofMain.h"
    #include "ofApp.h"
    @@ -12,33 +13,40 @@
    #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 = 1280;
    settings.height = 720;
    settings.width = width;
    settings.height = height;
    settings.setGLESVersion(2);
    ofCreateWindow(settings);
    #else
    ofSetLogLevel("ofThread", OF_LOG_ERROR);
    ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
    ofSetupOpenGL(1280, 720, OF_WINDOW);
    ofSetupOpenGL(width, height, OF_WINDOW);
    #endif

    #else

    #ifdef FORCE_PROGRAMMMABLE
    ofGLWindowSettings glWindowSettings;
    glWindowSettings.width = 1280;
    glWindowSettings.height = 720;
    glWindowSettings.width = width;
    glWindowSettings.height = height;
    glWindowSettings.setGLVersion(3, 2);
    ofCreateWindow(glWindowSettings);
    #else
    ofSetLogLevel("ofThread", OF_LOG_ERROR);
    ofSetupOpenGL(1280, 720, OF_WINDOW);
    ofSetupOpenGL(width, height, OF_WINDOW);
    #endif

    #endif
    ofRunApp( new ofApp());
    ofRunApp( new ofApp() );
    }
  2. thomasvanta created this gist Dec 16, 2015.
    44 changes: 44 additions & 0 deletions main.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    //created by jvcleave
    //openFramewroks 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 main()
    {
    ofSetLogLevel(OF_LOG_VERBOSE);
    #if defined(TARGET_OPENGLES)
    #if (OF_VERSION_MINOR == 9)
    ofGLESWindowSettings settings;
    settings.width = 1280;
    settings.height = 720;
    settings.setGLESVersion(2);
    ofCreateWindow(settings);
    #else
    ofSetLogLevel("ofThread", OF_LOG_ERROR);
    ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);
    ofSetupOpenGL(1280, 720, OF_WINDOW);
    #endif
    #else
    #ifdef FORCE_PROGRAMMMABLE
    ofGLWindowSettings glWindowSettings;
    glWindowSettings.width = 1280;
    glWindowSettings.height = 720;
    glWindowSettings.setGLVersion(3, 2);
    ofCreateWindow(glWindowSettings);
    #else
    ofSetLogLevel("ofThread", OF_LOG_ERROR);
    ofSetupOpenGL(1280, 720, OF_WINDOW);
    #endif

    #endif
    ofRunApp( new ofApp());
    }