Skip to content

Commit 1ce5813

Browse files
committed
added define to fast switch between opengl 4.1 or 3.2 compile
1 parent 5d75449 commit 1ce5813

File tree

6 files changed

+26
-8
lines changed

6 files changed

+26
-8
lines changed

src/PatchObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#pragma once
3434
#include "ofMain.h"
3535

36-
#include "config.h"
36+
#include "ofxVPConfig.h"
3737
#include "utils.h"
3838

3939
#include "ofxXmlSettings.h"

src/objects/gui/moTimeline.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ void moTimeline::customReset(){
113113
void moTimeline::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWindow){
114114

115115
ofGLFWWindowSettings settings;
116+
#if defined(MO_GL_VERSION_MAJOR)
116117
settings.setGLVersion(4,1);
118+
#elif defined(MO_GL_VERSION_MINOR)
119+
settings.setGLVersion(3,2);
120+
#else
121+
settings.setGLVersion(3,2);
122+
#endif
117123
settings.shareContextWith = mainWindow;
118124
settings.decorated = true;
119125
settings.resizable = true;
@@ -226,7 +232,7 @@ void moTimeline::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObje
226232
}
227233

228234
// pass timeline data to outlets (if any)
229-
for(int i=0;i<actualTracks->size();i++){
235+
for(int i=0;i<static_cast<int>(actualTracks->size());i++){
230236
if(this->getOutletType(i) == VP_LINK_NUMERIC){
231237
if(actualTracks->at(i).at(2) == 'S' || (actualTracks->at(i).at(0) == '_' && actualTracks->at(i).at(3) == 'S')){ // SWITCHES
232238
ofxTLSwitches* tempMT = (ofxTLSwitches*)timeline->getTrack(actualTracks->at(i));
@@ -497,7 +503,7 @@ string moTimeline::getLoadingTimelineName(string path){
497503
ofDirectory dir(temppath);
498504
if(dir.isDirectory()){
499505
dir.listDir();
500-
for(int i = 0; i < dir.size(); i++){
506+
for(int i = 0; i < static_cast<int>(dir.size()); i++){
501507
size_t found = dir.getPath(i).find_last_of("/\\");
502508
string fileStr = dir.getPath(i).substr(found+1);
503509
size_t found2 = fileStr.find_first_of("_");
@@ -520,7 +526,7 @@ void moTimeline::autoAddTracks(string path){
520526
ofDirectory dir(temppath);
521527
if(dir.isDirectory()){
522528
dir.listDir();
523-
for(int i = 0; i < dir.size(); i++){
529+
for(int i = 0; i < static_cast<int>(dir.size()); i++){
524530
size_t found = dir.getPath(i).find_last_of("/\\");
525531
string fileStr = dir.getPath(i).substr(found+1);
526532
size_t found2 = fileStr.find_first_of("_");
@@ -623,7 +629,7 @@ void moTimeline::loadTimelineData(string folder){
623629
timeline->clear();
624630

625631
vector<ofxTLTrack*> tempTracks = timeline->getPage("Page One")->getTracks();
626-
for(int i=0;i<tempTracks.size();i++){
632+
for(int i=0;i<static_cast<int>(tempTracks.size());i++){
627633
timeline->removeTrack(tempTracks.at(i));
628634
}
629635

@@ -707,7 +713,7 @@ void moTimeline::saveOutletConfig(){
707713
XML.setValue("type",this->outletsType.at(j));
708714

709715
// re-add previous links
710-
for(int z=0;z<tempLinks.size();z++){
716+
for(int z=0;z<static_cast<int>(tempLinks.size());z++){
711717
if(static_cast<int>(floor(tempLinks.at(z).x)) == j){
712718
int newTo = XML.addTag("to");
713719
if(XML.pushTag("to", newTo)){
@@ -743,7 +749,7 @@ void moTimeline::resetOutlets(){
743749

744750
this->numOutlets = tempTracks.size();
745751

746-
for( int i = 0; i < tempTracks.size(); i++){
752+
for( int i = 0; i < static_cast<int>(tempTracks.size()); i++){
747753
if(tempTracks.at(i)->getTrackType() == "Colors"){
748754
_outletParams[i] = new vector<float>();
749755
static_cast<vector<float> *>(_outletParams[i])->assign(3,0.0f);

src/objects/windowing/OutputWindow.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ void OutputWindow::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWindow){
117117
loadWindowSettings();
118118

119119
ofGLFWWindowSettings settings;
120+
#if defined(MO_GL_VERSION_MAJOR)
120121
settings.setGLVersion(4,1);
122+
#elif defined(MO_GL_VERSION_MINOR)
123+
settings.setGLVersion(3,2);
124+
#else
125+
settings.setGLVersion(3,2);
126+
#endif
121127
settings.shareContextWith = mainWindow;
122128
settings.decorated = true;
123129
settings.resizable = true;

src/objects/windowing/ProjectionMapping.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,13 @@ void ProjectionMapping::setupObjectContent(shared_ptr<ofAppGLFWWindow> &mainWind
9191
fileDialog.setIsRetina(this->isRetina);
9292

9393
ofGLFWWindowSettings settings;
94+
#if defined(MO_GL_VERSION_MAJOR)
9495
settings.setGLVersion(4,1);
96+
#elif defined(MO_GL_VERSION_MINOR)
97+
settings.setGLVersion(3,2);
98+
#else
99+
settings.setGLVersion(3,2);
100+
#endif
95101
settings.shareContextWith = mainWindow;
96102
settings.decorated = true;
97103
settings.resizable = true;
File renamed without changes.

src/ofxVisualProgramming.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "ofMain.h"
3636

37-
#include "config.h"
37+
#include "ofxVPConfig.h"
3838

3939
#include "ofxInfiniteCanvas.h"
4040
#include "ofxPDSP.h"

0 commit comments

Comments
 (0)