From 27e135f80de822084eb5c4004b71e6e322441115 Mon Sep 17 00:00:00 2001 From: javl Date: Tue, 23 Feb 2016 13:18:28 +0100 Subject: [PATCH 1/2] Combined commit to use with v0.9 * Moves examples to separate folder * Renamed project files to the new ofApp instead of testApp * Converts all indents to tabs and removes unneeded whitespace * Applies new functions names; ofRect -> ofDrawRectangle, etc. * Adds makefiles for building on commandline --- 02_threeVertical/src/testApp.cpp | 153 -------- 03_guiControls/src/testApp.cpp | 105 ------ 04_blendClown/src/testApp.cpp | 144 -------- examples/01_twoScreens/Makefile | 13 + .../01_twoScreens}/Project.xcconfig | 0 .../01_twoScreens}/addons.make | 0 .../01_twoScreens}/bin/data/.gitkeep | 0 .../bin/data/SmoothEdgeBlend.frag | 0 .../bin/data/SmoothEdgeBlend.vert | 0 examples/01_twoScreens/config.make | 141 ++++++++ .../01_twoScreens}/openFrameworks-Info.plist | 0 .../01_twoScreens}/src/main.cpp | 6 +- .../01_twoScreens/src/ofApp.cpp | 96 ++--- .../01_twoScreens/src/ofApp.h | 8 +- .../01_twoScreens}/twoScreens.cbp | 4 +- .../01_twoScreens}/twoScreens.vcxproj | 4 +- .../01_twoScreens}/twoScreens.vcxproj.filters | 4 +- .../01_twoScreens}/twoScreens.vcxproj.user | 0 .../01_twoScreens}/twoScreens.workspace | 0 .../twoScreens.xcodeproj/project.pbxproj | 12 +- .../xcschemes/twoScreens Debug.xcscheme | 0 .../xcschemes/twoScreens Release.xcscheme | 0 examples/02_threeVertical/Makefile | 13 + .../02_threeVertical}/Project.xcconfig | 0 .../02_threeVertical}/addons.make | 0 .../02_threeVertical}/bin/data/.gitkeep | 0 examples/02_threeVertical/config.make | 141 ++++++++ .../openFrameworks-Info.plist | 0 .../02_threeVertical}/src/main.cpp | 6 +- examples/02_threeVertical/src/ofApp.cpp | 153 ++++++++ .../02_threeVertical/src/ofApp.h | 10 +- .../02_threeVertical}/threeVertical.cbp | 4 +- .../02_threeVertical}/threeVertical.sln | 0 .../02_threeVertical}/threeVertical.vcxproj | 4 +- .../threeVertical.vcxproj.filters | 4 +- .../threeVertical.vcxproj.user | 0 .../02_threeVertical}/threeVertical.workspace | 0 .../threeVertical.xcodeproj/project.pbxproj | 12 +- .../xcschemes/threeVertical Debug.xcscheme | 0 .../xcschemes/threeVertical Release.xcscheme | 0 examples/03_guiControls/Makefile | 13 + .../03_guiControls}/Project.xcconfig | 0 .../03_guiControls}/addons.make | 4 +- .../03_guiControls}/bin/data/.gitkeep | 0 .../03_guiControls}/bin/data/_settings.xml | 0 examples/03_guiControls/config.make | 141 ++++++++ .../03_guiControls}/guiControls.cbp | 4 +- .../03_guiControls}/guiControls.sln | 0 .../03_guiControls}/guiControls.vcxproj | 4 +- .../guiControls.vcxproj.filters | 4 +- .../03_guiControls}/guiControls.vcxproj.user | 0 .../03_guiControls}/guiControls.workspace | 0 .../guiControls.xcodeproj/project.pbxproj | 12 +- .../xcschemes/guiControls Debug.xcscheme | 0 .../xcschemes/guiControls Release.xcscheme | 0 .../03_guiControls}/openFrameworks-Info.plist | 0 .../03_guiControls}/src/main.cpp | 6 +- examples/03_guiControls/src/ofApp.cpp | 105 ++++++ .../03_guiControls/src/ofApp.h | 6 +- examples/04_blendClown/Makefile | 13 + .../04_blendClown}/Project.xcconfig | 0 .../04_blendClown}/addons.make | 0 .../04_blendClown}/bin/data/.gitkeep | 0 .../04_blendClown}/bin/data/blendClown.png | Bin .../04_blendClown}/bin/data/blendClown.psd | Bin .../04_blendClown}/blendClown.cbp | 4 +- .../04_blendClown}/blendClown.sln | 0 .../04_blendClown}/blendClown.vcxproj | 4 +- .../04_blendClown}/blendClown.vcxproj.filters | 4 +- .../04_blendClown}/blendClown.vcxproj.user | 0 .../04_blendClown}/blendClown.workspace | 0 .../blendClown.xcodeproj/project.pbxproj | 12 +- .../xcschemes/blendClown Debug.xcscheme | 0 .../xcschemes/blendClown Release.xcscheme | 0 examples/04_blendClown/config.make | 141 ++++++++ .../04_blendClown}/openFrameworks-Info.plist | 0 .../04_blendClown}/src/main.cpp | 6 +- examples/04_blendClown/src/ofApp.cpp | 144 ++++++++ .../04_blendClown/src/ofApp.h | 10 +- src/ofxProjectorBlend.cpp | 122 +++---- src/ofxProjectorBlend.h | 44 +-- src/ofxProjectorBlendShader.h | 332 +++++++++--------- 82 files changed, 1394 insertions(+), 778 deletions(-) delete mode 100644 02_threeVertical/src/testApp.cpp delete mode 100644 03_guiControls/src/testApp.cpp delete mode 100644 04_blendClown/src/testApp.cpp create mode 100644 examples/01_twoScreens/Makefile rename {01_twoScreens => examples/01_twoScreens}/Project.xcconfig (100%) rename {01_twoScreens => examples/01_twoScreens}/addons.make (100%) rename {01_twoScreens => examples/01_twoScreens}/bin/data/.gitkeep (100%) rename {01_twoScreens => examples/01_twoScreens}/bin/data/SmoothEdgeBlend.frag (100%) rename {01_twoScreens => examples/01_twoScreens}/bin/data/SmoothEdgeBlend.vert (100%) create mode 100644 examples/01_twoScreens/config.make rename {01_twoScreens => examples/01_twoScreens}/openFrameworks-Info.plist (100%) rename {01_twoScreens => examples/01_twoScreens}/src/main.cpp (81%) rename 01_twoScreens/src/testApp.cpp => examples/01_twoScreens/src/ofApp.cpp (51%) rename 01_twoScreens/src/testApp.h => examples/01_twoScreens/src/ofApp.h (91%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.cbp (98%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.vcxproj (98%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.vcxproj.filters (94%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.vcxproj.user (100%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.workspace (100%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.xcodeproj/project.pbxproj (97%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.xcodeproj/xcshareddata/xcschemes/twoScreens Debug.xcscheme (100%) rename {01_twoScreens => examples/01_twoScreens}/twoScreens.xcodeproj/xcshareddata/xcschemes/twoScreens Release.xcscheme (100%) create mode 100644 examples/02_threeVertical/Makefile rename {02_threeVertical => examples/02_threeVertical}/Project.xcconfig (100%) rename {02_threeVertical => examples/02_threeVertical}/addons.make (100%) rename {02_threeVertical => examples/02_threeVertical}/bin/data/.gitkeep (100%) create mode 100644 examples/02_threeVertical/config.make rename {02_threeVertical => examples/02_threeVertical}/openFrameworks-Info.plist (100%) rename {02_threeVertical => examples/02_threeVertical}/src/main.cpp (81%) create mode 100644 examples/02_threeVertical/src/ofApp.cpp rename 02_threeVertical/src/testApp.h => examples/02_threeVertical/src/ofApp.h (79%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.cbp (98%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.sln (100%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.vcxproj (98%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.vcxproj.filters (94%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.vcxproj.user (100%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.workspace (100%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.xcodeproj/project.pbxproj (97%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.xcodeproj/xcshareddata/xcschemes/threeVertical Debug.xcscheme (100%) rename {02_threeVertical => examples/02_threeVertical}/threeVertical.xcodeproj/xcshareddata/xcschemes/threeVertical Release.xcscheme (100%) create mode 100644 examples/03_guiControls/Makefile rename {03_guiControls => examples/03_guiControls}/Project.xcconfig (100%) rename {03_guiControls => examples/03_guiControls}/addons.make (100%) rename {03_guiControls => examples/03_guiControls}/bin/data/.gitkeep (100%) rename {03_guiControls => examples/03_guiControls}/bin/data/_settings.xml (100%) create mode 100644 examples/03_guiControls/config.make rename {03_guiControls => examples/03_guiControls}/guiControls.cbp (99%) rename {03_guiControls => examples/03_guiControls}/guiControls.sln (100%) rename {03_guiControls => examples/03_guiControls}/guiControls.vcxproj (99%) rename {03_guiControls => examples/03_guiControls}/guiControls.vcxproj.filters (99%) rename {03_guiControls => examples/03_guiControls}/guiControls.vcxproj.user (100%) rename {03_guiControls => examples/03_guiControls}/guiControls.workspace (100%) rename {03_guiControls => examples/03_guiControls}/guiControls.xcodeproj/project.pbxproj (98%) rename {03_guiControls => examples/03_guiControls}/guiControls.xcodeproj/xcshareddata/xcschemes/guiControls Debug.xcscheme (100%) rename {03_guiControls => examples/03_guiControls}/guiControls.xcodeproj/xcshareddata/xcschemes/guiControls Release.xcscheme (100%) rename {03_guiControls => examples/03_guiControls}/openFrameworks-Info.plist (100%) rename {04_blendClown => examples/03_guiControls}/src/main.cpp (81%) create mode 100644 examples/03_guiControls/src/ofApp.cpp rename 03_guiControls/src/testApp.h => examples/03_guiControls/src/ofApp.h (89%) create mode 100644 examples/04_blendClown/Makefile rename {04_blendClown => examples/04_blendClown}/Project.xcconfig (100%) rename {04_blendClown => examples/04_blendClown}/addons.make (100%) rename {04_blendClown => examples/04_blendClown}/bin/data/.gitkeep (100%) rename {04_blendClown => examples/04_blendClown}/bin/data/blendClown.png (100%) rename {04_blendClown => examples/04_blendClown}/bin/data/blendClown.psd (100%) rename {04_blendClown => examples/04_blendClown}/blendClown.cbp (98%) rename {04_blendClown => examples/04_blendClown}/blendClown.sln (100%) rename {04_blendClown => examples/04_blendClown}/blendClown.vcxproj (98%) rename {04_blendClown => examples/04_blendClown}/blendClown.vcxproj.filters (94%) rename {04_blendClown => examples/04_blendClown}/blendClown.vcxproj.user (100%) rename {04_blendClown => examples/04_blendClown}/blendClown.workspace (100%) rename {04_blendClown => examples/04_blendClown}/blendClown.xcodeproj/project.pbxproj (97%) rename {04_blendClown => examples/04_blendClown}/blendClown.xcodeproj/xcshareddata/xcschemes/blendClown Debug.xcscheme (100%) rename {04_blendClown => examples/04_blendClown}/blendClown.xcodeproj/xcshareddata/xcschemes/blendClown Release.xcscheme (100%) create mode 100644 examples/04_blendClown/config.make rename {04_blendClown => examples/04_blendClown}/openFrameworks-Info.plist (100%) rename {03_guiControls => examples/04_blendClown}/src/main.cpp (81%) create mode 100644 examples/04_blendClown/src/ofApp.cpp rename 04_blendClown/src/testApp.h => examples/04_blendClown/src/ofApp.h (82%) diff --git a/02_threeVertical/src/testApp.cpp b/02_threeVertical/src/testApp.cpp deleted file mode 100644 index d5d8943..0000000 --- a/02_threeVertical/src/testApp.cpp +++ /dev/null @@ -1,153 +0,0 @@ -#include "testApp.h" - -//-------------------------------------------------------------- -void testApp::setup(){ - ofSetFrameRate(60); - ofSetVerticalSync(true); - - - blender.setup(640, 480, 3, 20, ofxProjectorBlend_Vertical); - blender.setWindowToDisplaySize(); - - radius = 40; - pos.x = ofRandom(radius, blender.getCanvasWidth()-radius); - pos.y = ofRandom(radius, blender.getCanvasHeight()-radius); - vel.set(10, 10); -} - -//-------------------------------------------------------------- -void testApp::update(){ - - pos += vel; - if(pos.x > blender.getCanvasWidth()-radius) { - pos.x = blender.getCanvasWidth()-radius; - vel.x *= -1; - } - if(pos.x < radius) { - pos.x = radius; - vel.x *= -1; - } - if(pos.y > blender.getCanvasHeight()-radius) { - pos.y = blender.getCanvasHeight()-radius; - vel.y *= -1; - } - if(pos.y < radius) { - pos.y = radius; - vel.y *= -1; - } -} - -//-------------------------------------------------------------- -void testApp::draw(){ - blender.begin(); //call blender.begin() to draw onto the blendable canvas - { - //light gray backaground - ofSetColor(100, 100, 100); - ofRect(0, 0, blender.getCanvasWidth(), blender.getCanvasHeight()); - - //thick grid lines for blending - ofSetColor(255, 255, 255); - ofSetLineWidth(3); - - //vertical line - for(int i = 0; i <= blender.getCanvasWidth(); i+=40){ - ofLine(i, 0, i, blender.getCanvasHeight()); - } - - //horizontal lines - for(int j = 0; j <= blender.getCanvasHeight(); j+=40){ - ofLine(0, j, blender.getCanvasWidth(), j); - } - - ofSetColor(255, 0, 0); - ofCircle(pos, radius); - - //instructions - ofSetColor(255, 255, 255); - ofRect(10, 10, 300, 100); - ofSetColor(0, 0, 0); - ofDrawBitmapString("SPACE - toggle show blend\n[g/G] - adjust gamma\n[p/P] - adjust blend power\n[l/L] adjust luminance", 15, 35); - } - blender.end(); //call when you are finished drawing - - - //this draws to the main window - blender.draw(); -} - -//-------------------------------------------------------------- -void testApp::keyPressed(int key){ - -} - -//-------------------------------------------------------------- -void testApp::keyReleased(int key){ - //hit spacebar to toggle the blending strip - if(key == ' '){ - //toggling this variable effects whether the blend strip is shown - blender.showBlend = !blender.showBlend; - } - - // more info here on what these variables do - // http://local.wasp.uwa.edu.au/~pbourke/texture_colour/edgeblend/ - - else if(key == 'g'){ - blender.gamma[0] -= .05; - blender.gamma[1] -= .05; - } - else if(key == 'G'){ - blender.gamma[0] += .05; - blender.gamma[1] += .05; - } - else if(key == 'l'){ - blender.luminance[0] -= .05; - blender.luminance[1] -= .05; - } - else if(key == 'L'){ - blender.luminance[0] += .05; - blender.luminance[1] += .05; - } - else if(key == 'p'){ - blender.blendPower[0] -= .05; - blender.blendPower[1] -= .05; - } - else if(key == 'P'){ - blender.blendPower[0] += .05; - blender.blendPower[1] += .05; - } -} - -//-------------------------------------------------------------- -void testApp::mouseMoved(int x, int y ){ - -} - -//-------------------------------------------------------------- -void testApp::mouseDragged(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mousePressed(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::mouseReleased(int x, int y, int button){ - -} - -//-------------------------------------------------------------- -void testApp::windowResized(int w, int h){ - -} - -//-------------------------------------------------------------- -void testApp::gotMessage(ofMessage msg){ - -} - -//-------------------------------------------------------------- -void testApp::dragEvent(ofDragInfo dragInfo){ - -} \ No newline at end of file diff --git a/03_guiControls/src/testApp.cpp b/03_guiControls/src/testApp.cpp deleted file mode 100644 index b16f834..0000000 --- a/03_guiControls/src/testApp.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "testApp.h" - -//-------------------------------------------------------------- -void testApp::setup(){ - - blender.setup(PROJECTOR_WIDTH, PROJECTOR_HEIGHT, PROJECTOR_COUNT, PIXEL_OVERLAP); - blender.setWindowToDisplaySize(); - - - gui.addToggle("Show Blend", blender.showBlend); - - for (int i=0; i