├── .gitignore ├── README.md ├── animateWithVariable ├── Makefile ├── Project.xcconfig ├── addons.make ├── animateWithVariable.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── animateWithVariable Debug.xcscheme │ │ └── animateWithVariable Release.xcscheme ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── array2dExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── array2dExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── array2dExample Debug.xcscheme │ │ └── array2dExample Release.xcscheme ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── arrayImagesExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── arrayImagesExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── arrayImagesExample Debug.xcscheme │ │ └── arrayImagesExample Release.xcscheme ├── bin │ └── data │ │ ├── .gitkeep │ │ └── chaplin │ │ ├── out-0.png │ │ ├── out-1.png │ │ ├── out-10.png │ │ ├── out-11.png │ │ ├── out-12.png │ │ ├── out-13.png │ │ ├── out-14.png │ │ ├── out-2.png │ │ ├── out-3.png │ │ ├── out-4.png │ │ ├── out-5.png │ │ ├── out-6.png │ │ ├── out-7.png │ │ ├── out-8.png │ │ └── out-9.png ├── config.make ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── arrayOfBrushes ├── Makefile ├── Project.xcconfig ├── addons.make ├── arrayOfBrushes.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── arrayOfBrushes Debug.xcscheme │ │ └── arrayOfBrushes Release.xcscheme ├── bin │ └── data │ │ ├── .gitkeep │ │ ├── Brush-BM-130.jpg │ │ ├── Brush-BM-131.jpg │ │ ├── Brush-BM-132.jpg │ │ ├── Brush-BM-133.jpg │ │ ├── Brush-BM-134.jpg │ │ ├── Brush-BM-135.jpg │ │ ├── Brush-BM-136.jpg │ │ ├── Brush-BM-137.jpg │ │ ├── Brush-BM-138.jpg │ │ └── Brush-BM-139.jpg ├── config.make ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── arrayPushExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── arrayPushExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── arrayPushExample Debug.xcscheme │ │ └── arrayPushExample Release.xcscheme ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── forLoopExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── forLoopExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── forLoopExample Debug.xcscheme │ │ └── forLoopExample Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── functionsThatReturnNumbers ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── functionsThatReturnNumbers.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── functionsThatReturnNumbers Debug.xcscheme │ │ └── functionsThatReturnNumbers Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── generalDrawing ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── generalDrawing.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── generalDrawing Debug.xcscheme │ │ └── generalDrawing Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── ifStatementExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── ifStatementExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── ifStatementExample Debug.xcscheme │ │ └── ifStatementExample Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── imgPixelsWithForLoop ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ ├── .gitkeep │ │ └── housemouse.jpg ├── config.make ├── imgPixelsWithForLoop.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── imgPixelsWithForLoop Debug.xcscheme │ │ └── imgPixelsWithForLoop Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── letterZ ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── letterZ.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── letterZ Debug.xcscheme │ │ └── letterZ Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── letterZinAFunction ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── letterZinAFunction.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── letterZinAFunction Debug.xcscheme │ │ └── letterZinAFunction Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── modOperator ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── modOperator.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── modOperator Debug.xcscheme │ │ └── modOperator Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── mouseControlExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── mouseControlExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── mouseControlExample Debug.xcscheme │ │ └── mouseControlExample Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── objectExample1 ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── objectExample1.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── objectExample1 Debug.xcscheme │ │ └── objectExample1 Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── objectExample2 ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── objectExample2.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── objectExample2 Debug.xcscheme │ │ └── objectExample2 Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── blah.cpp │ ├── blah.hpp │ ├── circle.cpp │ ├── circle.h │ ├── main.cpp │ ├── ofApp.cpp │ ├── ofApp.h │ ├── square.cpp │ └── square.h ├── objectExample3 ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── objectExample2.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── objectExample2 Debug.xcscheme │ │ └── objectExample2 Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── circle.cpp │ ├── circle.h │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── ofMapExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── ofMapExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── ofMapExample Debug.xcscheme │ │ └── ofMapExample Release.xcscheme ├── openFrameworks-Info.plist └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── patternExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── patternExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── patternExample Debug.xcscheme │ │ └── patternExample Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── recursiveExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── recursiveExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── recursiveExample Debug.xcscheme │ │ └── recursiveExample Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── rotationExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── rotationExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── rotationExample Debug.xcscheme │ │ └── rotationExample Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── rotationSketch ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── rotationSketch.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── rotationSketch Debug.xcscheme │ │ └── rotationSketch Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── simpleArrayExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── simpleArrayExample.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── simpleArrayExample Debug.xcscheme │ │ └── simpleArrayExample Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── simpleArrayExample2 ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── simpleArrayExample2.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── simpleArrayExample2 Debug.xcscheme │ │ └── simpleArrayExample2 Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── simpleArrayExample3 ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── simpleArrayExample3.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── simpleArrayExample3 Debug.xcscheme │ │ └── simpleArrayExample3 Release.xcscheme └── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h ├── variables ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h └── variables.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ └── xcschemes │ ├── variables Debug.xcscheme │ └── variables Release.xcscheme ├── videoPixelsWithForLoop ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── src │ ├── main.cpp │ ├── ofApp.cpp │ └── ofApp.h └── videoPixelsWithForLoop.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ └── xcschemes │ ├── videoPixelsWithForLoop Debug.xcscheme │ └── videoPixelsWithForLoop Release.xcscheme └── walkingPersonExample ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin └── data │ └── .gitkeep ├── config.make ├── openFrameworks-Info.plist ├── src ├── data.h ├── dataPlayer.cpp ├── dataPlayer.h ├── main.cpp ├── ofApp.cpp └── ofApp.h └── walkingPersonExample.xcodeproj ├── project.pbxproj └── xcshareddata └── xcschemes ├── walkingPersonExample Debug.xcscheme └── walkingPersonExample Release.xcscheme /.gitignore: -------------------------------------------------------------------------------- 1 | # Some general ignore patterns 2 | build/ 3 | obj/ 4 | *.o 5 | Debug*/ 6 | Release*/ 7 | *.mode* 8 | *.app/ 9 | *.pyc 10 | .svn/ 11 | 12 | 13 | #XCode 14 | *.pbxuser 15 | *.perspective 16 | *.perspectivev3 17 | *.mode1v3 18 | *.mode2v3 19 | #XCode 4 20 | xcuserdata 21 | *.xcworkspace 22 | 23 | #Code::Blocks 24 | *.depend 25 | *.layout 26 | 27 | #Visual Studio 28 | *.sdf 29 | *.opensdf 30 | *.suo 31 | ipch/ 32 | 33 | #Eclipse 34 | .metadata 35 | local.properties 36 | .externalToolBuilders 37 | 38 | 39 | # OS-specific ignore patterns 40 | 41 | #Linux 42 | *~ 43 | # KDE 44 | .directory 45 | 46 | #OSX 47 | .DS_Store 48 | *.swp 49 | *~.nib 50 | # Thumbnails 51 | ._* 52 | 53 | #Windows 54 | # Windows image file caches 55 | Thumbs.db 56 | # Folder config file 57 | Desktop.ini 58 | 59 | #Android 60 | .csettings 61 | /libs/openFrameworksCompiled/project/android/paths.make 62 | 63 | # Miscellaneous 64 | .mailmap 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # letscode 2 | 3 | this is example code for the "let's code" workshop held at SFPC 4 | 5 | put this folder in your apps folder of OF, so it should be: 6 | 7 | of_v0.9.8_osx_release/apps/letsCodeExamples 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /animateWithVariable/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /animateWithVariable/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /animateWithVariable/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/animateWithVariable/addons.make -------------------------------------------------------------------------------- /animateWithVariable/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/animateWithVariable/bin/data/.gitkeep -------------------------------------------------------------------------------- /animateWithVariable/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /animateWithVariable/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /animateWithVariable/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | ofSetCircleResolution(100); 7 | 8 | position = 100; 9 | } 10 | 11 | //-------------------------------------------------------------- 12 | void ofApp::update(){ 13 | 14 | 15 | } 16 | 17 | //-------------------------------------------------------------- 18 | void ofApp::draw(){ 19 | 20 | ofBackground(0); 21 | 22 | 23 | position = position + 1; 24 | 25 | // // position = position + ofRandom(-1,1); 26 | // 27 | // 28 | if (position > ofGetWidth()){ 29 | position = 100; 30 | } 31 | // 32 | 33 | 34 | ofDrawCircle(position, 400, 50); 35 | 36 | } 37 | 38 | //-------------------------------------------------------------- 39 | void ofApp::keyPressed(int key){ 40 | 41 | } 42 | 43 | //-------------------------------------------------------------- 44 | void ofApp::keyReleased(int key){ 45 | 46 | } 47 | 48 | //-------------------------------------------------------------- 49 | void ofApp::mouseMoved(int x, int y ){ 50 | 51 | } 52 | 53 | //-------------------------------------------------------------- 54 | void ofApp::mouseDragged(int x, int y, int button){ 55 | 56 | } 57 | 58 | //-------------------------------------------------------------- 59 | void ofApp::mousePressed(int x, int y, int button){ 60 | 61 | } 62 | 63 | //-------------------------------------------------------------- 64 | void ofApp::mouseReleased(int x, int y, int button){ 65 | 66 | } 67 | 68 | //-------------------------------------------------------------- 69 | void ofApp::mouseEntered(int x, int y){ 70 | 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void ofApp::mouseExited(int x, int y){ 75 | 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::windowResized(int w, int h){ 80 | 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void ofApp::gotMessage(ofMessage msg){ 85 | 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void ofApp::dragEvent(ofDragInfo dragInfo){ 90 | 91 | } 92 | -------------------------------------------------------------------------------- /animateWithVariable/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | 26 | float position; 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /array2dExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /array2dExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /array2dExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/array2dExample/addons.make -------------------------------------------------------------------------------- /array2dExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/array2dExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /array2dExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /array2dExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(500,500,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /array2dExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | for (int i = 0; i < 50; i++){ 8 | for (int j = 0; j < 50; j++){ 9 | positions[i][j] = ofPoint(i*10 + ofRandom(-3,3), j*10 + ofRandom(-3,3)); 10 | radii[i][j] = ofRandom(1,3); 11 | } 12 | } 13 | 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void ofApp::update(){ 18 | 19 | } 20 | 21 | //-------------------------------------------------------------- 22 | void ofApp::draw(){ 23 | 24 | ofBackground(0); 25 | for (int i = 0; i < 50; i++){ 26 | for (int j = 0; j < 50; j++){ 27 | ofDrawCircle(positions[i][j], radii[i][j]); 28 | } 29 | } 30 | } 31 | 32 | //-------------------------------------------------------------- 33 | void ofApp::keyPressed(int key){ 34 | 35 | 36 | for (int i = 0; i < 50; i++){ 37 | for (int j = 0; j < 50; j++){ 38 | positions[i][j] = ofPoint(i*10 + ofRandom(-3,3), j*10 + ofRandom(-3,3)); 39 | radii[i][j] = ofRandom(1,3); 40 | } 41 | } 42 | } 43 | 44 | //-------------------------------------------------------------- 45 | void ofApp::keyReleased(int key){ 46 | 47 | } 48 | 49 | //-------------------------------------------------------------- 50 | void ofApp::mouseMoved(int x, int y ){ 51 | 52 | } 53 | 54 | //-------------------------------------------------------------- 55 | void ofApp::mouseDragged(int x, int y, int button){ 56 | 57 | } 58 | 59 | //-------------------------------------------------------------- 60 | void ofApp::mousePressed(int x, int y, int button){ 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::mouseReleased(int x, int y, int button){ 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::mouseEntered(int x, int y){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::mouseExited(int x, int y){ 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void ofApp::windowResized(int w, int h){ 81 | 82 | } 83 | 84 | //-------------------------------------------------------------- 85 | void ofApp::gotMessage(ofMessage msg){ 86 | 87 | } 88 | 89 | //-------------------------------------------------------------- 90 | void ofApp::dragEvent(ofDragInfo dragInfo){ 91 | 92 | } 93 | -------------------------------------------------------------------------------- /array2dExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | ofPoint positions[50][50]; 26 | float radii[50][50]; 27 | 28 | 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /arrayImagesExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /arrayImagesExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /arrayImagesExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/addons.make -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-0.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-1.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-10.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-11.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-12.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-13.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-14.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-2.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-3.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-4.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-5.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-6.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-7.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-8.png -------------------------------------------------------------------------------- /arrayImagesExample/bin/data/chaplin/out-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayImagesExample/bin/data/chaplin/out-9.png -------------------------------------------------------------------------------- /arrayImagesExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /arrayImagesExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /arrayImagesExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | for (int i = 0; i < 15; i++){ 7 | 8 | myImages[i].load("chaplin/out-" + ofToString(i) + ".png"); 9 | 10 | } 11 | 12 | } 13 | 14 | //-------------------------------------------------------------- 15 | void ofApp::update(){ 16 | 17 | } 18 | 19 | //-------------------------------------------------------------- 20 | void ofApp::draw(){ 21 | 22 | ofBackground(0); 23 | 24 | ofSetRectMode(OF_RECTMODE_CENTER); 25 | 26 | int whichOne = ofMap(mouseX, 0, ofGetWidth(), 0, 14, true); 27 | myImages[whichOne].draw(ofGetWidth()/2, ofGetHeight()/2); 28 | } 29 | 30 | //-------------------------------------------------------------- 31 | void ofApp::keyPressed(int key){ 32 | 33 | } 34 | 35 | //-------------------------------------------------------------- 36 | void ofApp::keyReleased(int key){ 37 | 38 | } 39 | 40 | //-------------------------------------------------------------- 41 | void ofApp::mouseMoved(int x, int y ){ 42 | 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void ofApp::mouseDragged(int x, int y, int button){ 47 | 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void ofApp::mousePressed(int x, int y, int button){ 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::mouseReleased(int x, int y, int button){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::mouseEntered(int x, int y){ 62 | 63 | } 64 | 65 | //-------------------------------------------------------------- 66 | void ofApp::mouseExited(int x, int y){ 67 | 68 | } 69 | 70 | //-------------------------------------------------------------- 71 | void ofApp::windowResized(int w, int h){ 72 | 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void ofApp::gotMessage(ofMessage msg){ 77 | 78 | } 79 | 80 | //-------------------------------------------------------------- 81 | void ofApp::dragEvent(ofDragInfo dragInfo){ 82 | 83 | } 84 | -------------------------------------------------------------------------------- /arrayImagesExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | ofImage myImages[15]; 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /arrayOfBrushes/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /arrayOfBrushes/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /arrayOfBrushes/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/addons.make -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/.gitkeep -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-130.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-130.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-131.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-131.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-132.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-132.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-133.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-133.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-134.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-134.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-135.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-135.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-136.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-136.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-137.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-137.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-138.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-138.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/bin/data/Brush-BM-139.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayOfBrushes/bin/data/Brush-BM-139.jpg -------------------------------------------------------------------------------- /arrayOfBrushes/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /arrayOfBrushes/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /arrayOfBrushes/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | for (int i = 0; i < 10; i++){ 8 | myImages[i].load("Brush-BM-13" + ofToString(i) + ".jpg"); 9 | } 10 | 11 | } 12 | 13 | //-------------------------------------------------------------- 14 | void ofApp::update(){ 15 | 16 | } 17 | 18 | //-------------------------------------------------------------- 19 | void ofApp::draw(){ 20 | 21 | ofScale(0.5, 0.5); 22 | 23 | //cout << ofGetFrameNum() << endl; 24 | //cout << ofGetFrameNum() % 10 << endl; 25 | 26 | 27 | // ------ what's happening in english 28 | // get the elapsed time (ofGetElapsedTimef()) 29 | // divide it by 15 so it's 15 x slower (ie, goes up by 1 every 15 seconds) 30 | // turn it into an integer (cast operator) (int) 31 | // get the remainder if you were to divide by 10 and use that 32 | // to access the element of the array (%10) 33 | 34 | 35 | myImages[ 36 | 37 | 38 | (int)(ofGetElapsedTimef()/15.) % 3 39 | 40 | ].draw(0,0); 41 | } 42 | 43 | //-------------------------------------------------------------- 44 | void ofApp::keyPressed(int key){ 45 | 46 | } 47 | 48 | //-------------------------------------------------------------- 49 | void ofApp::keyReleased(int key){ 50 | 51 | } 52 | 53 | //-------------------------------------------------------------- 54 | void ofApp::mouseMoved(int x, int y ){ 55 | 56 | } 57 | 58 | //-------------------------------------------------------------- 59 | void ofApp::mouseDragged(int x, int y, int button){ 60 | 61 | } 62 | 63 | //-------------------------------------------------------------- 64 | void ofApp::mousePressed(int x, int y, int button){ 65 | 66 | } 67 | 68 | //-------------------------------------------------------------- 69 | void ofApp::mouseReleased(int x, int y, int button){ 70 | 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void ofApp::mouseEntered(int x, int y){ 75 | 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::mouseExited(int x, int y){ 80 | 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void ofApp::windowResized(int w, int h){ 85 | 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void ofApp::gotMessage(ofMessage msg){ 90 | 91 | } 92 | 93 | //-------------------------------------------------------------- 94 | void ofApp::dragEvent(ofDragInfo dragInfo){ 95 | 96 | } 97 | -------------------------------------------------------------------------------- /arrayOfBrushes/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | ofImage myImages[10]; 26 | 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /arrayPushExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /arrayPushExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /arrayPushExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayPushExample/addons.make -------------------------------------------------------------------------------- /arrayPushExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/arrayPushExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /arrayPushExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /arrayPushExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1000,300,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /arrayPushExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | for (int i = 0; i < 5; i++){ 8 | energy[i] = ofRandom(0,1); // random amount of energy; 9 | } 10 | 11 | ofSetCircleResolution(100); 12 | 13 | 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void ofApp::update(){ 18 | 19 | } 20 | 21 | //-------------------------------------------------------------- 22 | void ofApp::draw(){ 23 | 24 | ofBackground(0); 25 | 26 | float width = ofGetWidth(); 27 | float height = ofGetHeight(); 28 | 29 | // find out the total energy: 30 | float totalEnergy = 0; 31 | for (int i = 0; i < 5; i++){ 32 | totalEnergy += energy[i]; 33 | } 34 | 35 | 36 | 37 | // now we can use pct to draw 38 | // step through using x... 39 | float x = 0; 40 | 41 | for (int i = 0; i < 5; i++){ 42 | 43 | // calc pct 44 | float pct = energy[i]/totalEnergy; 45 | 46 | //pct times width gives us how much to move over 47 | float widthMe = width * pct; 48 | 49 | // ellipse is drawn from the center (like rect more center) 50 | // we are drawing the box x,y, widthMe, height 51 | // so the center is x + widthMe/2, height/2 52 | 53 | ofDrawEllipse(x + widthMe/2, height/2, widthMe, height); 54 | 55 | // advance x 56 | x += widthMe; 57 | } 58 | 59 | 60 | 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::keyPressed(int key){ 66 | 67 | 68 | for (int i = 0; i < 5; i++){ 69 | energy[i] = ofRandom(0,1); 70 | } 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void ofApp::keyReleased(int key){ 75 | 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::mouseMoved(int x, int y ){ 80 | 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void ofApp::mouseDragged(int x, int y, int button){ 85 | 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void ofApp::mousePressed(int x, int y, int button){ 90 | 91 | } 92 | 93 | //-------------------------------------------------------------- 94 | void ofApp::mouseReleased(int x, int y, int button){ 95 | 96 | } 97 | 98 | //-------------------------------------------------------------- 99 | void ofApp::mouseEntered(int x, int y){ 100 | 101 | } 102 | 103 | //-------------------------------------------------------------- 104 | void ofApp::mouseExited(int x, int y){ 105 | 106 | } 107 | 108 | //-------------------------------------------------------------- 109 | void ofApp::windowResized(int w, int h){ 110 | 111 | } 112 | 113 | //-------------------------------------------------------------- 114 | void ofApp::gotMessage(ofMessage msg){ 115 | 116 | } 117 | 118 | //-------------------------------------------------------------- 119 | void ofApp::dragEvent(ofDragInfo dragInfo){ 120 | 121 | } 122 | -------------------------------------------------------------------------------- /arrayPushExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | float energy[5]; 25 | 26 | 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /forLoopExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /forLoopExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /forLoopExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/forLoopExample/addons.make -------------------------------------------------------------------------------- /forLoopExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/forLoopExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /forLoopExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /forLoopExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(800,800,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /forLoopExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | ofSetCircleResolution(100); 8 | 9 | 10 | } 11 | 12 | //-------------------------------------------------------------- 13 | void ofApp::update(){ 14 | 15 | } 16 | 17 | //-------------------------------------------------------------- 18 | void ofApp::draw(){ 19 | 20 | 21 | ofBackground(0); 22 | 23 | 24 | // for (int i = 0; i < 50; i++){ 25 | // ofDrawLine(i*10,400, i*10, 100); 26 | // } 27 | // 28 | // 29 | // for (int i = 0; i < 50; i++){ 30 | // ofDrawLine(0, i * 10, 500, i*10); 31 | // } 32 | 33 | 34 | // non ofMap() 35 | 36 | // for (int i = 0; i < 10; i++){ 37 | // ofSetColor( i * 20 ); 38 | // ofDrawCircle(400,400, 300 - i * 20); 39 | // } 40 | 41 | 42 | // ofMap(value, inputMin, inputMax, outputMin, outputMax); 43 | 44 | for (int i = 0; i < 10; i++){ 45 | ofSetColor( ofMap(i, 0, 9, 10, 255) ); 46 | ofDrawCircle(400,400, ofMap(i, 0, 9, 300, 50)); 47 | } 48 | // 49 | 50 | 51 | // float time = ofGetElapsedTimef(); 52 | // for (int i = 0; i < 1000; i++){ 53 | // 54 | // ofSetColor( 127 + 127 * sin(time + i*0.1), 55 | // 127 + 127 * sin(time + i*0.101), 56 | // 127 + 127 * sin(time+ i*0.102)); 57 | // ofDrawCircle(400 + 100 * sin(i*0.03 + time), ofMap(i, 0, 1000, 0, 800), sin(i*0.03 + time)*100); 58 | // 59 | // 60 | // } 61 | 62 | // 63 | // for (int i = 0; i < 100; i++ ){ 64 | // for (int j = 0; j < 100; j++ ) { 65 | // 66 | // ofSetColor(i*2, j*2, mouseX); 67 | // ofDrawRectangle(i * 5, j * 5, 5,5); 68 | // } 69 | // } 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | } 80 | 81 | //-------------------------------------------------------------- 82 | void ofApp::keyPressed(int key){ 83 | 84 | } 85 | 86 | //-------------------------------------------------------------- 87 | void ofApp::keyReleased(int key){ 88 | 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void ofApp::mouseMoved(int x, int y ){ 93 | 94 | } 95 | 96 | //-------------------------------------------------------------- 97 | void ofApp::mouseDragged(int x, int y, int button){ 98 | 99 | } 100 | 101 | //-------------------------------------------------------------- 102 | void ofApp::mousePressed(int x, int y, int button){ 103 | 104 | } 105 | 106 | //-------------------------------------------------------------- 107 | void ofApp::mouseReleased(int x, int y, int button){ 108 | 109 | } 110 | 111 | //-------------------------------------------------------------- 112 | void ofApp::mouseEntered(int x, int y){ 113 | 114 | } 115 | 116 | //-------------------------------------------------------------- 117 | void ofApp::mouseExited(int x, int y){ 118 | 119 | } 120 | 121 | //-------------------------------------------------------------- 122 | void ofApp::windowResized(int w, int h){ 123 | 124 | } 125 | 126 | //-------------------------------------------------------------- 127 | void ofApp::gotMessage(ofMessage msg){ 128 | 129 | } 130 | 131 | //-------------------------------------------------------------- 132 | void ofApp::dragEvent(ofDragInfo dragInfo){ 133 | 134 | } 135 | -------------------------------------------------------------------------------- /forLoopExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/functionsThatReturnNumbers/addons.make -------------------------------------------------------------------------------- /functionsThatReturnNumbers/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/functionsThatReturnNumbers/bin/data/.gitkeep -------------------------------------------------------------------------------- /functionsThatReturnNumbers/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | //-------------------------------------------------------------- 9 | void ofApp::update(){ 10 | 11 | } 12 | 13 | //-------------------------------------------------------------- 14 | void ofApp::draw(){ 15 | 16 | 17 | // here's a few useful functions in OF that return numbers: 18 | 19 | // ofGetWidth() <--- gets the width of the screen 20 | // ofGetHeight() <--- gets the height of the screen 21 | // ofGetElapsedTimef() <--- get the elapsed time in seconds 22 | 23 | // I really like using sin(ofGetElapsedTimef()) because it goes between -1 and 1 every 6.28 seconds; 24 | // you can do stuff like: 25 | 26 | ofBackground( sin(ofGetElapsedTimef()) * 127 + 127); 27 | 28 | ofSetColor( sin(ofGetElapsedTimef() + PI) * 127 + 127); 29 | 30 | float w = ofGetWidth(); 31 | float h = ofGetHeight(); 32 | float time = ofGetElapsedTimef(); 33 | 34 | // this rectangle will be 33% over in x and y and have a width and height of 33% 35 | // of whatever the window is. Try resizing! 36 | 37 | ofDrawRectangle( 0 + w*0.33, 0+h*0.33,w*0.33, h*0.33 ); 38 | 39 | 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::keyPressed(int key){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::keyReleased(int key){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mouseMoved(int x, int y ){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::mouseDragged(int x, int y, int button){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mousePressed(int x, int y, int button){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseReleased(int x, int y, int button){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mouseEntered(int x, int y){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::mouseExited(int x, int y){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::windowResized(int w, int h){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::gotMessage(ofMessage msg){ 89 | 90 | } 91 | 92 | //-------------------------------------------------------------- 93 | void ofApp::dragEvent(ofDragInfo dragInfo){ 94 | 95 | } 96 | -------------------------------------------------------------------------------- /functionsThatReturnNumbers/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /generalDrawing/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /generalDrawing/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /generalDrawing/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/generalDrawing/addons.make -------------------------------------------------------------------------------- /generalDrawing/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/generalDrawing/bin/data/.gitkeep -------------------------------------------------------------------------------- /generalDrawing/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /generalDrawing/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /generalDrawing/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /ifStatementExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /ifStatementExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /ifStatementExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/ifStatementExample/addons.make -------------------------------------------------------------------------------- /ifStatementExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/ifStatementExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /ifStatementExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /ifStatementExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(800,800,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ifStatementExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | //-------------------------------------------------------------- 9 | void ofApp::update(){ 10 | 11 | } 12 | 13 | //-------------------------------------------------------------- 14 | void ofApp::draw(){ 15 | 16 | 17 | ofBackground(0); 18 | //ofDrawRectangle(100, 100, 600, 600); 19 | 20 | if (mouseX < ofGetWidth()/2){ 21 | if (mouseY < ofGetHeight()/2){ 22 | ofDrawRectangle(100, 100, 600, 600); 23 | } else { 24 | ofDrawLine(0,0,800,800); 25 | } 26 | } else { 27 | ofDrawCircle(400,400,50); 28 | } 29 | 30 | 31 | // if (mouseX < ofGetWidth()/3){ 32 | // ofBackground(0); 33 | // } else if (mouseX >= ofGetWidth()/3 && 34 | // mouseX < 2*ofGetWidth()/3){ 35 | // ofBackground(127); 36 | // } else { 37 | // ofBackground(255); 38 | // } 39 | 40 | 41 | } 42 | 43 | //-------------------------------------------------------------- 44 | void ofApp::keyPressed(int key){ 45 | 46 | } 47 | 48 | //-------------------------------------------------------------- 49 | void ofApp::keyReleased(int key){ 50 | 51 | } 52 | 53 | //-------------------------------------------------------------- 54 | void ofApp::mouseMoved(int x, int y ){ 55 | 56 | } 57 | 58 | //-------------------------------------------------------------- 59 | void ofApp::mouseDragged(int x, int y, int button){ 60 | 61 | } 62 | 63 | //-------------------------------------------------------------- 64 | void ofApp::mousePressed(int x, int y, int button){ 65 | 66 | } 67 | 68 | //-------------------------------------------------------------- 69 | void ofApp::mouseReleased(int x, int y, int button){ 70 | 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void ofApp::mouseEntered(int x, int y){ 75 | 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::mouseExited(int x, int y){ 80 | 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void ofApp::windowResized(int w, int h){ 85 | 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void ofApp::gotMessage(ofMessage msg){ 90 | 91 | } 92 | 93 | //-------------------------------------------------------------- 94 | void ofApp::dragEvent(ofDragInfo dragInfo){ 95 | 96 | } 97 | -------------------------------------------------------------------------------- /ifStatementExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/imgPixelsWithForLoop/addons.make -------------------------------------------------------------------------------- /imgPixelsWithForLoop/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/imgPixelsWithForLoop/bin/data/.gitkeep -------------------------------------------------------------------------------- /imgPixelsWithForLoop/bin/data/housemouse.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/imgPixelsWithForLoop/bin/data/housemouse.jpg -------------------------------------------------------------------------------- /imgPixelsWithForLoop/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | mouseImg.load("housemouse.jpg"); 8 | 9 | 10 | } 11 | 12 | //-------------------------------------------------------------- 13 | void ofApp::update(){ 14 | 15 | } 16 | 17 | //-------------------------------------------------------------- 18 | void ofApp::draw(){ 19 | 20 | 21 | ofBackground(0); 22 | 23 | mouseImg.draw(0,0); 24 | 25 | 26 | for (int i = 0; i < 300; i+=10){ 27 | for (int j = 0; j < 300; j+=10){ 28 | 29 | 30 | //ofSetColor(mouseImg.getColor(i, j)); 31 | //ofDrawRectangle(300 + i, j, 10, 10); 32 | float brightness = mouseImg.getColor(i, j).getBrightness(); 33 | //cout << brightness << endl; 34 | ofDrawCircle(300 + i,j, ofMap(brightness, 0, 255, 1, 5)); 35 | } 36 | } 37 | } 38 | 39 | //-------------------------------------------------------------- 40 | void ofApp::keyPressed(int key){ 41 | 42 | } 43 | 44 | //-------------------------------------------------------------- 45 | void ofApp::keyReleased(int key){ 46 | 47 | } 48 | 49 | //-------------------------------------------------------------- 50 | void ofApp::mouseMoved(int x, int y ){ 51 | 52 | } 53 | 54 | //-------------------------------------------------------------- 55 | void ofApp::mouseDragged(int x, int y, int button){ 56 | 57 | } 58 | 59 | //-------------------------------------------------------------- 60 | void ofApp::mousePressed(int x, int y, int button){ 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::mouseReleased(int x, int y, int button){ 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::mouseEntered(int x, int y){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::mouseExited(int x, int y){ 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void ofApp::windowResized(int w, int h){ 81 | 82 | } 83 | 84 | //-------------------------------------------------------------- 85 | void ofApp::gotMessage(ofMessage msg){ 86 | 87 | } 88 | 89 | //-------------------------------------------------------------- 90 | void ofApp::dragEvent(ofDragInfo dragInfo){ 91 | 92 | } 93 | -------------------------------------------------------------------------------- /imgPixelsWithForLoop/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | ofImage mouseImg; 25 | 26 | 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /letterZ/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /letterZ/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /letterZ/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/letterZ/addons.make -------------------------------------------------------------------------------- /letterZ/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/letterZ/bin/data/.gitkeep -------------------------------------------------------------------------------- /letterZ/letterZ.xcodeproj/xcshareddata/xcschemes/letterZ Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /letterZ/letterZ.xcodeproj/xcshareddata/xcschemes/letterZ Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /letterZ/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /letterZ/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /letterZ/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | //sdfsdf 7 | // 8 | // 9 | } 10 | 11 | //-------------------------------------------------------------- 12 | void ofApp::update(){ 13 | 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void ofApp::draw(){ 18 | 19 | ofBackground(0); 20 | 21 | // the letter z is 3 lines 22 | // one at the top, one from top right to bottom left 23 | // and one at the bottom 24 | 25 | 26 | float x = 300; 27 | float y = 300; 28 | float width = 30; 29 | float height = 200; 30 | 31 | ofDrawLine(x,y, x+width, y); // the line at the top 32 | ofDrawLine(x+width, y, x, y+ height); // top right to bottom left 33 | ofDrawLine(x, y+height, x+width, y+height); // the line at the bottom 34 | 35 | // now we can do it again! change the variables: 36 | 37 | x = 350; 38 | y = 300; 39 | width = 80; 40 | height = 200; 41 | 42 | ofDrawLine(x,y, x+width, y); // the line at the top 43 | ofDrawLine(x+width, y, x, y+ height); // top right to bottom left 44 | ofDrawLine(x, y+height, x+width, y+height); // the line at the bottom 45 | 46 | 47 | // one more time: 48 | 49 | x = 450; 50 | y = 300; 51 | width = 130; 52 | height = 200; 53 | 54 | ofDrawLine(x,y, x+width, y); // the line at the top 55 | ofDrawLine(x+width, y, x, y+ height); // top right to bottom left 56 | ofDrawLine(x, y+height, x+width, y+height); // the line at the bottom 57 | 58 | 59 | } 60 | 61 | //-------------------------------------------------------------- 62 | void ofApp::keyPressed(int key){ 63 | 64 | } 65 | 66 | //-------------------------------------------------------------- 67 | void ofApp::keyReleased(int key){ 68 | 69 | } 70 | 71 | //-------------------------------------------------------------- 72 | void ofApp::mouseMoved(int x, int y ){ 73 | 74 | } 75 | 76 | //-------------------------------------------------------------- 77 | void ofApp::mouseDragged(int x, int y, int button){ 78 | 79 | } 80 | 81 | //-------------------------------------------------------------- 82 | void ofApp::mousePressed(int x, int y, int button){ 83 | 84 | } 85 | 86 | //-------------------------------------------------------------- 87 | void ofApp::mouseReleased(int x, int y, int button){ 88 | 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void ofApp::mouseEntered(int x, int y){ 93 | 94 | } 95 | 96 | //-------------------------------------------------------------- 97 | void ofApp::mouseExited(int x, int y){ 98 | 99 | } 100 | 101 | //-------------------------------------------------------------- 102 | void ofApp::windowResized(int w, int h){ 103 | 104 | } 105 | 106 | //-------------------------------------------------------------- 107 | void ofApp::gotMessage(ofMessage msg){ 108 | 109 | } 110 | 111 | //-------------------------------------------------------------- 112 | void ofApp::dragEvent(ofDragInfo dragInfo){ 113 | 114 | } 115 | -------------------------------------------------------------------------------- /letterZ/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | void keyPressed(int key); 14 | void keyReleased(int key); 15 | void mouseMoved(int x, int y ); 16 | void mouseDragged(int x, int y, int button); 17 | void mousePressed(int x, int y, int button); 18 | void mouseReleased(int x, int y, int button); 19 | void mouseEntered(int x, int y); 20 | void mouseExited(int x, int y); 21 | void windowResized(int w, int h); 22 | void dragEvent(ofDragInfo dragInfo); 23 | void gotMessage(ofMessage msg); 24 | 25 | }; 26 | -------------------------------------------------------------------------------- /letterZinAFunction/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /letterZinAFunction/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /letterZinAFunction/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/letterZinAFunction/addons.make -------------------------------------------------------------------------------- /letterZinAFunction/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/letterZinAFunction/bin/data/.gitkeep -------------------------------------------------------------------------------- /letterZinAFunction/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /letterZinAFunction/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /letterZinAFunction/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | //-------------------------------------------------------------- 9 | void ofApp::update(){ 10 | 11 | } 12 | 13 | 14 | void ofApp::drawZ(float x, float y, float width, float height){ 15 | 16 | ofDrawLine(x,y,x + width, y); 17 | ofDrawLine(x + width, y, x, y + height); 18 | ofDrawLine(x, y + height, x + width, y + height); 19 | 20 | } 21 | 22 | 23 | //-------------------------------------------------------------- 24 | void ofApp::draw(){ 25 | 26 | 27 | ofBackground(0); 28 | 29 | drawZ(100,100,10,600); 30 | drawZ(100,100,20,600); 31 | drawZ(100,100,30,600); 32 | drawZ(100,100,40,600); 33 | drawZ(100,100,50,600); 34 | drawZ(100,100,60,600); 35 | 36 | 37 | 38 | 39 | 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::keyPressed(int key){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::keyReleased(int key){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mouseMoved(int x, int y ){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::mouseDragged(int x, int y, int button){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mousePressed(int x, int y, int button){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseReleased(int x, int y, int button){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mouseEntered(int x, int y){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::mouseExited(int x, int y){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::windowResized(int w, int h){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::gotMessage(ofMessage msg){ 89 | 90 | } 91 | 92 | //-------------------------------------------------------------- 93 | void ofApp::dragEvent(ofDragInfo dragInfo){ 94 | 95 | } 96 | -------------------------------------------------------------------------------- /letterZinAFunction/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | void keyPressed(int key); 14 | void keyReleased(int key); 15 | void mouseMoved(int x, int y ); 16 | void mouseDragged(int x, int y, int button); 17 | void mousePressed(int x, int y, int button); 18 | void mouseReleased(int x, int y, int button); 19 | void mouseEntered(int x, int y); 20 | void mouseExited(int x, int y); 21 | void windowResized(int w, int h); 22 | void dragEvent(ofDragInfo dragInfo); 23 | void gotMessage(ofMessage msg); 24 | 25 | void drawZ(float x, float y, float width, float height); 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /modOperator/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /modOperator/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /modOperator/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/modOperator/addons.make -------------------------------------------------------------------------------- /modOperator/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/modOperator/bin/data/.gitkeep -------------------------------------------------------------------------------- /modOperator/modOperator.xcodeproj/xcshareddata/xcschemes/modOperator Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /modOperator/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /modOperator/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /modOperator/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | //-------------------------------------------------------------- 9 | void ofApp::update(){ 10 | 11 | } 12 | 13 | //-------------------------------------------------------------- 14 | void ofApp::draw(){ 15 | 16 | ofBackground(0); 17 | 18 | 19 | for (int i = 0; i < 20; i++){ 20 | 21 | ofSetColor(255); 22 | if (i % 2 == 0){ 23 | ofSetColor(255,0,0); 24 | } 25 | ofDrawRectangle(i * 30, 50, 20, 20); 26 | } 27 | 28 | } 29 | 30 | //-------------------------------------------------------------- 31 | void ofApp::keyPressed(int key){ 32 | 33 | } 34 | 35 | //-------------------------------------------------------------- 36 | void ofApp::keyReleased(int key){ 37 | 38 | } 39 | 40 | //-------------------------------------------------------------- 41 | void ofApp::mouseMoved(int x, int y ){ 42 | 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void ofApp::mouseDragged(int x, int y, int button){ 47 | 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void ofApp::mousePressed(int x, int y, int button){ 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::mouseReleased(int x, int y, int button){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::mouseEntered(int x, int y){ 62 | 63 | } 64 | 65 | //-------------------------------------------------------------- 66 | void ofApp::mouseExited(int x, int y){ 67 | 68 | } 69 | 70 | //-------------------------------------------------------------- 71 | void ofApp::windowResized(int w, int h){ 72 | 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void ofApp::gotMessage(ofMessage msg){ 77 | 78 | } 79 | 80 | //-------------------------------------------------------------- 81 | void ofApp::dragEvent(ofDragInfo dragInfo){ 82 | 83 | } 84 | -------------------------------------------------------------------------------- /modOperator/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | }; 26 | -------------------------------------------------------------------------------- /mouseControlExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /mouseControlExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /mouseControlExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/mouseControlExample/addons.make -------------------------------------------------------------------------------- /mouseControlExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/mouseControlExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /mouseControlExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /mouseControlExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(800,800,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /mouseControlExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | ofSetCircleResolution(100); 7 | } 8 | 9 | //-------------------------------------------------------------- 10 | void ofApp::update(){ 11 | 12 | } 13 | 14 | //-------------------------------------------------------------- 15 | void ofApp::draw(){ 16 | 17 | 18 | ofBackground(0,0,0); // black 19 | 20 | // mouseX and mouseY are variables that we can access that are where the mouse is 21 | // we can use them to control points of things: 22 | 23 | ofSetColor(255); 24 | 25 | ofDrawLine(0,0,mouseX, mouseY); 26 | ofDrawLine(800,0, mouseX, mouseY); 27 | ofDrawLine(800,800, mouseX, mouseY); 28 | ofDrawLine(0,800, mouseX, mouseY); 29 | 30 | // we can also use them wherever we have a number: 31 | 32 | 33 | ofSetColor(mouseX, mouseY, 0); 34 | ofDrawCircle(400,400,30); 35 | 36 | 37 | } 38 | 39 | //-------------------------------------------------------------- 40 | void ofApp::keyPressed(int key){ 41 | 42 | } 43 | 44 | //-------------------------------------------------------------- 45 | void ofApp::keyReleased(int key){ 46 | 47 | } 48 | 49 | //-------------------------------------------------------------- 50 | void ofApp::mouseMoved(int x, int y ){ 51 | 52 | } 53 | 54 | //-------------------------------------------------------------- 55 | void ofApp::mouseDragged(int x, int y, int button){ 56 | 57 | } 58 | 59 | //-------------------------------------------------------------- 60 | void ofApp::mousePressed(int x, int y, int button){ 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::mouseReleased(int x, int y, int button){ 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::mouseEntered(int x, int y){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::mouseExited(int x, int y){ 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void ofApp::windowResized(int w, int h){ 81 | 82 | } 83 | 84 | //-------------------------------------------------------------- 85 | void ofApp::gotMessage(ofMessage msg){ 86 | 87 | } 88 | 89 | //-------------------------------------------------------------- 90 | void ofApp::dragEvent(ofDragInfo dragInfo){ 91 | 92 | } 93 | -------------------------------------------------------------------------------- /mouseControlExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /objectExample1/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /objectExample1/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /objectExample1/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample1/addons.make -------------------------------------------------------------------------------- /objectExample1/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample1/bin/data/.gitkeep -------------------------------------------------------------------------------- /objectExample1/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /objectExample1/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /objectExample1/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | for (int i = 0; i < 100; i++){ 8 | myCircles[i].x = ofRandom(0, ofGetWidth()); 9 | myCircles[i].y = ofRandom(0, ofGetHeight()); 10 | myCircles[i].radius = ofRandom(5,10); 11 | myCircles[i].color.set( ofRandom(255), ofRandom(255), ofRandom(255)); 12 | 13 | } 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void ofApp::update(){ 18 | 19 | } 20 | 21 | //-------------------------------------------------------------- 22 | void ofApp::draw(){ 23 | 24 | ofBackground(0); 25 | 26 | for (int i = 0; i < 100; i++){ 27 | ofSetColor(myCircles[i].color); 28 | ofDrawCircle(myCircles[i].x, myCircles[i].y, myCircles[i].radius); 29 | } 30 | } 31 | 32 | //-------------------------------------------------------------- 33 | void ofApp::keyPressed(int key){ 34 | 35 | } 36 | 37 | //-------------------------------------------------------------- 38 | void ofApp::keyReleased(int key){ 39 | 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::mouseMoved(int x, int y ){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::mouseDragged(int x, int y, int button){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mousePressed(int x, int y, int button){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::mouseReleased(int x, int y, int button){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mouseEntered(int x, int y){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseExited(int x, int y){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::windowResized(int w, int h){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::gotMessage(ofMessage msg){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::dragEvent(ofDragInfo dragInfo){ 84 | 85 | } 86 | -------------------------------------------------------------------------------- /objectExample1/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | 6 | 7 | class circle{ 8 | 9 | public: 10 | 11 | float x; 12 | float y; 13 | float radius; 14 | ofColor color; 15 | 16 | }; 17 | 18 | 19 | 20 | 21 | class ofApp : public ofBaseApp{ 22 | 23 | public: 24 | void setup(); 25 | void update(); 26 | void draw(); 27 | 28 | void keyPressed(int key); 29 | void keyReleased(int key); 30 | void mouseMoved(int x, int y ); 31 | void mouseDragged(int x, int y, int button); 32 | void mousePressed(int x, int y, int button); 33 | void mouseReleased(int x, int y, int button); 34 | void mouseEntered(int x, int y); 35 | void mouseExited(int x, int y); 36 | void windowResized(int w, int h); 37 | void dragEvent(ofDragInfo dragInfo); 38 | void gotMessage(ofMessage msg); 39 | 40 | // this is so last week ! 41 | // float xPositions[100]; 42 | // float yPositions[100]; 43 | // float radii[100]; 44 | 45 | circle myCircles[100]; 46 | 47 | 48 | 49 | 50 | 51 | }; 52 | -------------------------------------------------------------------------------- /objectExample2/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /objectExample2/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /objectExample2/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample2/addons.make -------------------------------------------------------------------------------- /objectExample2/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample2/bin/data/.gitkeep -------------------------------------------------------------------------------- /objectExample2/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /objectExample2/src/blah.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // blah.cpp 3 | // objectExample2 4 | // 5 | // Created by zach on 9/7/17. 6 | // 7 | // 8 | 9 | #include "blah.hpp" 10 | -------------------------------------------------------------------------------- /objectExample2/src/blah.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // blah.hpp 3 | // objectExample2 4 | // 5 | // Created by zach on 9/7/17. 6 | // 7 | // 8 | 9 | #ifndef blah_hpp 10 | #define blah_hpp 11 | 12 | #include 13 | 14 | #endif /* blah_hpp */ 15 | -------------------------------------------------------------------------------- /objectExample2/src/circle.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "circle.h" 4 | 5 | //--------------------------------------------------------------- 6 | void circle::setup(){ 7 | 8 | pos.set( ofRandom(0, ofGetWidth()), 9 | ofRandom(0, ofGetHeight())); 10 | radius = ofRandom(1,10); 11 | color.set(ofRandom(255), 12 | ofRandom(255), 13 | ofRandom(255)); 14 | 15 | vel.set(ofRandom(-10,10), ofRandom(-10,10)); 16 | 17 | 18 | } 19 | 20 | 21 | //--------------------------------------------------------------- 22 | void circle::update(){ 23 | 24 | pos = pos + vel; 25 | 26 | if (pos.x > ofGetWidth()){ 27 | vel.x *= -1; 28 | } 29 | 30 | if (pos.x < 0){ 31 | vel.x *= -1; 32 | } 33 | 34 | if (pos.y > ofGetHeight()){ 35 | vel.y *= -1; 36 | } 37 | 38 | if (pos.y < 0){ 39 | vel.y *= -1; 40 | } 41 | 42 | } 43 | 44 | 45 | //--------------------------------------------------------------- 46 | void circle::draw(){ 47 | ofSetColor(color); 48 | ofCircle(pos.x, pos.y, radius); 49 | } -------------------------------------------------------------------------------- /objectExample2/src/circle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class circle { 6 | 7 | public: 8 | 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | ofPoint pos; 14 | ofPoint vel; 15 | 16 | float radius; 17 | ofColor color; 18 | 19 | }; -------------------------------------------------------------------------------- /objectExample2/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /objectExample2/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | for (int i = 0; i < 100; i++){ 7 | myCircles[i].setup(); 8 | } 9 | } 10 | 11 | //-------------------------------------------------------------- 12 | void ofApp::update(){ 13 | 14 | for (int i = 0; i < 100; i++){ 15 | myCircles[i].update(); 16 | } 17 | } 18 | 19 | //-------------------------------------------------------------- 20 | void ofApp::draw(){ 21 | 22 | ofBackground(0); 23 | 24 | for (int i = 0; i < 100; i++){ 25 | myCircles[i].draw(); 26 | } 27 | } 28 | 29 | //-------------------------------------------------------------- 30 | void ofApp::keyPressed(int key){ 31 | 32 | } 33 | 34 | //-------------------------------------------------------------- 35 | void ofApp::keyReleased(int key){ 36 | 37 | } 38 | 39 | //-------------------------------------------------------------- 40 | void ofApp::mouseMoved(int x, int y ){ 41 | 42 | } 43 | 44 | //-------------------------------------------------------------- 45 | void ofApp::mouseDragged(int x, int y, int button){ 46 | 47 | } 48 | 49 | //-------------------------------------------------------------- 50 | void ofApp::mousePressed(int x, int y, int button){ 51 | 52 | } 53 | 54 | //-------------------------------------------------------------- 55 | void ofApp::mouseReleased(int x, int y, int button){ 56 | 57 | } 58 | 59 | //-------------------------------------------------------------- 60 | void ofApp::mouseEntered(int x, int y){ 61 | 62 | } 63 | 64 | //-------------------------------------------------------------- 65 | void ofApp::mouseExited(int x, int y){ 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::windowResized(int w, int h){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::gotMessage(ofMessage msg){ 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void ofApp::dragEvent(ofDragInfo dragInfo){ 81 | 82 | } 83 | -------------------------------------------------------------------------------- /objectExample2/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "circle.h" 5 | 6 | class ofApp : public ofBaseApp{ 7 | 8 | public: 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | void keyPressed(int key); 14 | void keyReleased(int key); 15 | void mouseMoved(int x, int y ); 16 | void mouseDragged(int x, int y, int button); 17 | void mousePressed(int x, int y, int button); 18 | void mouseReleased(int x, int y, int button); 19 | void mouseEntered(int x, int y); 20 | void mouseExited(int x, int y); 21 | void windowResized(int w, int h); 22 | void dragEvent(ofDragInfo dragInfo); 23 | void gotMessage(ofMessage msg); 24 | 25 | circle myCircles[100]; 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /objectExample2/src/square.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "square.h" 4 | 5 | //--------------------------------------------------------------- 6 | void square::setup(){ 7 | } 8 | 9 | 10 | //--------------------------------------------------------------- 11 | void square::update(){ 12 | } 13 | 14 | 15 | //--------------------------------------------------------------- 16 | void square::draw(){ 17 | } -------------------------------------------------------------------------------- /objectExample2/src/square.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class square { 6 | 7 | public: 8 | 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | 14 | }; -------------------------------------------------------------------------------- /objectExample3/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /objectExample3/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /objectExample3/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample3/addons.make -------------------------------------------------------------------------------- /objectExample3/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/objectExample3/bin/data/.gitkeep -------------------------------------------------------------------------------- /objectExample3/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /objectExample3/src/circle.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "circle.h" 4 | 5 | //--------------------------------------------------------------- 6 | void circle::setup(){ 7 | 8 | pos.set( ofRandom(0, ofGetWidth()), 9 | ofRandom(0, ofGetHeight())); 10 | radius = ofRandom(1,10); 11 | color.set(ofRandom(255), 12 | ofRandom(255), 13 | ofRandom(255)); 14 | 15 | vel.set(ofRandom(-10,10), ofRandom(-10,10)); 16 | 17 | 18 | } 19 | 20 | 21 | //--------------------------------------------------------------- 22 | void circle::update(){ 23 | 24 | pos = pos + vel; 25 | 26 | if (pos.x > ofGetWidth()){ 27 | vel.x *= -1; 28 | } 29 | 30 | if (pos.x < 0){ 31 | vel.x *= -1; 32 | } 33 | 34 | if (pos.y > ofGetHeight()){ 35 | vel.y *= -1; 36 | } 37 | 38 | if (pos.y < 0){ 39 | vel.y *= -1; 40 | } 41 | 42 | } 43 | 44 | 45 | //--------------------------------------------------------------- 46 | void circle::draw(){ 47 | ofSetColor(color); 48 | ofCircle(pos.x, pos.y, radius); 49 | } -------------------------------------------------------------------------------- /objectExample3/src/circle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class circle { 6 | 7 | public: 8 | 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | ofPoint pos; 14 | ofPoint vel; 15 | 16 | float radius; 17 | ofColor color; 18 | 19 | }; -------------------------------------------------------------------------------- /objectExample3/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /objectExample3/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | // for (int i = 0; i < 100; i++){ 7 | // myCircles[i].setup(); 8 | // } 9 | } 10 | 11 | //-------------------------------------------------------------- 12 | void ofApp::update(){ 13 | 14 | 15 | cout << myCircles.size() << endl; 16 | 17 | for (int i = 0; i < myCircles.size(); i++){ 18 | myCircles[i].update(); 19 | } 20 | } 21 | 22 | //-------------------------------------------------------------- 23 | void ofApp::draw(){ 24 | 25 | ofBackground(0); 26 | 27 | for (int i = 0; i < myCircles.size(); i++){ 28 | myCircles[i].draw(); 29 | } 30 | } 31 | 32 | //-------------------------------------------------------------- 33 | void ofApp::keyPressed(int key){ 34 | 35 | 36 | if (key == ' '){ 37 | myCircles.clear(); 38 | 39 | } 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::keyReleased(int key){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::mouseMoved(int x, int y ){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mouseDragged(int x, int y, int button){ 54 | 55 | 56 | circle tempCircle; 57 | tempCircle.setup(); 58 | tempCircle.pos.x = x; 59 | tempCircle.pos.y = y; 60 | tempCircle.vel.x = 0; 61 | tempCircle.vel.y = 0; 62 | 63 | myCircles.push_back( tempCircle ); 64 | 65 | if (myCircles.size() > 50){ 66 | myCircles.erase(myCircles.begin()); 67 | } 68 | 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mousePressed(int x, int y, int button){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::mouseReleased(int x, int y, int button){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::mouseEntered(int x, int y){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::mouseExited(int x, int y){ 89 | 90 | } 91 | 92 | //-------------------------------------------------------------- 93 | void ofApp::windowResized(int w, int h){ 94 | 95 | } 96 | 97 | //-------------------------------------------------------------- 98 | void ofApp::gotMessage(ofMessage msg){ 99 | 100 | } 101 | 102 | //-------------------------------------------------------------- 103 | void ofApp::dragEvent(ofDragInfo dragInfo){ 104 | 105 | } 106 | -------------------------------------------------------------------------------- /objectExample3/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "circle.h" 5 | 6 | class ofApp : public ofBaseApp{ 7 | 8 | public: 9 | void setup(); 10 | void update(); 11 | void draw(); 12 | 13 | void keyPressed(int key); 14 | void keyReleased(int key); 15 | void mouseMoved(int x, int y ); 16 | void mouseDragged(int x, int y, int button); 17 | void mousePressed(int x, int y, int button); 18 | void mouseReleased(int x, int y, int button); 19 | void mouseEntered(int x, int y); 20 | void mouseExited(int x, int y); 21 | void windowResized(int w, int h); 22 | void dragEvent(ofDragInfo dragInfo); 23 | void gotMessage(ofMessage msg); 24 | 25 | //circle myCircles[100]; 26 | vector < circle > myCircles; 27 | 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /ofMapExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /ofMapExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /ofMapExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/ofMapExample/addons.make -------------------------------------------------------------------------------- /ofMapExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/ofMapExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /ofMapExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /ofMapExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ofMapExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | ofSetCircleResolution(100); 7 | } 8 | 9 | //-------------------------------------------------------------- 10 | void ofApp::update(){ 11 | 12 | } 13 | 14 | //-------------------------------------------------------------- 15 | void ofApp::draw(){ 16 | 17 | 18 | ofBackground(0); 19 | 20 | // somtimes it's useful to remap a value 21 | // from one range into another 22 | 23 | // ofMap ( input, inputMin, inputMax, outputMin, outputMax) 24 | 25 | // is a function that does this. 26 | // for example: 27 | 28 | // ofMap(mouseX, 0, ofGetWidth(), 0, 1); 29 | 30 | // will return a number between 0 and 1 as you move the mouse from right to left 31 | // mouseX is a big number (it's in pixels) but if we map it from 0 to the width of the window, 32 | // we can remap it 0 - 1 33 | 34 | float mousePct = ofMap(mouseX, 0, ofGetWidth(), 0, 1); 35 | 36 | ofSetColor(255); 37 | ofDrawCircle(ofGetWidth()/2, ofGetHeight()/2, mousePct * 300); 38 | 39 | // you'll notice that if you bring your mouse too far on the left, the circle gets big again 40 | // this is because we aren't "clamping" the results, and the input 41 | // is outside of the input range so the output is also outside of the output range. 42 | 43 | // try ofMap(mouseX, 0, ofGetWidth(), 0, 1, true); above.... 44 | // also fun to try is: 45 | // ofSetColor(255*mousePct); 46 | 47 | 48 | 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::keyPressed(int key){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::keyReleased(int key){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mouseMoved(int x, int y ){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseDragged(int x, int y, int button){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mousePressed(int x, int y, int button){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::mouseReleased(int x, int y, int button){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::mouseEntered(int x, int y){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::mouseExited(int x, int y){ 89 | 90 | } 91 | 92 | //-------------------------------------------------------------- 93 | void ofApp::windowResized(int w, int h){ 94 | 95 | } 96 | 97 | //-------------------------------------------------------------- 98 | void ofApp::gotMessage(ofMessage msg){ 99 | 100 | } 101 | 102 | //-------------------------------------------------------------- 103 | void ofApp::dragEvent(ofDragInfo dragInfo){ 104 | 105 | } 106 | -------------------------------------------------------------------------------- /ofMapExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /patternExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /patternExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /patternExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/patternExample/addons.make -------------------------------------------------------------------------------- /patternExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/patternExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /patternExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /patternExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /patternExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | void ofApp::drawZ(float x, float y, float w, float h){ 9 | ofLine(x, y, x+w, y); 10 | ofLine(x+w, y, x, y+h); 11 | ofLine(x,y+h, x+w, y+h); 12 | } 13 | 14 | 15 | //-------------------------------------------------------------- 16 | void ofApp::update(){ 17 | 18 | } 19 | 20 | //-------------------------------------------------------------- 21 | void ofApp::draw(){ 22 | 23 | ofBackground(0,0); 24 | ofNoFill(); 25 | float w = ofGetWidth()/5; 26 | float h = ofGetHeight()/2; 27 | 28 | for (int i = 0; i < 5; i++){ 29 | for (int j = 0; j < 2; j++){ 30 | ofRectangle rect(i * w, j*h, w, h); 31 | rect.scaleFromCenter(0.8); 32 | drawZ(rect.x, rect.y, rect.width, rect.height); 33 | } 34 | } 35 | 36 | } 37 | 38 | //-------------------------------------------------------------- 39 | void ofApp::keyPressed(int key){ 40 | 41 | } 42 | 43 | //-------------------------------------------------------------- 44 | void ofApp::keyReleased(int key){ 45 | 46 | } 47 | 48 | //-------------------------------------------------------------- 49 | void ofApp::mouseMoved(int x, int y ){ 50 | 51 | } 52 | 53 | //-------------------------------------------------------------- 54 | void ofApp::mouseDragged(int x, int y, int button){ 55 | 56 | } 57 | 58 | //-------------------------------------------------------------- 59 | void ofApp::mousePressed(int x, int y, int button){ 60 | 61 | } 62 | 63 | //-------------------------------------------------------------- 64 | void ofApp::mouseReleased(int x, int y, int button){ 65 | 66 | } 67 | 68 | //-------------------------------------------------------------- 69 | void ofApp::mouseEntered(int x, int y){ 70 | 71 | } 72 | 73 | //-------------------------------------------------------------- 74 | void ofApp::mouseExited(int x, int y){ 75 | 76 | } 77 | 78 | //-------------------------------------------------------------- 79 | void ofApp::windowResized(int w, int h){ 80 | 81 | } 82 | 83 | //-------------------------------------------------------------- 84 | void ofApp::gotMessage(ofMessage msg){ 85 | 86 | } 87 | 88 | //-------------------------------------------------------------- 89 | void ofApp::dragEvent(ofDragInfo dragInfo){ 90 | 91 | } 92 | -------------------------------------------------------------------------------- /patternExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | void drawZ(float x, float y, float w, float h); 25 | 26 | }; 27 | -------------------------------------------------------------------------------- /recursiveExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /recursiveExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /recursiveExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/recursiveExample/addons.make -------------------------------------------------------------------------------- /recursiveExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/recursiveExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /recursiveExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /recursiveExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /recursiveExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | } 7 | 8 | 9 | void ofApp::drawRectangle( float x, float y, float w, float h){ 10 | 11 | ofNoFill(); 12 | ofDrawRectangle(x, y, w, h); 13 | 14 | if (w/2 > 2){ 15 | if (ofRandom(0,1) > 0.5) drawRectangle(x,y,w/2, h/2); 16 | if (ofRandom(0,1) > 0.5) drawRectangle(x+w/2,y,w/2, h/2); 17 | if (ofRandom(0,1) > 0.5) drawRectangle(x+w/2,y+h/2,w/2, h/2); 18 | if (ofRandom(0,1) > 0.5) drawRectangle(x,y+h/2,w/2, h/2); 19 | 20 | 21 | } 22 | 23 | } 24 | 25 | //-------------------------------------------------------------- 26 | void ofApp::update(){ 27 | 28 | } 29 | 30 | //-------------------------------------------------------------- 31 | void ofApp::draw(){ 32 | 33 | ofSeedRandom(mouseX); 34 | 35 | ofBackground(0); 36 | drawRectangle(100, 100, 400, 400); 37 | 38 | } 39 | 40 | //-------------------------------------------------------------- 41 | void ofApp::keyPressed(int key){ 42 | 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void ofApp::keyReleased(int key){ 47 | 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void ofApp::mouseMoved(int x, int y ){ 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::mouseDragged(int x, int y, int button){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::mousePressed(int x, int y, int button){ 62 | 63 | } 64 | 65 | //-------------------------------------------------------------- 66 | void ofApp::mouseReleased(int x, int y, int button){ 67 | 68 | } 69 | 70 | //-------------------------------------------------------------- 71 | void ofApp::mouseEntered(int x, int y){ 72 | 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void ofApp::mouseExited(int x, int y){ 77 | 78 | } 79 | 80 | //-------------------------------------------------------------- 81 | void ofApp::windowResized(int w, int h){ 82 | 83 | } 84 | 85 | //-------------------------------------------------------------- 86 | void ofApp::gotMessage(ofMessage msg){ 87 | 88 | } 89 | 90 | //-------------------------------------------------------------- 91 | void ofApp::dragEvent(ofDragInfo dragInfo){ 92 | 93 | } 94 | -------------------------------------------------------------------------------- /recursiveExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | void drawRectangle( float x, float y, float w, float h); 25 | 26 | 27 | 28 | }; 29 | 30 | 31 | -------------------------------------------------------------------------------- /rotationExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /rotationExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /rotationExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/rotationExample/addons.make -------------------------------------------------------------------------------- /rotationExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/rotationExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /rotationExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /rotationExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(800,800,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /rotationExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | 8 | } 9 | 10 | //-------------------------------------------------------------- 11 | void ofApp::update(){ 12 | 13 | } 14 | 15 | //-------------------------------------------------------------- 16 | void ofApp::draw(){ 17 | 18 | ofBackground(0); 19 | ofSetRectMode(OF_RECTMODE_CENTER); 20 | 21 | 22 | // (a) ----- this doesn't work that well since we rotate around 0,0 23 | // 24 | // 25 | // ofSetColor(255); 26 | // ofRotate( mouseX ); 27 | // ofDrawRectangle(400,400, 100,50); 28 | 29 | 30 | // (b) ----- better! we translate out of to where the center of what we want to rotate is 31 | // than draw as if from 0,0 32 | // 33 | // 34 | 35 | ofPushMatrix(); 36 | ofTranslate(400,400); 37 | ofRotate( mouseX ); 38 | ofDrawRectangle(0,0, 100,50); 39 | ofPopMatrix(); 40 | 41 | 42 | 43 | // (c) 44 | // push and pop embedded! 45 | // try moving mouseX and mouseY 46 | 47 | // ofPushMatrix(); 48 | // 49 | // ofTranslate(400,400); 50 | // ofRotate( mouseX ); 51 | // ofDrawRectangle(0,0, 100,50); 52 | // 53 | // ofPushMatrix(); 54 | // ofTranslate(0,150); 55 | // ofRotate( mouseY ); 56 | // ofDrawRectangle(0,0, 30,30); 57 | // 58 | // ofPushMatrix(); 59 | // ofTranslate(100,0); 60 | // ofDrawRectangle(0,0, 10,10); 61 | // ofPopMatrix(); 62 | // 63 | // ofPopMatrix(); 64 | // 65 | // ofPopMatrix(); 66 | 67 | 68 | 69 | } 70 | 71 | //-------------------------------------------------------------- 72 | void ofApp::keyPressed(int key){ 73 | 74 | } 75 | 76 | //-------------------------------------------------------------- 77 | void ofApp::keyReleased(int key){ 78 | 79 | } 80 | 81 | //-------------------------------------------------------------- 82 | void ofApp::mouseMoved(int x, int y ){ 83 | 84 | } 85 | 86 | //-------------------------------------------------------------- 87 | void ofApp::mouseDragged(int x, int y, int button){ 88 | 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void ofApp::mousePressed(int x, int y, int button){ 93 | 94 | } 95 | 96 | //-------------------------------------------------------------- 97 | void ofApp::mouseReleased(int x, int y, int button){ 98 | 99 | } 100 | 101 | //-------------------------------------------------------------- 102 | void ofApp::mouseEntered(int x, int y){ 103 | 104 | } 105 | 106 | //-------------------------------------------------------------- 107 | void ofApp::mouseExited(int x, int y){ 108 | 109 | } 110 | 111 | //-------------------------------------------------------------- 112 | void ofApp::windowResized(int w, int h){ 113 | 114 | } 115 | 116 | //-------------------------------------------------------------- 117 | void ofApp::gotMessage(ofMessage msg){ 118 | 119 | } 120 | 121 | //-------------------------------------------------------------- 122 | void ofApp::dragEvent(ofDragInfo dragInfo){ 123 | 124 | } 125 | -------------------------------------------------------------------------------- /rotationExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /rotationSketch/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /rotationSketch/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /rotationSketch/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/rotationSketch/addons.make -------------------------------------------------------------------------------- /rotationSketch/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/rotationSketch/bin/data/.gitkeep -------------------------------------------------------------------------------- /rotationSketch/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /rotationSketch/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /rotationSketch/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /simpleArrayExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /simpleArrayExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /simpleArrayExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample/addons.make -------------------------------------------------------------------------------- /simpleArrayExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /simpleArrayExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /simpleArrayExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /simpleArrayExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | for (int i = 0; i < 50; i++){ 7 | positions[i] = 400; 8 | } 9 | 10 | 11 | } 12 | 13 | //-------------------------------------------------------------- 14 | void ofApp::update(){ 15 | 16 | 17 | for (int i = 0; i < 50; i++){ 18 | positions[i] += ofRandom(-1,1); 19 | } 20 | 21 | } 22 | 23 | //-------------------------------------------------------------- 24 | void ofApp::draw(){ 25 | 26 | ofBackground(0); 27 | 28 | for (int i = 0; i < 50; i++){ 29 | ofDrawCircle(positions[i], i*10, 5); 30 | } 31 | 32 | 33 | } 34 | 35 | //-------------------------------------------------------------- 36 | void ofApp::keyPressed(int key){ 37 | 38 | if (key == ' '){ 39 | for (int i = 0; i < 50; i++){ 40 | positions[i] = 200; 41 | } 42 | } 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void ofApp::keyReleased(int key){ 47 | 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void ofApp::mouseMoved(int x, int y ){ 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::mouseDragged(int x, int y, int button){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::mousePressed(int x, int y, int button){ 62 | 63 | } 64 | 65 | //-------------------------------------------------------------- 66 | void ofApp::mouseReleased(int x, int y, int button){ 67 | 68 | } 69 | 70 | //-------------------------------------------------------------- 71 | void ofApp::mouseEntered(int x, int y){ 72 | 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void ofApp::mouseExited(int x, int y){ 77 | 78 | } 79 | 80 | //-------------------------------------------------------------- 81 | void ofApp::windowResized(int w, int h){ 82 | 83 | } 84 | 85 | //-------------------------------------------------------------- 86 | void ofApp::gotMessage(ofMessage msg){ 87 | 88 | } 89 | 90 | //-------------------------------------------------------------- 91 | void ofApp::dragEvent(ofDragInfo dragInfo){ 92 | 93 | } 94 | -------------------------------------------------------------------------------- /simpleArrayExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | float positions[50]; 26 | 27 | 28 | 29 | }; 30 | -------------------------------------------------------------------------------- /simpleArrayExample2/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /simpleArrayExample2/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /simpleArrayExample2/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample2/addons.make -------------------------------------------------------------------------------- /simpleArrayExample2/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample2/bin/data/.gitkeep -------------------------------------------------------------------------------- /simpleArrayExample2/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /simpleArrayExample2/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /simpleArrayExample2/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | for (int i = 0; i < 50; i++){ 8 | positions[i] = ofGetWidth()/2; 9 | speeds[i] = ofRandom(-10,10); 10 | colors[i].set(ofRandom(255), ofRandom(255), 11 | ofRandom(255)); 12 | radius[i] = ofRandom(1,20); 13 | } 14 | } 15 | 16 | //-------------------------------------------------------------- 17 | void ofApp::update(){ 18 | 19 | for (int i = 0; i < 50; i++){ 20 | positions[i] = positions[i] + speeds[i]; 21 | 22 | if (positions[i] > ofGetWidth()){ 23 | positions[i] = 0; 24 | } 25 | 26 | if (positions[i] < 0){ 27 | positions[i] = ofGetWidth(); 28 | } 29 | } 30 | 31 | 32 | 33 | } 34 | 35 | //-------------------------------------------------------------- 36 | void ofApp::draw(){ 37 | 38 | ofBackground(0); 39 | 40 | for (int i = 0; i < 50; i++){ 41 | ofSetColor(colors[i]); 42 | ofDrawCircle(positions[i], i*15, radius[i]); 43 | } 44 | } 45 | 46 | //-------------------------------------------------------------- 47 | void ofApp::keyPressed(int key){ 48 | 49 | if (key == ' '){ 50 | for (int i = 0; i < 50; i++){ 51 | positions[i] = ofGetWidth()/2; 52 | } 53 | } 54 | } 55 | 56 | //-------------------------------------------------------------- 57 | void ofApp::keyReleased(int key){ 58 | 59 | } 60 | 61 | //-------------------------------------------------------------- 62 | void ofApp::mouseMoved(int x, int y ){ 63 | 64 | } 65 | 66 | //-------------------------------------------------------------- 67 | void ofApp::mouseDragged(int x, int y, int button){ 68 | 69 | } 70 | 71 | //-------------------------------------------------------------- 72 | void ofApp::mousePressed(int x, int y, int button){ 73 | 74 | } 75 | 76 | //-------------------------------------------------------------- 77 | void ofApp::mouseReleased(int x, int y, int button){ 78 | 79 | } 80 | 81 | //-------------------------------------------------------------- 82 | void ofApp::mouseEntered(int x, int y){ 83 | 84 | } 85 | 86 | //-------------------------------------------------------------- 87 | void ofApp::mouseExited(int x, int y){ 88 | 89 | } 90 | 91 | //-------------------------------------------------------------- 92 | void ofApp::windowResized(int w, int h){ 93 | 94 | } 95 | 96 | //-------------------------------------------------------------- 97 | void ofApp::gotMessage(ofMessage msg){ 98 | 99 | } 100 | 101 | //-------------------------------------------------------------- 102 | void ofApp::dragEvent(ofDragInfo dragInfo){ 103 | 104 | } 105 | -------------------------------------------------------------------------------- /simpleArrayExample2/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | float positions[50]; 25 | float speeds[50]; 26 | ofColor colors[50]; 27 | float radius[50]; 28 | 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /simpleArrayExample3/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /simpleArrayExample3/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /simpleArrayExample3/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample3/addons.make -------------------------------------------------------------------------------- /simpleArrayExample3/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/simpleArrayExample3/bin/data/.gitkeep -------------------------------------------------------------------------------- /simpleArrayExample3/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /simpleArrayExample3/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /simpleArrayExample3/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | for (int i = 0; i < 1000; i++){ 7 | xpositions[i] = ofRandom(0, ofGetWidth()); 8 | ypositions[i] = ofRandom(0, ofGetHeight()); 9 | } 10 | } 11 | 12 | //-------------------------------------------------------------- 13 | void ofApp::update(){ 14 | 15 | } 16 | 17 | //-------------------------------------------------------------- 18 | void ofApp::draw(){ 19 | 20 | 21 | ofBackground(0); 22 | 23 | for (int i = 0; i < 1000; i++){ 24 | 25 | float dist = ofDist(mouseX, mouseY,xpositions[i], ypositions[i]); 26 | if (dist < 100){ 27 | ofDrawLine(mouseX, mouseY, xpositions[i], ypositions[i]); 28 | } 29 | } 30 | } 31 | 32 | //-------------------------------------------------------------- 33 | void ofApp::keyPressed(int key){ 34 | 35 | 36 | for (int i = 0; i < 1000; i++){ 37 | xpositions[i] = ofRandom(0, ofGetWidth()); 38 | ypositions[i] = ofRandom(0, ofGetHeight()); 39 | } 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::keyReleased(int key){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::mouseMoved(int x, int y ){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mouseDragged(int x, int y, int button){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::mousePressed(int x, int y, int button){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mouseReleased(int x, int y, int button){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseEntered(int x, int y){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mouseExited(int x, int y){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::windowResized(int w, int h){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::gotMessage(ofMessage msg){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::dragEvent(ofDragInfo dragInfo){ 89 | 90 | } 91 | -------------------------------------------------------------------------------- /simpleArrayExample3/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | float xpositions[1000]; 26 | float ypositions[1000]; 27 | 28 | 29 | 30 | }; 31 | -------------------------------------------------------------------------------- /variables/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /variables/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /variables/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/variables/addons.make -------------------------------------------------------------------------------- /variables/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/variables/bin/data/.gitkeep -------------------------------------------------------------------------------- /variables/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /variables/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(500,500,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /variables/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | 7 | 8 | // give me a variable named x of the type "float" 9 | // and put the value of 100 into it 10 | 11 | float x = 100; 12 | 13 | // we can print the value out 14 | // cout is the "new school" way of printing things out 15 | // there's also printf() which is old school 16 | // endl is "new line" like hitting return 17 | 18 | cout << x << endl; 19 | 20 | // you can print out nicer like this -- adding text and variables 21 | 22 | cout << "x = " << x << endl; 23 | 24 | // now create a variable y of the type float 25 | // and set it equal to whatever x is plus 100 26 | // since x is 100, y should be 200... 27 | // note when you see the equals sign do what's on the right first 28 | // and put it into the left side. 29 | 30 | float y = x + 100; 31 | 32 | cout << "y = " << y << endl; 33 | 34 | // now what do you think x equals after this ? 35 | 36 | x = x + 1; 37 | 38 | // try cout after this line and find out..... 39 | 40 | 41 | 42 | // other types of variables: 43 | 44 | int counter = 0; 45 | char letter = 'd'; 46 | bool doIhaveEnoughVariables = false; 47 | string name = "zach"; 48 | 49 | 50 | cout << counter << " " << letter << " " << doIhaveEnoughVariables << " " << name << endl; 51 | 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::update(){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::draw(){ 62 | 63 | 64 | 65 | 66 | 67 | } 68 | 69 | //-------------------------------------------------------------- 70 | void ofApp::keyPressed(int key){ 71 | 72 | } 73 | 74 | //-------------------------------------------------------------- 75 | void ofApp::keyReleased(int key){ 76 | 77 | } 78 | 79 | //-------------------------------------------------------------- 80 | void ofApp::mouseMoved(int x, int y ){ 81 | 82 | } 83 | 84 | //-------------------------------------------------------------- 85 | void ofApp::mouseDragged(int x, int y, int button){ 86 | 87 | } 88 | 89 | //-------------------------------------------------------------- 90 | void ofApp::mousePressed(int x, int y, int button){ 91 | 92 | } 93 | 94 | //-------------------------------------------------------------- 95 | void ofApp::mouseReleased(int x, int y, int button){ 96 | 97 | } 98 | 99 | //-------------------------------------------------------------- 100 | void ofApp::mouseEntered(int x, int y){ 101 | 102 | } 103 | 104 | //-------------------------------------------------------------- 105 | void ofApp::mouseExited(int x, int y){ 106 | 107 | } 108 | 109 | //-------------------------------------------------------------- 110 | void ofApp::windowResized(int w, int h){ 111 | 112 | } 113 | 114 | //-------------------------------------------------------------- 115 | void ofApp::gotMessage(ofMessage msg){ 116 | 117 | } 118 | 119 | //-------------------------------------------------------------- 120 | void ofApp::dragEvent(ofDragInfo dragInfo){ 121 | 122 | } 123 | -------------------------------------------------------------------------------- /variables/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /variables/variables.xcodeproj/xcshareddata/xcschemes/variables Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /variables/variables.xcodeproj/xcshareddata/xcschemes/variables Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/videoPixelsWithForLoop/addons.make -------------------------------------------------------------------------------- /videoPixelsWithForLoop/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/videoPixelsWithForLoop/bin/data/.gitkeep -------------------------------------------------------------------------------- /videoPixelsWithForLoop/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(640*2,480,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | //-------------------------------------------------------------- 4 | void ofApp::setup(){ 5 | 6 | grabber.setup(640,480); 7 | 8 | } 9 | 10 | //-------------------------------------------------------------- 11 | void ofApp::update(){ 12 | 13 | grabber.update(); 14 | 15 | } 16 | 17 | //-------------------------------------------------------------- 18 | void ofApp::draw(){ 19 | 20 | ofBackground(0); 21 | 22 | ofSetRectMode(OF_RECTMODE_CORNER); 23 | 24 | grabber.draw(0,0); 25 | 26 | ofSetRectMode(OF_RECTMODE_CENTER); 27 | 28 | 29 | for (int i = 0; i < 640; i+=10){ 30 | for (int j = 0; j < 480; j+=10){ 31 | 32 | float brightness = grabber.getPixels().getColor(i,j).getBrightness(); 33 | 34 | ofPushMatrix(); 35 | ofTranslate(640 + i, 5 + j); 36 | ofRotate( ofMap(brightness, 0, 255, 0, mouseX)); 37 | ofDrawRectangle(0,0, 10, 2); 38 | //ofDrawRectangle(0,0, brightness*0.3, 2); 39 | ofPopMatrix(); 40 | } 41 | } 42 | 43 | } 44 | 45 | //-------------------------------------------------------------- 46 | void ofApp::keyPressed(int key){ 47 | 48 | } 49 | 50 | //-------------------------------------------------------------- 51 | void ofApp::keyReleased(int key){ 52 | 53 | } 54 | 55 | //-------------------------------------------------------------- 56 | void ofApp::mouseMoved(int x, int y ){ 57 | 58 | } 59 | 60 | //-------------------------------------------------------------- 61 | void ofApp::mouseDragged(int x, int y, int button){ 62 | 63 | } 64 | 65 | //-------------------------------------------------------------- 66 | void ofApp::mousePressed(int x, int y, int button){ 67 | 68 | } 69 | 70 | //-------------------------------------------------------------- 71 | void ofApp::mouseReleased(int x, int y, int button){ 72 | 73 | } 74 | 75 | //-------------------------------------------------------------- 76 | void ofApp::mouseEntered(int x, int y){ 77 | 78 | } 79 | 80 | //-------------------------------------------------------------- 81 | void ofApp::mouseExited(int x, int y){ 82 | 83 | } 84 | 85 | //-------------------------------------------------------------- 86 | void ofApp::windowResized(int w, int h){ 87 | 88 | } 89 | 90 | //-------------------------------------------------------------- 91 | void ofApp::gotMessage(ofMessage msg){ 92 | 93 | } 94 | 95 | //-------------------------------------------------------------- 96 | void ofApp::dragEvent(ofDragInfo dragInfo){ 97 | 98 | } 99 | -------------------------------------------------------------------------------- /videoPixelsWithForLoop/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | class ofApp : public ofBaseApp{ 6 | 7 | public: 8 | void setup(); 9 | void update(); 10 | void draw(); 11 | 12 | void keyPressed(int key); 13 | void keyReleased(int key); 14 | void mouseMoved(int x, int y ); 15 | void mouseDragged(int x, int y, int button); 16 | void mousePressed(int x, int y, int button); 17 | void mouseReleased(int x, int y, int button); 18 | void mouseEntered(int x, int y); 19 | void mouseExited(int x, int y); 20 | void windowResized(int w, int h); 21 | void dragEvent(ofDragInfo dragInfo); 22 | void gotMessage(ofMessage msg); 23 | 24 | 25 | ofVideoGrabber grabber; 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /walkingPersonExample/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=$(realpath ../../../..) 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /walkingPersonExample/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /walkingPersonExample/addons.make: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/walkingPersonExample/addons.make -------------------------------------------------------------------------------- /walkingPersonExample/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ofZach/letscode/b786df7363969000956d30b6ad9f047382489c1b/walkingPersonExample/bin/data/.gitkeep -------------------------------------------------------------------------------- /walkingPersonExample/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /walkingPersonExample/src/dataPlayer.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "dataPlayer.h" 4 | #include "data.h" 5 | 6 | 7 | //--------------------------------------------------------------- 8 | void dataPlayer::setup(){ 9 | 10 | 11 | //---------------------------------------------------------------- 12 | // the data is stored in a big flat array, let's copy it into something more managable 13 | for (int i = 0; i < 30; i++){ 14 | for (int j = 0; j < 24; j++){ 15 | float x = data3d[ i * 24 * 3 + j * 3 + 0 ]; 16 | float y = data3d[ i * 24 * 3 + j * 3 + 1 ]; 17 | float z = data3d[ i * 24 * 3 + j * 3 + 2 ]; 18 | frames[i][j].set(x,y,z); 19 | } 20 | } 21 | 22 | for (int i = 0; i < 30; i++){ 23 | for (int j = 0; j < 24; j++){ 24 | float x = data2d[ i * 24 * 2 + j * 2 + 0 ]; 25 | float y = data2d[ i * 24 * 2 + j * 2 + 1 ]; 26 | frames2d[i][j].set(x,y); 27 | } 28 | } 29 | //---------------------------------------------------------------- 30 | } 31 | 32 | 33 | //--------------------------------------------------------------- 34 | void dataPlayer::update(){ 35 | 36 | for (int i = 0; i < 24; i++){ 37 | currentFrame[i] = frames2d[ (int)(ofGetFrameNum()*0.5) % 30][i]; 38 | } 39 | 40 | } 41 | 42 | 43 | //--------------------------------------------------------------- 44 | void dataPlayer::draw(){ 45 | } -------------------------------------------------------------------------------- /walkingPersonExample/src/dataPlayer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | 5 | 6 | class dataPlayer { 7 | 8 | public: 9 | 10 | void setup(); 11 | void update(); 12 | void draw(); 13 | 14 | ofPoint currentFrame[24]; 15 | 16 | ofPoint frames[30][24]; // 30 frames, 24 points per frame 17 | ofPoint frames2d[30][24]; // 30 frames, 24 points per frame 18 | 19 | }; -------------------------------------------------------------------------------- /walkingPersonExample/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofApp.h" 3 | 4 | //======================================================================== 5 | int main( ){ 6 | ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context 7 | 8 | // this kicks off the running of my app 9 | // can be OF_WINDOW or OF_FULLSCREEN 10 | // pass in width and height too: 11 | ofRunApp(new ofApp()); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /walkingPersonExample/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofApp.h" 2 | 3 | 4 | //-------------------------------------------------------------- 5 | void ofApp::setup(){ 6 | 7 | 8 | DP.setup(); 9 | 10 | 11 | 12 | } 13 | 14 | //-------------------------------------------------------------- 15 | void ofApp::update(){ 16 | 17 | 18 | DP.update(); 19 | 20 | } 21 | 22 | //-------------------------------------------------------------- 23 | void ofApp::draw(){ 24 | 25 | ofBackground(0); 26 | 27 | 28 | for (int i = 0; i < 24; i++){ 29 | ofPoint p = DP.currentFrame[i]; 30 | ofCircle(p, 4); 31 | } 32 | 33 | } 34 | 35 | //-------------------------------------------------------------- 36 | void ofApp::keyPressed(int key){ 37 | 38 | 39 | 40 | } 41 | 42 | //-------------------------------------------------------------- 43 | void ofApp::keyReleased(int key){ 44 | 45 | } 46 | 47 | //-------------------------------------------------------------- 48 | void ofApp::mouseMoved(int x, int y ){ 49 | 50 | } 51 | 52 | //-------------------------------------------------------------- 53 | void ofApp::mouseDragged(int x, int y, int button){ 54 | 55 | } 56 | 57 | //-------------------------------------------------------------- 58 | void ofApp::mousePressed(int x, int y, int button){ 59 | 60 | } 61 | 62 | //-------------------------------------------------------------- 63 | void ofApp::mouseReleased(int x, int y, int button){ 64 | 65 | } 66 | 67 | //-------------------------------------------------------------- 68 | void ofApp::mouseEntered(int x, int y){ 69 | 70 | } 71 | 72 | //-------------------------------------------------------------- 73 | void ofApp::mouseExited(int x, int y){ 74 | 75 | } 76 | 77 | //-------------------------------------------------------------- 78 | void ofApp::windowResized(int w, int h){ 79 | 80 | } 81 | 82 | //-------------------------------------------------------------- 83 | void ofApp::gotMessage(ofMessage msg){ 84 | 85 | } 86 | 87 | //-------------------------------------------------------------- 88 | void ofApp::dragEvent(ofDragInfo dragInfo){ 89 | 90 | } 91 | -------------------------------------------------------------------------------- /walkingPersonExample/src/ofApp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "dataPlayer.h" 5 | 6 | 7 | 8 | class ofApp : public ofBaseApp{ 9 | 10 | public: 11 | void setup(); 12 | void update(); 13 | void draw(); 14 | 15 | void keyPressed(int key); 16 | void keyReleased(int key); 17 | void mouseMoved(int x, int y ); 18 | void mouseDragged(int x, int y, int button); 19 | void mousePressed(int x, int y, int button); 20 | void mouseReleased(int x, int y, int button); 21 | void mouseEntered(int x, int y); 22 | void mouseExited(int x, int y); 23 | void windowResized(int w, int h); 24 | void dragEvent(ofDragInfo dragInfo); 25 | void gotMessage(ofMessage msg); 26 | 27 | dataPlayer DP; 28 | 29 | 30 | }; 31 | --------------------------------------------------------------------------------