├── example-chain ├── .gitignore ├── Makefile ├── Project.xcconfig ├── bin │ └── data │ │ ├── .gitignore │ │ ├── CubicLensDistortion.fs │ │ └── ZoomBlur.fs ├── config.make ├── example-chain.xcodeproj │ └── project.pbxproj ├── openFrameworks-Info.plist └── src │ └── ofApp.cpp ├── example ├── .gitignore ├── Makefile ├── Project.xcconfig ├── bin │ └── data │ │ ├── .gitignore │ │ └── isf-test.fs ├── config.make ├── example.xcodeproj │ └── project.pbxproj ├── openFrameworks-Info.plist └── src │ └── ofApp.cpp ├── libs └── jsonxx │ ├── LICENSE.txt │ ├── jsonxx.cc │ └── jsonxx.h └── src ├── ofxISF.h └── ofxISF ├── Chain.h ├── CodeGenerater.h ├── Constants.h ├── Shader.h └── Uniforms.h /example-chain/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | Icon 10 | *.app 11 | ._* 12 | 13 | # xcode3 14 | *.mode1v3 15 | *.pbxuser 16 | build/ 17 | 18 | # xcode4 19 | *.xcodeproj/* 20 | !*.xcodeproj/project.pbxproj 21 | !*.xcodeproj/default.* 22 | **/*.xcodeproj/* 23 | !**/*.xcodeproj/project.pbxproj 24 | !**/*.xcodeproj/default.* 25 | *.xcworkspace/* 26 | !*.xcworkspace/contents.xcworkspacedata 27 | 28 | # windows 29 | *.exe 30 | Thumbs.db 31 | ehthumbs.db 32 | 33 | # vs 34 | ipch/ 35 | [Bb]in/ 36 | [Oo]bj/ 37 | *.aps 38 | *.ncb 39 | *.opensdf 40 | *.sdf 41 | *.cachefile 42 | *.suo 43 | *.user 44 | *.sln.docstates 45 | 46 | # Object files 47 | *.o 48 | 49 | # Libraries 50 | *.lib 51 | *.a 52 | 53 | # Shared objects (inc. Windows DLLs) 54 | *.dll 55 | *.so 56 | *.so.* 57 | *.dylib 58 | 59 | -------------------------------------------------------------------------------- /example-chain/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=../../.. 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /example-chain/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) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /example-chain/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example-chain/bin/data/CubicLensDistortion.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "Cubic Lens Distortion", 3 | "CREDIT": "by satoruhiga", 4 | "CATEGORIES": [ 5 | "GLSL FX" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "kcube", 14 | "TYPE": "float", 15 | "DEFAULT": 1.25, 16 | "MIN": 0.5, 17 | "MAX": 2.5 18 | }, 19 | { 20 | "NAME": "k", 21 | "TYPE": "float", 22 | "DEFAULT": -0.15, 23 | "MIN": -1, 24 | "MAX": 3 25 | } 26 | ] 27 | }*/ 28 | 29 | float aspect2 = pow(RENDERSIZE.x / RENDERSIZE.y, 2.); 30 | vec2 half_norm = vec2(0.5, 0.5); 31 | 32 | vec2 distort(vec2 uv) 33 | { 34 | float r2 = aspect2 * uv.x*uv.x + uv.y*uv.y; 35 | float f = 1. + r2 * (k + kcube * sqrt(r2)); 36 | return f * uv; 37 | } 38 | 39 | void main() 40 | { 41 | 42 | vec2 uv = distort(vv_FragNormCoord - half_norm); 43 | vec2 uv0 = distort(-half_norm); 44 | 45 | float s = length(half_norm) / length(uv0); 46 | 47 | gl_FragColor = IMG_PIXEL(inputImage, (s * uv + half_norm) * RENDERSIZE); 48 | } 49 | -------------------------------------------------------------------------------- /example-chain/bin/data/ZoomBlur.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "Zoom Blur", 3 | "CREDIT": "by satoruhiga", 4 | "CATEGORIES": [ 5 | "GLSL FX" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "zoom", 14 | "TYPE": "float", 15 | "DEFAULT": 3, 16 | "MIN": -50, 17 | "MAX": 50 18 | }, 19 | { 20 | "NAME": "feedback", 21 | "TYPE": "float", 22 | "DEFAULT": 0.95, 23 | "MIN": 0, 24 | "MAX": 1 25 | }, 26 | { 27 | "NAME": "dry", 28 | "TYPE": "float", 29 | "DEFAULT": 0.0, 30 | "MIN": 0, 31 | "MAX": 1 32 | } 33 | ], 34 | "PERSISTENT_BUFFERS": [ 35 | "accum" 36 | ], 37 | "PASSES": [ 38 | { 39 | "TARGET":"accum" 40 | }, 41 | { 42 | } 43 | ] 44 | }*/ 45 | 46 | void main() 47 | { 48 | vec4 A = IMG_THIS_PIXEL(inputImage); 49 | 50 | if (PASSINDEX == 0) 51 | { 52 | vec2 this_pixel = vv_FragNormCoord * RENDERSIZE; 53 | vec2 center = RENDERSIZE / 2.; 54 | vec2 vec = normalize(center - this_pixel); 55 | 56 | vec4 B = IMG_PIXEL(accum, this_pixel + vec * zoom); 57 | 58 | gl_FragColor.rgb = (A.rgb * A.a * (1. - feedback)) + (B.rgb * B.a * feedback); 59 | gl_FragColor.a = 1.0; 60 | } 61 | else if (PASSINDEX == 1) 62 | { 63 | vec4 B = IMG_THIS_PIXEL(accum); 64 | 65 | gl_FragColor.rgb = (A.rgb * dry) + (B.rgb); 66 | gl_FragColor.a = 1.0; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /example-chain/config.make: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CONFIGURE PROJECT MAKEFILE (optional) 3 | # This file is where we make project specific configurations. 4 | ################################################################################ 5 | 6 | ################################################################################ 7 | # OF ROOT 8 | # The location of your root openFrameworks installation 9 | # (default) OF_ROOT = ../../.. 10 | ################################################################################ 11 | # OF_ROOT = ../../.. 12 | 13 | ################################################################################ 14 | # PROJECT ROOT 15 | # The location of the project - a starting place for searching for files 16 | # (default) PROJECT_ROOT = . (this directory) 17 | # 18 | ################################################################################ 19 | # PROJECT_ROOT = . 20 | 21 | ################################################################################ 22 | # PROJECT SPECIFIC CHECKS 23 | # This is a project defined section to create internal makefile flags to 24 | # conditionally enable or disable the addition of various features within 25 | # this makefile. For instance, if you want to make changes based on whether 26 | # GTK is installed, one might test that here and create a variable to check. 27 | ################################################################################ 28 | # None 29 | 30 | ################################################################################ 31 | # PROJECT EXTERNAL SOURCE PATHS 32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder. 33 | # Like source folders in the PROJECT_ROOT, these paths are subject to 34 | # exlclusion via the PROJECT_EXLCUSIONS list. 35 | # 36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) 37 | # 38 | # Note: Leave a leading space when adding list items with the += operator 39 | ################################################################################ 40 | # PROJECT_EXTERNAL_SOURCE_PATHS = 41 | 42 | ################################################################################ 43 | # PROJECT EXCLUSIONS 44 | # These makefiles assume that all folders in your current project directory 45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations 46 | # to look for source code. The any folders or files that match any of the 47 | # items in the PROJECT_EXCLUSIONS list below will be ignored. 48 | # 49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete 50 | # string unless teh user adds a wildcard (%) operator to match subdirectories. 51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is 52 | # treated literally. 53 | # 54 | # (default) PROJECT_EXCLUSIONS = (blank) 55 | # 56 | # Will automatically exclude the following: 57 | # 58 | # $(PROJECT_ROOT)/bin% 59 | # $(PROJECT_ROOT)/obj% 60 | # $(PROJECT_ROOT)/%.xcodeproj 61 | # 62 | # Note: Leave a leading space when adding list items with the += operator 63 | ################################################################################ 64 | # PROJECT_EXCLUSIONS = 65 | 66 | ################################################################################ 67 | # PROJECT LINKER FLAGS 68 | # These flags will be sent to the linker when compiling the executable. 69 | # 70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs 71 | # 72 | # Note: Leave a leading space when adding list items with the += operator 73 | ################################################################################ 74 | 75 | # Currently, shared libraries that are needed are copied to the 76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to 77 | # add a runtime path to search for those shared libraries, since they aren't 78 | # incorporated directly into the final executable application binary. 79 | # TODO: should this be a default setting? 80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs 81 | 82 | ################################################################################ 83 | # PROJECT DEFINES 84 | # Create a space-delimited list of DEFINES. The list will be converted into 85 | # CFLAGS with the "-D" flag later in the makefile. 86 | # 87 | # (default) PROJECT_DEFINES = (blank) 88 | # 89 | # Note: Leave a leading space when adding list items with the += operator 90 | ################################################################################ 91 | # PROJECT_DEFINES = 92 | 93 | ################################################################################ 94 | # PROJECT CFLAGS 95 | # This is a list of fully qualified CFLAGS required when compiling for this 96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS 97 | # defined in your platform specific core configuration files. These flags are 98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. 99 | # 100 | # (default) PROJECT_CFLAGS = (blank) 101 | # 102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in 103 | # your platform specific configuration file will be applied by default and 104 | # further flags here may not be needed. 105 | # 106 | # Note: Leave a leading space when adding list items with the += operator 107 | ################################################################################ 108 | # PROJECT_CFLAGS = 109 | 110 | ################################################################################ 111 | # PROJECT OPTIMIZATION CFLAGS 112 | # These are lists of CFLAGS that are target-specific. While any flags could 113 | # be conditionally added, they are usually limited to optimization flags. 114 | # These flags are added BEFORE the PROJECT_CFLAGS. 115 | # 116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. 117 | # 118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) 119 | # 120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. 121 | # 122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) 123 | # 124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the 125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration 126 | # file will be applied by default and further optimization flags here may not 127 | # be needed. 128 | # 129 | # Note: Leave a leading space when adding list items with the += operator 130 | ################################################################################ 131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE = 132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG = 133 | 134 | ################################################################################ 135 | # PROJECT COMPILERS 136 | # Custom compilers can be set for CC and CXX 137 | # (default) PROJECT_CXX = (blank) 138 | # (default) PROJECT_CC = (blank) 139 | # Note: Leave a leading space when adding list items with the += operator 140 | ################################################################################ 141 | # PROJECT_CXX = 142 | # PROJECT_CC = 143 | -------------------------------------------------------------------------------- /example-chain/example-chain.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; 16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 21 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; 22 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 23 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 24 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 25 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 26 | E75A286E187DF217006E7860 /* jsonxx.cc in Sources */ = {isa = PBXBuildFile; fileRef = E75A2864187DF217006E7860 /* jsonxx.cc */; }; 27 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 28 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 29 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 36 | proxyType = 2; 37 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 38 | remoteInfo = openFrameworks; 39 | }; 40 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 43 | proxyType = 1; 44 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 45 | remoteInfo = openFrameworks; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXCopyFilesBuildPhase section */ 50 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 51 | isa = PBXCopyFilesBuildPhase; 52 | buildActionMask = 2147483647; 53 | dstPath = ""; 54 | dstSubfolderSpec = 10; 55 | files = ( 56 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXCopyFilesBuildPhase section */ 61 | 62 | /* Begin PBXFileReference section */ 63 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 64 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 65 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 66 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 67 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 68 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 69 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 70 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 71 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 72 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 73 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 74 | E4B69B5B0A3A1756003C02F2 /* example-chainDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-chainDebug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; lineEnding = 0; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.cpp; }; 76 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 77 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 78 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 79 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 80 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 81 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 82 | E75A2864187DF217006E7860 /* jsonxx.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsonxx.cc; sourceTree = ""; }; 83 | E75A2865187DF217006E7860 /* jsonxx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsonxx.h; sourceTree = ""; }; 84 | E75A2866187DF217006E7860 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; 85 | E75A2868187DF217006E7860 /* ofxISF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ofxISF.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 86 | E78825F318ACA026004094F4 /* CodeGenerater.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CodeGenerater.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 87 | E78825F418ACA027004094F4 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 88 | E78825F618ACA027004094F4 /* Uniforms.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Uniforms.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 89 | E78825F718ACA027004094F4 /* Shader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = Shader.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 90 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 91 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 92 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 93 | E7FF49FC18AE8F67000CF0EC /* Chain.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Chain.h; sourceTree = ""; }; 94 | /* End PBXFileReference section */ 95 | 96 | /* Begin PBXFrameworksBuildPhase section */ 97 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */, 102 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 103 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 104 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 105 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 106 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 107 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 108 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, 109 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 110 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 111 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 112 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 113 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 114 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 115 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 116 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 117 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXFrameworksBuildPhase section */ 122 | 123 | /* Begin PBXGroup section */ 124 | BB4B014C10F69532006C3DED /* addons */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | E75A2861187DF209006E7860 /* ofxISF */, 128 | ); 129 | name = addons; 130 | sourceTree = ""; 131 | }; 132 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | E7F985F515E0DE99003869B5 /* Accelerate.framework */, 136 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 137 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 138 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 139 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 140 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 141 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 142 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */, 143 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 144 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 145 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 146 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 147 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 148 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 149 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 150 | ); 151 | name = "system frameworks"; 152 | sourceTree = ""; 153 | }; 154 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 158 | ); 159 | name = "3rd party frameworks"; 160 | sourceTree = ""; 161 | }; 162 | E4328144138ABC890047C5CB /* Products */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 174 | BBAB23C913894ECA00AA2426 /* system frameworks */, 175 | ); 176 | name = frameworks; 177 | sourceTree = ""; 178 | }; 179 | E4B69B4A0A3A1720003C02F2 = { 180 | isa = PBXGroup; 181 | children = ( 182 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 183 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 184 | E4B69E1C0A3A1BDC003C02F2 /* src */, 185 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 186 | BB4B014C10F69532006C3DED /* addons */, 187 | E45BE5980E8CC70C009D7055 /* frameworks */, 188 | E4B69B5B0A3A1756003C02F2 /* example-chainDebug.app */, 189 | ); 190 | sourceTree = ""; 191 | }; 192 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, 196 | ); 197 | path = src; 198 | sourceTree = SOURCE_ROOT; 199 | }; 200 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 204 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 205 | ); 206 | name = openFrameworks; 207 | sourceTree = ""; 208 | }; 209 | E75A2861187DF209006E7860 /* ofxISF */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | E75A2862187DF217006E7860 /* libs */, 213 | E75A2867187DF217006E7860 /* src */, 214 | ); 215 | name = ofxISF; 216 | sourceTree = ""; 217 | }; 218 | E75A2862187DF217006E7860 /* libs */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | E75A2863187DF217006E7860 /* jsonxx */, 222 | ); 223 | name = libs; 224 | path = ../libs; 225 | sourceTree = ""; 226 | }; 227 | E75A2863187DF217006E7860 /* jsonxx */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | E75A2864187DF217006E7860 /* jsonxx.cc */, 231 | E75A2865187DF217006E7860 /* jsonxx.h */, 232 | E75A2866187DF217006E7860 /* LICENSE.txt */, 233 | ); 234 | path = jsonxx; 235 | sourceTree = ""; 236 | }; 237 | E75A2867187DF217006E7860 /* src */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | E75A2868187DF217006E7860 /* ofxISF.h */, 241 | E78825F218ACA026004094F4 /* ofxISF */, 242 | ); 243 | name = src; 244 | path = ../src; 245 | sourceTree = ""; 246 | }; 247 | E78825F218ACA026004094F4 /* ofxISF */ = { 248 | isa = PBXGroup; 249 | children = ( 250 | E78825F318ACA026004094F4 /* CodeGenerater.h */, 251 | E78825F418ACA027004094F4 /* Constants.h */, 252 | E78825F618ACA027004094F4 /* Uniforms.h */, 253 | E78825F718ACA027004094F4 /* Shader.h */, 254 | E7FF49FC18AE8F67000CF0EC /* Chain.h */, 255 | ); 256 | path = ofxISF; 257 | sourceTree = ""; 258 | }; 259 | /* End PBXGroup section */ 260 | 261 | /* Begin PBXNativeTarget section */ 262 | E4B69B5A0A3A1756003C02F2 /* example-chain */ = { 263 | isa = PBXNativeTarget; 264 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-chain" */; 265 | buildPhases = ( 266 | E4B69B580A3A1756003C02F2 /* Sources */, 267 | E4B69B590A3A1756003C02F2 /* Frameworks */, 268 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 269 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 270 | ); 271 | buildRules = ( 272 | ); 273 | dependencies = ( 274 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 275 | ); 276 | name = "example-chain"; 277 | productName = myOFApp; 278 | productReference = E4B69B5B0A3A1756003C02F2 /* example-chainDebug.app */; 279 | productType = "com.apple.product-type.application"; 280 | }; 281 | /* End PBXNativeTarget section */ 282 | 283 | /* Begin PBXProject section */ 284 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 285 | isa = PBXProject; 286 | attributes = { 287 | LastUpgradeCheck = 0460; 288 | }; 289 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-chain" */; 290 | compatibilityVersion = "Xcode 3.2"; 291 | developmentRegion = English; 292 | hasScannedForEncodings = 0; 293 | knownRegions = ( 294 | English, 295 | Japanese, 296 | French, 297 | German, 298 | ); 299 | mainGroup = E4B69B4A0A3A1720003C02F2; 300 | productRefGroup = E4B69B4A0A3A1720003C02F2; 301 | projectDirPath = ""; 302 | projectReferences = ( 303 | { 304 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 305 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 306 | }, 307 | ); 308 | projectRoot = ""; 309 | targets = ( 310 | E4B69B5A0A3A1756003C02F2 /* example-chain */, 311 | ); 312 | }; 313 | /* End PBXProject section */ 314 | 315 | /* Begin PBXReferenceProxy section */ 316 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 317 | isa = PBXReferenceProxy; 318 | fileType = archive.ar; 319 | path = openFrameworksDebug.a; 320 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 321 | sourceTree = BUILT_PRODUCTS_DIR; 322 | }; 323 | /* End PBXReferenceProxy section */ 324 | 325 | /* Begin PBXShellScriptBuildPhase section */ 326 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 327 | isa = PBXShellScriptBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | inputPaths = ( 332 | ); 333 | outputPaths = ( 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | shellPath = /bin/sh; 337 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\ncp -f \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n"; 338 | }; 339 | /* End PBXShellScriptBuildPhase section */ 340 | 341 | /* Begin PBXSourcesBuildPhase section */ 342 | E4B69B580A3A1756003C02F2 /* Sources */ = { 343 | isa = PBXSourcesBuildPhase; 344 | buildActionMask = 2147483647; 345 | files = ( 346 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, 347 | E75A286E187DF217006E7860 /* jsonxx.cc in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXSourcesBuildPhase section */ 352 | 353 | /* Begin PBXTargetDependency section */ 354 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 355 | isa = PBXTargetDependency; 356 | name = openFrameworks; 357 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 358 | }; 359 | /* End PBXTargetDependency section */ 360 | 361 | /* Begin XCBuildConfiguration section */ 362 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 365 | buildSettings = { 366 | ARCHS = "$(NATIVE_ARCH)"; 367 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 368 | COPY_PHASE_STRIP = NO; 369 | DEAD_CODE_STRIPPING = YES; 370 | GCC_AUTO_VECTORIZATION = YES; 371 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 372 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 373 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 374 | GCC_OPTIMIZATION_LEVEL = 0; 375 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 376 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 377 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 378 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 379 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 380 | GCC_WARN_UNUSED_VALUE = NO; 381 | GCC_WARN_UNUSED_VARIABLE = NO; 382 | MACOSX_DEPLOYMENT_TARGET = 10.6; 383 | OTHER_CPLUSPLUSFLAGS = ( 384 | "-D__MACOSX_CORE__", 385 | "-lpthread", 386 | "-mtune=native", 387 | ); 388 | SDKROOT = macosx; 389 | }; 390 | name = Debug; 391 | }; 392 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 395 | buildSettings = { 396 | ARCHS = "$(NATIVE_ARCH)"; 397 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 398 | COPY_PHASE_STRIP = YES; 399 | DEAD_CODE_STRIPPING = YES; 400 | GCC_AUTO_VECTORIZATION = YES; 401 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 402 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 403 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 404 | GCC_OPTIMIZATION_LEVEL = 3; 405 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 406 | GCC_UNROLL_LOOPS = YES; 407 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 408 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 409 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 410 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 411 | GCC_WARN_UNUSED_VALUE = NO; 412 | GCC_WARN_UNUSED_VARIABLE = NO; 413 | MACOSX_DEPLOYMENT_TARGET = 10.6; 414 | OTHER_CPLUSPLUSFLAGS = ( 415 | "-D__MACOSX_CORE__", 416 | "-lpthread", 417 | "-mtune=native", 418 | ); 419 | SDKROOT = macosx; 420 | }; 421 | name = Release; 422 | }; 423 | E4B69B600A3A1757003C02F2 /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | COMBINE_HIDPI_IMAGES = YES; 427 | COPY_PHASE_STRIP = NO; 428 | FRAMEWORK_SEARCH_PATHS = ( 429 | "$(inherited)", 430 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 431 | /Users/satoruhiga/Documents/openFrameworks/of_v0.8.0_osx_release/addons/ofxSyphon/libs/Syphon/lib/osx, 432 | ); 433 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 434 | GCC_DYNAMIC_NO_PIC = NO; 435 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 436 | GCC_MODEL_TUNING = NONE; 437 | ICON = "$(ICON_NAME_DEBUG)"; 438 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 439 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 440 | INSTALL_PATH = "$(HOME)/Applications"; 441 | LIBRARY_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 444 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 445 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 493 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 494 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 495 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 496 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 497 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 498 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 499 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 500 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 501 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 502 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 503 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 504 | ); 505 | PRODUCT_NAME = "example-chainDebug"; 506 | WRAPPER_EXTENSION = app; 507 | }; 508 | name = Debug; 509 | }; 510 | E4B69B610A3A1757003C02F2 /* Release */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | COMBINE_HIDPI_IMAGES = YES; 514 | COPY_PHASE_STRIP = YES; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(inherited)", 517 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 518 | /Users/satoruhiga/Documents/openFrameworks/of_v0.8.0_osx_release/addons/ofxSyphon/libs/Syphon/lib/osx, 519 | ); 520 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 521 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 522 | GCC_MODEL_TUNING = NONE; 523 | ICON = "$(ICON_NAME_RELEASE)"; 524 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 525 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 526 | INSTALL_PATH = "$(HOME)/Applications"; 527 | LIBRARY_SEARCH_PATHS = ( 528 | "$(inherited)", 529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 579 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 580 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 581 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 582 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 583 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 584 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 585 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 586 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 587 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 588 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 589 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 590 | ); 591 | PRODUCT_NAME = "example-chain"; 592 | WRAPPER_EXTENSION = app; 593 | }; 594 | name = Release; 595 | }; 596 | /* End XCBuildConfiguration section */ 597 | 598 | /* Begin XCConfigurationList section */ 599 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example-chain" */ = { 600 | isa = XCConfigurationList; 601 | buildConfigurations = ( 602 | E4B69B4E0A3A1720003C02F2 /* Debug */, 603 | E4B69B4F0A3A1720003C02F2 /* Release */, 604 | ); 605 | defaultConfigurationIsVisible = 0; 606 | defaultConfigurationName = Release; 607 | }; 608 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example-chain" */ = { 609 | isa = XCConfigurationList; 610 | buildConfigurations = ( 611 | E4B69B600A3A1757003C02F2 /* Debug */, 612 | E4B69B610A3A1757003C02F2 /* Release */, 613 | ); 614 | defaultConfigurationIsVisible = 0; 615 | defaultConfigurationName = Release; 616 | }; 617 | /* End XCConfigurationList section */ 618 | }; 619 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 620 | } 621 | -------------------------------------------------------------------------------- /example-chain/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /example-chain/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | 3 | #include "ofxISF.h" 4 | 5 | class ofApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | ofxISF::Chain chain; 10 | ofVideoGrabber video; 11 | 12 | void setup() 13 | { 14 | ofSetFrameRate(60); 15 | ofSetVerticalSync(true); 16 | ofBackground(0); 17 | 18 | video.initGrabber(1280, 720); 19 | 20 | chain.setup(1280, 720); 21 | chain.load("ZoomBlur.fs"); 22 | chain.load("CubicLensDistortion.fs"); 23 | 24 | chain.setImage(video.getTextureReference()); 25 | } 26 | 27 | void update() 28 | { 29 | video.update(); 30 | chain.update(); 31 | } 32 | 33 | void draw() 34 | { 35 | chain.draw(0, 0); 36 | } 37 | 38 | void keyPressed(int key) 39 | { 40 | chain.setEnable("ZoomBlur", !chain.getEnable("ZoomBlur")); 41 | } 42 | 43 | void keyReleased(int key) 44 | { 45 | 46 | } 47 | 48 | void mouseMoved(int x, int y) 49 | { 50 | } 51 | 52 | void mouseDragged(int x, int y, int button) 53 | { 54 | } 55 | 56 | void mousePressed(int x, int y, int button) 57 | { 58 | } 59 | 60 | void mouseReleased(int x, int y, int button) 61 | { 62 | } 63 | 64 | void windowResized(int w, int h) 65 | { 66 | } 67 | }; 68 | 69 | int main(int argc, const char** argv) 70 | { 71 | ofSetupOpenGL(1280, 720, OF_WINDOW); 72 | ofRunApp(new ofApp); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | .hg 3 | .cvs 4 | 5 | # osx 6 | .DS_Store 7 | .AppleDouble 8 | .LSOverride 9 | Icon 10 | *.app 11 | ._* 12 | 13 | # xcode3 14 | *.mode1v3 15 | *.pbxuser 16 | build/ 17 | 18 | # xcode4 19 | *.xcodeproj/* 20 | !*.xcodeproj/project.pbxproj 21 | !*.xcodeproj/default.* 22 | **/*.xcodeproj/* 23 | !**/*.xcodeproj/project.pbxproj 24 | !**/*.xcodeproj/default.* 25 | *.xcworkspace/* 26 | !*.xcworkspace/contents.xcworkspacedata 27 | 28 | # windows 29 | *.exe 30 | Thumbs.db 31 | ehthumbs.db 32 | 33 | # vs 34 | ipch/ 35 | [Bb]in/ 36 | [Oo]bj/ 37 | *.aps 38 | *.ncb 39 | *.opensdf 40 | *.sdf 41 | *.cachefile 42 | *.suo 43 | *.user 44 | *.sln.docstates 45 | 46 | # Object files 47 | *.o 48 | 49 | # Libraries 50 | *.lib 51 | *.a 52 | 53 | # Shared objects (inc. Windows DLLs) 54 | *.dll 55 | *.so 56 | *.so.* 57 | *.dylib 58 | 59 | -------------------------------------------------------------------------------- /example/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=../../.. 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /example/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) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /example/bin/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in here apart from the .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /example/bin/data/isf-test.fs: -------------------------------------------------------------------------------- 1 | /*{ 2 | "DESCRIPTION": "RGB color trail + noise", 3 | "CREDIT": "by satoruhiga", 4 | "CATEGORIES": [ 5 | "TEST-GLSL FX" 6 | ], 7 | "INPUTS": [ 8 | { 9 | "NAME": "inputImage", 10 | "TYPE": "image" 11 | }, 12 | { 13 | "NAME": "blurAmount", 14 | "TYPE": "float" 15 | } 16 | ], 17 | "PERSISTENT_BUFFERS": [ 18 | "bufferVariableNameA" 19 | ], 20 | "PASSES": [ 21 | { 22 | "TARGET":"bufferVariableNameA" 23 | } 24 | ] 25 | }*/ 26 | 27 | void main() 28 | { 29 | vec4 freshPixel = IMG_THIS_PIXEL(inputImage); 30 | vec4 stalePixel = IMG_THIS_PIXEL(bufferVariableNameA); 31 | gl_FragColor = mix(freshPixel, stalePixel, blurAmount); 32 | gl_FragColor.rg = mix(gl_FragColor.rg, stalePixel.rg, (sin(TIME * 0.1) / 6.283) * 0.2 + 0.8); 33 | gl_FragColor.rb = mix(gl_FragColor.rb, stalePixel.rb, (sin(TIME * 0.13) / 6.283) * 0.2 + 0.8); 34 | gl_FragColor.ba = mix(gl_FragColor.ba, stalePixel.ba, (sin(TIME * 0.16) / 6.283) * 0.2 + 0.8); 35 | } 36 | -------------------------------------------------------------------------------- /example/config.make: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CONFIGURE PROJECT MAKEFILE (optional) 3 | # This file is where we make project specific configurations. 4 | ################################################################################ 5 | 6 | ################################################################################ 7 | # OF ROOT 8 | # The location of your root openFrameworks installation 9 | # (default) OF_ROOT = ../../.. 10 | ################################################################################ 11 | # OF_ROOT = ../../.. 12 | 13 | ################################################################################ 14 | # PROJECT ROOT 15 | # The location of the project - a starting place for searching for files 16 | # (default) PROJECT_ROOT = . (this directory) 17 | # 18 | ################################################################################ 19 | # PROJECT_ROOT = . 20 | 21 | ################################################################################ 22 | # PROJECT SPECIFIC CHECKS 23 | # This is a project defined section to create internal makefile flags to 24 | # conditionally enable or disable the addition of various features within 25 | # this makefile. For instance, if you want to make changes based on whether 26 | # GTK is installed, one might test that here and create a variable to check. 27 | ################################################################################ 28 | # None 29 | 30 | ################################################################################ 31 | # PROJECT EXTERNAL SOURCE PATHS 32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder. 33 | # Like source folders in the PROJECT_ROOT, these paths are subject to 34 | # exlclusion via the PROJECT_EXLCUSIONS list. 35 | # 36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) 37 | # 38 | # Note: Leave a leading space when adding list items with the += operator 39 | ################################################################################ 40 | # PROJECT_EXTERNAL_SOURCE_PATHS = 41 | 42 | ################################################################################ 43 | # PROJECT EXCLUSIONS 44 | # These makefiles assume that all folders in your current project directory 45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations 46 | # to look for source code. The any folders or files that match any of the 47 | # items in the PROJECT_EXCLUSIONS list below will be ignored. 48 | # 49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete 50 | # string unless teh user adds a wildcard (%) operator to match subdirectories. 51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is 52 | # treated literally. 53 | # 54 | # (default) PROJECT_EXCLUSIONS = (blank) 55 | # 56 | # Will automatically exclude the following: 57 | # 58 | # $(PROJECT_ROOT)/bin% 59 | # $(PROJECT_ROOT)/obj% 60 | # $(PROJECT_ROOT)/%.xcodeproj 61 | # 62 | # Note: Leave a leading space when adding list items with the += operator 63 | ################################################################################ 64 | # PROJECT_EXCLUSIONS = 65 | 66 | ################################################################################ 67 | # PROJECT LINKER FLAGS 68 | # These flags will be sent to the linker when compiling the executable. 69 | # 70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs 71 | # 72 | # Note: Leave a leading space when adding list items with the += operator 73 | ################################################################################ 74 | 75 | # Currently, shared libraries that are needed are copied to the 76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to 77 | # add a runtime path to search for those shared libraries, since they aren't 78 | # incorporated directly into the final executable application binary. 79 | # TODO: should this be a default setting? 80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs 81 | 82 | ################################################################################ 83 | # PROJECT DEFINES 84 | # Create a space-delimited list of DEFINES. The list will be converted into 85 | # CFLAGS with the "-D" flag later in the makefile. 86 | # 87 | # (default) PROJECT_DEFINES = (blank) 88 | # 89 | # Note: Leave a leading space when adding list items with the += operator 90 | ################################################################################ 91 | # PROJECT_DEFINES = 92 | 93 | ################################################################################ 94 | # PROJECT CFLAGS 95 | # This is a list of fully qualified CFLAGS required when compiling for this 96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS 97 | # defined in your platform specific core configuration files. These flags are 98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. 99 | # 100 | # (default) PROJECT_CFLAGS = (blank) 101 | # 102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in 103 | # your platform specific configuration file will be applied by default and 104 | # further flags here may not be needed. 105 | # 106 | # Note: Leave a leading space when adding list items with the += operator 107 | ################################################################################ 108 | # PROJECT_CFLAGS = 109 | 110 | ################################################################################ 111 | # PROJECT OPTIMIZATION CFLAGS 112 | # These are lists of CFLAGS that are target-specific. While any flags could 113 | # be conditionally added, they are usually limited to optimization flags. 114 | # These flags are added BEFORE the PROJECT_CFLAGS. 115 | # 116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. 117 | # 118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) 119 | # 120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. 121 | # 122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) 123 | # 124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the 125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration 126 | # file will be applied by default and further optimization flags here may not 127 | # be needed. 128 | # 129 | # Note: Leave a leading space when adding list items with the += operator 130 | ################################################################################ 131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE = 132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG = 133 | 134 | ################################################################################ 135 | # PROJECT COMPILERS 136 | # Custom compilers can be set for CC and CXX 137 | # (default) PROJECT_CXX = (blank) 138 | # (default) PROJECT_CC = (blank) 139 | # Note: Leave a leading space when adding list items with the += operator 140 | ################################################################################ 141 | # PROJECT_CXX = 142 | # PROJECT_CC = 143 | -------------------------------------------------------------------------------- /example/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 11 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 12 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9710E8CC7DD009D7055 /* AGL.framework */; }; 13 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */; }; 14 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */; }; 15 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9740E8CC7DD009D7055 /* Carbon.framework */; }; 16 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */; }; 17 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */; }; 18 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9770E8CC7DD009D7055 /* CoreServices.framework */; }; 19 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE9790E8CC7DD009D7055 /* OpenGL.framework */; }; 20 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */; }; 21 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; 22 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424410CC5A17004149E2 /* AppKit.framework */; }; 23 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424510CC5A17004149E2 /* Cocoa.framework */; }; 24 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4C2424610CC5A17004149E2 /* IOKit.framework */; }; 25 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBAB23BE13894E4700AA2426 /* GLUT.framework */; }; 26 | E75A286E187DF217006E7860 /* jsonxx.cc in Sources */ = {isa = PBXBuildFile; fileRef = E75A2864187DF217006E7860 /* jsonxx.cc */; }; 27 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */; }; 28 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7E077E715D3B6510020DFD4 /* QTKit.framework */; }; 29 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7F985F515E0DE99003869B5 /* Accelerate.framework */; }; 30 | /* End PBXBuildFile section */ 31 | 32 | /* Begin PBXContainerItemProxy section */ 33 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 34 | isa = PBXContainerItemProxy; 35 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 36 | proxyType = 2; 37 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 38 | remoteInfo = openFrameworks; 39 | }; 40 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 43 | proxyType = 1; 44 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 45 | remoteInfo = openFrameworks; 46 | }; 47 | /* End PBXContainerItemProxy section */ 48 | 49 | /* Begin PBXCopyFilesBuildPhase section */ 50 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 51 | isa = PBXCopyFilesBuildPhase; 52 | buildActionMask = 2147483647; 53 | dstPath = ""; 54 | dstSubfolderSpec = 10; 55 | files = ( 56 | BBAB23CB13894F3D00AA2426 /* GLUT.framework in CopyFiles */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXCopyFilesBuildPhase section */ 61 | 62 | /* Begin PBXFileReference section */ 63 | BBAB23BE13894E4700AA2426 /* GLUT.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLUT.framework; path = ../../../libs/glut/lib/osx/GLUT.framework; sourceTree = ""; }; 64 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 65 | E45BE9710E8CC7DD009D7055 /* AGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AGL.framework; path = /System/Library/Frameworks/AGL.framework; sourceTree = ""; }; 66 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; 67 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; 68 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; 69 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = /System/Library/Frameworks/CoreAudio.framework; sourceTree = ""; }; 70 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; 71 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = /System/Library/Frameworks/CoreServices.framework; sourceTree = ""; }; 72 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 73 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = ""; }; 74 | E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = exampleDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; }; 76 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 77 | E4C2424410CC5A17004149E2 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 78 | E4C2424510CC5A17004149E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 79 | E4C2424610CC5A17004149E2 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = ""; }; 80 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 81 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 82 | E75A2864187DF217006E7860 /* jsonxx.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsonxx.cc; sourceTree = ""; }; 83 | E75A2865187DF217006E7860 /* jsonxx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsonxx.h; sourceTree = ""; }; 84 | E75A2866187DF217006E7860 /* LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE.txt; sourceTree = ""; }; 85 | E75A2868187DF217006E7860 /* ofxISF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ofxISF.h; sourceTree = ""; }; 86 | E78825EB18AC1A5F004094F4 /* CodeGenerater.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CodeGenerater.h; sourceTree = ""; }; 87 | E78825EC18AC1A5F004094F4 /* Constants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constants.h; sourceTree = ""; }; 88 | E78825ED18AC1A5F004094F4 /* JSONParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONParser.h; sourceTree = ""; }; 89 | E78825EE18AC1A5F004094F4 /* Params.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Params.h; sourceTree = ""; }; 90 | E78825EF18AC1A5F004094F4 /* Shader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = ""; }; 91 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 92 | E7E077E715D3B6510020DFD4 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = ""; }; 93 | E7F985F515E0DE99003869B5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = ""; }; 94 | /* End PBXFileReference section */ 95 | 96 | /* Begin PBXFrameworksBuildPhase section */ 97 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | E7F985F815E0DEA3003869B5 /* Accelerate.framework in Frameworks */, 102 | E7E077E815D3B6510020DFD4 /* QTKit.framework in Frameworks */, 103 | E4EB6799138ADC1D00A09F29 /* GLUT.framework in Frameworks */, 104 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 105 | E45BE97B0E8CC7DD009D7055 /* AGL.framework in Frameworks */, 106 | E45BE97C0E8CC7DD009D7055 /* ApplicationServices.framework in Frameworks */, 107 | E45BE97D0E8CC7DD009D7055 /* AudioToolbox.framework in Frameworks */, 108 | E45BE97E0E8CC7DD009D7055 /* Carbon.framework in Frameworks */, 109 | E45BE97F0E8CC7DD009D7055 /* CoreAudio.framework in Frameworks */, 110 | E45BE9800E8CC7DD009D7055 /* CoreFoundation.framework in Frameworks */, 111 | E45BE9810E8CC7DD009D7055 /* CoreServices.framework in Frameworks */, 112 | E45BE9830E8CC7DD009D7055 /* OpenGL.framework in Frameworks */, 113 | E45BE9840E8CC7DD009D7055 /* QuickTime.framework in Frameworks */, 114 | E4C2424710CC5A17004149E2 /* AppKit.framework in Frameworks */, 115 | E4C2424810CC5A17004149E2 /* Cocoa.framework in Frameworks */, 116 | E4C2424910CC5A17004149E2 /* IOKit.framework in Frameworks */, 117 | E7E077E515D3B63C0020DFD4 /* CoreVideo.framework in Frameworks */, 118 | ); 119 | runOnlyForDeploymentPostprocessing = 0; 120 | }; 121 | /* End PBXFrameworksBuildPhase section */ 122 | 123 | /* Begin PBXGroup section */ 124 | BB4B014C10F69532006C3DED /* addons */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | E75A2861187DF209006E7860 /* ofxISF */, 128 | ); 129 | name = addons; 130 | sourceTree = ""; 131 | }; 132 | BBAB23C913894ECA00AA2426 /* system frameworks */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | E7F985F515E0DE99003869B5 /* Accelerate.framework */, 136 | E4C2424410CC5A17004149E2 /* AppKit.framework */, 137 | E4C2424510CC5A17004149E2 /* Cocoa.framework */, 138 | E4C2424610CC5A17004149E2 /* IOKit.framework */, 139 | E45BE9710E8CC7DD009D7055 /* AGL.framework */, 140 | E45BE9720E8CC7DD009D7055 /* ApplicationServices.framework */, 141 | E45BE9730E8CC7DD009D7055 /* AudioToolbox.framework */, 142 | E45BE9740E8CC7DD009D7055 /* Carbon.framework */, 143 | E45BE9750E8CC7DD009D7055 /* CoreAudio.framework */, 144 | E45BE9760E8CC7DD009D7055 /* CoreFoundation.framework */, 145 | E45BE9770E8CC7DD009D7055 /* CoreServices.framework */, 146 | E45BE9790E8CC7DD009D7055 /* OpenGL.framework */, 147 | E45BE97A0E8CC7DD009D7055 /* QuickTime.framework */, 148 | E7E077E415D3B63C0020DFD4 /* CoreVideo.framework */, 149 | E7E077E715D3B6510020DFD4 /* QTKit.framework */, 150 | ); 151 | name = "system frameworks"; 152 | sourceTree = ""; 153 | }; 154 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */ = { 155 | isa = PBXGroup; 156 | children = ( 157 | BBAB23BE13894E4700AA2426 /* GLUT.framework */, 158 | ); 159 | name = "3rd party frameworks"; 160 | sourceTree = ""; 161 | }; 162 | E4328144138ABC890047C5CB /* Products */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | E45BE5980E8CC70C009D7055 /* frameworks */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | BBAB23CA13894EDB00AA2426 /* 3rd party frameworks */, 174 | BBAB23C913894ECA00AA2426 /* system frameworks */, 175 | ); 176 | name = frameworks; 177 | sourceTree = ""; 178 | }; 179 | E4B69B4A0A3A1720003C02F2 = { 180 | isa = PBXGroup; 181 | children = ( 182 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 183 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 184 | E4B69E1C0A3A1BDC003C02F2 /* src */, 185 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 186 | BB4B014C10F69532006C3DED /* addons */, 187 | E45BE5980E8CC70C009D7055 /* frameworks */, 188 | E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */, 189 | ); 190 | sourceTree = ""; 191 | }; 192 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, 196 | ); 197 | path = src; 198 | sourceTree = SOURCE_ROOT; 199 | }; 200 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 204 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 205 | ); 206 | name = openFrameworks; 207 | sourceTree = ""; 208 | }; 209 | E75A2861187DF209006E7860 /* ofxISF */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | E75A2862187DF217006E7860 /* libs */, 213 | E75A2867187DF217006E7860 /* src */, 214 | ); 215 | name = ofxISF; 216 | sourceTree = ""; 217 | }; 218 | E75A2862187DF217006E7860 /* libs */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | E75A2863187DF217006E7860 /* jsonxx */, 222 | ); 223 | name = libs; 224 | path = ../libs; 225 | sourceTree = ""; 226 | }; 227 | E75A2863187DF217006E7860 /* jsonxx */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | E75A2864187DF217006E7860 /* jsonxx.cc */, 231 | E75A2865187DF217006E7860 /* jsonxx.h */, 232 | E75A2866187DF217006E7860 /* LICENSE.txt */, 233 | ); 234 | path = jsonxx; 235 | sourceTree = ""; 236 | }; 237 | E75A2867187DF217006E7860 /* src */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | E75A2868187DF217006E7860 /* ofxISF.h */, 241 | E78825E518AC1A39004094F4 /* ofxISF */, 242 | ); 243 | name = src; 244 | path = ../src; 245 | sourceTree = ""; 246 | }; 247 | E78825E518AC1A39004094F4 /* ofxISF */ = { 248 | isa = PBXGroup; 249 | children = ( 250 | E78825EB18AC1A5F004094F4 /* CodeGenerater.h */, 251 | E78825EC18AC1A5F004094F4 /* Constants.h */, 252 | E78825ED18AC1A5F004094F4 /* JSONParser.h */, 253 | E78825EE18AC1A5F004094F4 /* Params.h */, 254 | E78825EF18AC1A5F004094F4 /* Shader.h */, 255 | ); 256 | path = ofxISF; 257 | sourceTree = ""; 258 | }; 259 | /* End PBXGroup section */ 260 | 261 | /* Begin PBXNativeTarget section */ 262 | E4B69B5A0A3A1756003C02F2 /* example */ = { 263 | isa = PBXNativeTarget; 264 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example" */; 265 | buildPhases = ( 266 | E4B69B580A3A1756003C02F2 /* Sources */, 267 | E4B69B590A3A1756003C02F2 /* Frameworks */, 268 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 269 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 270 | ); 271 | buildRules = ( 272 | ); 273 | dependencies = ( 274 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 275 | ); 276 | name = example; 277 | productName = myOFApp; 278 | productReference = E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */; 279 | productType = "com.apple.product-type.application"; 280 | }; 281 | /* End PBXNativeTarget section */ 282 | 283 | /* Begin PBXProject section */ 284 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 285 | isa = PBXProject; 286 | attributes = { 287 | LastUpgradeCheck = 0460; 288 | }; 289 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example" */; 290 | compatibilityVersion = "Xcode 3.2"; 291 | developmentRegion = English; 292 | hasScannedForEncodings = 0; 293 | knownRegions = ( 294 | English, 295 | Japanese, 296 | French, 297 | German, 298 | ); 299 | mainGroup = E4B69B4A0A3A1720003C02F2; 300 | productRefGroup = E4B69B4A0A3A1720003C02F2; 301 | projectDirPath = ""; 302 | projectReferences = ( 303 | { 304 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 305 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 306 | }, 307 | ); 308 | projectRoot = ""; 309 | targets = ( 310 | E4B69B5A0A3A1756003C02F2 /* example */, 311 | ); 312 | }; 313 | /* End PBXProject section */ 314 | 315 | /* Begin PBXReferenceProxy section */ 316 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 317 | isa = PBXReferenceProxy; 318 | fileType = archive.ar; 319 | path = openFrameworksDebug.a; 320 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 321 | sourceTree = BUILT_PRODUCTS_DIR; 322 | }; 323 | /* End PBXReferenceProxy section */ 324 | 325 | /* Begin PBXShellScriptBuildPhase section */ 326 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 327 | isa = PBXShellScriptBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | inputPaths = ( 332 | ); 333 | outputPaths = ( 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | shellPath = /bin/sh; 337 | shellScript = "cp -f ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/libfmodex.dylib\"; install_name_tool -change ./libfmodex.dylib @executable_path/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\nmkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\ncp -f \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n"; 338 | }; 339 | /* End PBXShellScriptBuildPhase section */ 340 | 341 | /* Begin PBXSourcesBuildPhase section */ 342 | E4B69B580A3A1756003C02F2 /* Sources */ = { 343 | isa = PBXSourcesBuildPhase; 344 | buildActionMask = 2147483647; 345 | files = ( 346 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, 347 | E75A286E187DF217006E7860 /* jsonxx.cc in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXSourcesBuildPhase section */ 352 | 353 | /* Begin PBXTargetDependency section */ 354 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 355 | isa = PBXTargetDependency; 356 | name = openFrameworks; 357 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 358 | }; 359 | /* End PBXTargetDependency section */ 360 | 361 | /* Begin XCBuildConfiguration section */ 362 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 365 | buildSettings = { 366 | ARCHS = "$(NATIVE_ARCH)"; 367 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 368 | COPY_PHASE_STRIP = NO; 369 | DEAD_CODE_STRIPPING = YES; 370 | GCC_AUTO_VECTORIZATION = YES; 371 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 372 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 373 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 374 | GCC_OPTIMIZATION_LEVEL = 0; 375 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 376 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 377 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 378 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 379 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 380 | GCC_WARN_UNUSED_VALUE = NO; 381 | GCC_WARN_UNUSED_VARIABLE = NO; 382 | MACOSX_DEPLOYMENT_TARGET = 10.6; 383 | OTHER_CPLUSPLUSFLAGS = ( 384 | "-D__MACOSX_CORE__", 385 | "-lpthread", 386 | "-mtune=native", 387 | ); 388 | SDKROOT = macosx; 389 | }; 390 | name = Debug; 391 | }; 392 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 395 | buildSettings = { 396 | ARCHS = "$(NATIVE_ARCH)"; 397 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 398 | COPY_PHASE_STRIP = YES; 399 | DEAD_CODE_STRIPPING = YES; 400 | GCC_AUTO_VECTORIZATION = YES; 401 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 402 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 403 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 404 | GCC_OPTIMIZATION_LEVEL = 3; 405 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 406 | GCC_UNROLL_LOOPS = YES; 407 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 408 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 409 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 410 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 411 | GCC_WARN_UNUSED_VALUE = NO; 412 | GCC_WARN_UNUSED_VARIABLE = NO; 413 | MACOSX_DEPLOYMENT_TARGET = 10.6; 414 | OTHER_CPLUSPLUSFLAGS = ( 415 | "-D__MACOSX_CORE__", 416 | "-lpthread", 417 | "-mtune=native", 418 | ); 419 | SDKROOT = macosx; 420 | }; 421 | name = Release; 422 | }; 423 | E4B69B600A3A1757003C02F2 /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | COMBINE_HIDPI_IMAGES = YES; 427 | COPY_PHASE_STRIP = NO; 428 | FRAMEWORK_SEARCH_PATHS = ( 429 | "$(inherited)", 430 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 431 | /Users/satoruhiga/Documents/openFrameworks/of_v0.8.0_osx_release/addons/ofxSyphon/libs/Syphon/lib/osx, 432 | ); 433 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 434 | GCC_DYNAMIC_NO_PIC = NO; 435 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 436 | GCC_MODEL_TUNING = NONE; 437 | ICON = "$(ICON_NAME_DEBUG)"; 438 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 439 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 440 | INSTALL_PATH = "$(HOME)/Applications"; 441 | LIBRARY_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 444 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 445 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 446 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 447 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 448 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 449 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 450 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 451 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 452 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 453 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 454 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 455 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 456 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 457 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 458 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 459 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 460 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 461 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 462 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 463 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 464 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 465 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 466 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 467 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 468 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 469 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 470 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 471 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 472 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 473 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 474 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 475 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 476 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 477 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 478 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 479 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 480 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 481 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 482 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 483 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 484 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 485 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 486 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 487 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 488 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 489 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 490 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 491 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 492 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 493 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 494 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 495 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 496 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 497 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 498 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 499 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 500 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 501 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 502 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 503 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_52)", 504 | ); 505 | PRODUCT_NAME = exampleDebug; 506 | WRAPPER_EXTENSION = app; 507 | }; 508 | name = Debug; 509 | }; 510 | E4B69B610A3A1757003C02F2 /* Release */ = { 511 | isa = XCBuildConfiguration; 512 | buildSettings = { 513 | COMBINE_HIDPI_IMAGES = YES; 514 | COPY_PHASE_STRIP = YES; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(inherited)", 517 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 518 | /Users/satoruhiga/Documents/openFrameworks/of_v0.8.0_osx_release/addons/ofxSyphon/libs/Syphon/lib/osx, 519 | ); 520 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 521 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 522 | GCC_MODEL_TUNING = NONE; 523 | ICON = "$(ICON_NAME_RELEASE)"; 524 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 525 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 526 | INSTALL_PATH = "$(HOME)/Applications"; 527 | LIBRARY_SEARCH_PATHS = ( 528 | "$(inherited)", 529 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 530 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 531 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 532 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_4)", 533 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_5)", 534 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_6)", 535 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 536 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 537 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 538 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 539 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 540 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 541 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 542 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_14)", 543 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_15)", 544 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_2)", 545 | "$(LIBRARY_SEARCH_PATHS_QUOTED_1)", 546 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_3)", 547 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_7)", 548 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_8)", 549 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_9)", 550 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_10)", 551 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_11)", 552 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_12)", 553 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_13)", 554 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_16)", 555 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_17)", 556 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_18)", 557 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_19)", 558 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_20)", 559 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_21)", 560 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_22)", 561 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_23)", 562 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_24)", 563 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_25)", 564 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_26)", 565 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_27)", 566 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_28)", 567 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_29)", 568 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_30)", 569 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_31)", 570 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_32)", 571 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_33)", 572 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_34)", 573 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_35)", 574 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_36)", 575 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_37)", 576 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_38)", 577 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_39)", 578 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_40)", 579 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_41)", 580 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_42)", 581 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_43)", 582 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_44)", 583 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_45)", 584 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_46)", 585 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_47)", 586 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_48)", 587 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_49)", 588 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_50)", 589 | "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_51)", 590 | ); 591 | PRODUCT_NAME = example; 592 | WRAPPER_EXTENSION = app; 593 | }; 594 | name = Release; 595 | }; 596 | /* End XCBuildConfiguration section */ 597 | 598 | /* Begin XCConfigurationList section */ 599 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example" */ = { 600 | isa = XCConfigurationList; 601 | buildConfigurations = ( 602 | E4B69B4E0A3A1720003C02F2 /* Debug */, 603 | E4B69B4F0A3A1720003C02F2 /* Release */, 604 | ); 605 | defaultConfigurationIsVisible = 0; 606 | defaultConfigurationName = Release; 607 | }; 608 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example" */ = { 609 | isa = XCConfigurationList; 610 | buildConfigurations = ( 611 | E4B69B600A3A1757003C02F2 /* Debug */, 612 | E4B69B610A3A1757003C02F2 /* Release */, 613 | ); 614 | defaultConfigurationIsVisible = 0; 615 | defaultConfigurationName = Release; 616 | }; 617 | /* End XCConfigurationList section */ 618 | }; 619 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 620 | } 621 | -------------------------------------------------------------------------------- /example/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.openFrameworks 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | 3 | #include "ofxISF.h" 4 | 5 | class ofApp : public ofBaseApp 6 | { 7 | public: 8 | 9 | ofxISF::Shader isf; 10 | ofVideoGrabber video; 11 | 12 | void setup() 13 | { 14 | ofSetFrameRate(60); 15 | ofSetVerticalSync(true); 16 | ofBackground(0); 17 | 18 | video.initGrabber(1280, 720); 19 | 20 | isf.setup(1280, 720, GL_RGB32F); 21 | isf.load("isf-test.fs"); 22 | 23 | isf.setImage("inputImage", video.getTextureReference()); 24 | } 25 | 26 | void update() 27 | { 28 | video.update(); 29 | 30 | float t = ofGetElapsedTimef() * 2; 31 | isf.setParam("blurAmount", ofNoise(1, 0, 0, t) * 1.5); 32 | 33 | isf.update(); 34 | } 35 | 36 | void draw() 37 | { 38 | isf.draw(0, 0); 39 | } 40 | 41 | void keyPressed(int key) 42 | { 43 | isf.load("isf-test.fs"); 44 | } 45 | 46 | void keyReleased(int key) 47 | { 48 | 49 | } 50 | 51 | void mouseMoved(int x, int y) 52 | { 53 | } 54 | 55 | void mouseDragged(int x, int y, int button) 56 | { 57 | } 58 | 59 | void mousePressed(int x, int y, int button) 60 | { 61 | } 62 | 63 | void mouseReleased(int x, int y, int button) 64 | { 65 | } 66 | 67 | void windowResized(int w, int h) 68 | { 69 | } 70 | }; 71 | 72 | int main(int argc, const char** argv) 73 | { 74 | ofSetupOpenGL(1280, 720, OF_WINDOW); 75 | ofRunApp(new ofApp); 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /libs/jsonxx/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 Hong Jiang 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /libs/jsonxx/jsonxx.cc: -------------------------------------------------------------------------------- 1 | // -*- mode: c++; c-basic-offset: 4; -*- 2 | 3 | // Author: Hong Jiang 4 | // Contributors: 5 | // Sean Middleditch 6 | // rlyeh 7 | 8 | #include "jsonxx.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | // Snippet that creates an assertion function that works both in DEBUG & RELEASE mode. 18 | // JSONXX_ASSERT(...) macro will redirect to this. assert() macro is kept untouched. 19 | #if defined(NDEBUG) || defined(_NDEBUG) 20 | # define JSONXX_REENABLE_NDEBUG 21 | # undef NDEBUG 22 | # undef _NDEBUG 23 | #endif 24 | #include 25 | #include 26 | void jsonxx::assertion( const char *file, int line, const char *expression, bool result ) { 27 | if( !result ) { 28 | fprintf( stderr, "[JSONXX] expression '%s' failed at %s:%d -> ", expression, file, line ); 29 | assert( 0 ); 30 | } 31 | } 32 | #if defined(JSONXX_REENABLE_NDEBUG) 33 | # define NDEBUG 34 | # define _NDEBUG 35 | #endif 36 | #include 37 | 38 | namespace jsonxx { 39 | 40 | //static_assert( sizeof(unsigned long long) < sizeof(long double), "'long double' cannot hold 64bit values in this compiler :("); 41 | 42 | bool match(const char* pattern, std::istream& input); 43 | bool parse_array(std::istream& input, Array& array); 44 | bool parse_bool(std::istream& input, Boolean& value); 45 | bool parse_comment(std::istream &input); 46 | bool parse_null(std::istream& input); 47 | bool parse_number(std::istream& input, Number& value); 48 | bool parse_object(std::istream& input, Object& object); 49 | bool parse_string(std::istream& input, String& value); 50 | bool parse_identifier(std::istream& input, String& value); 51 | bool parse_value(std::istream& input, Value& value); 52 | 53 | // Try to consume characters from the input stream and match the 54 | // pattern string. 55 | bool match(const char* pattern, std::istream& input) { 56 | input >> std::ws; 57 | const char* cur(pattern); 58 | char ch(0); 59 | while(input && !input.eof() && *cur != 0) { 60 | input.get(ch); 61 | if (ch != *cur) { 62 | input.putback(ch); 63 | if( parse_comment(input) ) 64 | continue; 65 | while (cur > pattern) { 66 | cur--; 67 | input.putback(*cur); 68 | } 69 | return false; 70 | } else { 71 | cur++; 72 | } 73 | } 74 | return *cur == 0; 75 | } 76 | 77 | bool parse_string(std::istream& input, String& value) { 78 | char ch = '\0', delimiter = '"'; 79 | if (!match("\"", input)) { 80 | if (Parser == Strict) { 81 | return false; 82 | } 83 | delimiter = '\''; 84 | if (input.peek() != delimiter) { 85 | return false; 86 | } 87 | input.get(ch); 88 | } 89 | while(!input.eof() && input.good()) { 90 | input.get(ch); 91 | if (ch == delimiter) { 92 | break; 93 | } 94 | if (ch == '\\') { 95 | input.get(ch); 96 | switch(ch) { 97 | case '\\': 98 | case '/': 99 | value.push_back(ch); 100 | break; 101 | case 'b': 102 | value.push_back('\b'); 103 | break; 104 | case 'f': 105 | value.push_back('\f'); 106 | break; 107 | case 'n': 108 | value.push_back('\n'); 109 | break; 110 | case 'r': 111 | value.push_back('\r'); 112 | break; 113 | case 't': 114 | value.push_back('\t'); 115 | break; 116 | case 'u': { 117 | int i; 118 | std::stringstream ss; 119 | for( i = 0; (!input.eof() && input.good()) && i < 4; ++i ) { 120 | input.get(ch); 121 | ss << ch; 122 | } 123 | if( input.good() && (ss >> i) ) 124 | value.push_back(i); 125 | } 126 | break; 127 | default: 128 | if (ch != delimiter) { 129 | value.push_back('\\'); 130 | value.push_back(ch); 131 | } else value.push_back(ch); 132 | break; 133 | } 134 | } else { 135 | value.push_back(ch); 136 | } 137 | } 138 | if (input && ch == delimiter) { 139 | return true; 140 | } else { 141 | return false; 142 | } 143 | } 144 | 145 | bool parse_identifier(std::istream& input, String& value) { 146 | input >> std::ws; 147 | 148 | char ch = '\0', delimiter = ':'; 149 | bool first = true; 150 | 151 | while(!input.eof() && input.good()) { 152 | input.get(ch); 153 | 154 | if (ch == delimiter) { 155 | input.unget(); 156 | break; 157 | } 158 | 159 | if(first) { 160 | if ((ch != '_' && ch != '$') && 161 | (ch < 'a' || ch > 'z') && 162 | (ch < 'A' || ch > 'Z')) { 163 | return false; 164 | } 165 | first = false; 166 | } 167 | if(ch == '_' || ch == '$' || 168 | (ch >= 'a' && ch <= 'z') || 169 | (ch >= 'A' && ch <= 'Z') || 170 | (ch >= '0' && ch <= '9')) { 171 | value.push_back(ch); 172 | } 173 | else if(ch == '\t' || ch == ' ') { 174 | input >> std::ws; 175 | } 176 | } 177 | if (input && ch == delimiter) { 178 | return true; 179 | } else { 180 | return false; 181 | } 182 | } 183 | 184 | bool parse_number(std::istream& input, Number& value) { 185 | input >> std::ws; 186 | input >> value; 187 | if (input.fail()) { 188 | input.clear(); 189 | return false; 190 | } 191 | return true; 192 | } 193 | 194 | bool parse_bool(std::istream& input, Boolean& value) { 195 | if (match("true", input)) { 196 | value = true; 197 | return true; 198 | } 199 | if (match("false", input)) { 200 | value = false; 201 | return true; 202 | } 203 | return false; 204 | } 205 | 206 | bool parse_null(std::istream& input) { 207 | if (match("null", input)) { 208 | return true; 209 | } 210 | if (Parser == Strict) { 211 | return false; 212 | } 213 | return (input.peek()==','); 214 | } 215 | 216 | bool parse_array(std::istream& input, Array& array) { 217 | return array.parse(input); 218 | } 219 | 220 | bool parse_object(std::istream& input, Object& object) { 221 | return object.parse(input); 222 | } 223 | 224 | bool parse_comment(std::istream &input) { 225 | if( Parser == Permissive ) 226 | if( !input.eof() && input.peek() == '/' ) 227 | { 228 | char ch0(0); 229 | input.get(ch0); 230 | 231 | if( !input.eof() ) 232 | { 233 | char ch1(0); 234 | input.get(ch1); 235 | 236 | if( ch0 == '/' && ch1 == '/' ) 237 | { 238 | // trim chars till \r or \n 239 | for( char ch(0); !input.eof() && (input.peek() != '\r' && input.peek() != '\n'); ) 240 | input.get(ch); 241 | 242 | // consume spaces, tabs, \r or \n, in case no eof is found 243 | if( !input.eof() ) 244 | input >> std::ws; 245 | return true; 246 | } 247 | 248 | input.unget(); 249 | input.clear(); 250 | } 251 | 252 | input.unget(); 253 | input.clear(); 254 | } 255 | 256 | return false; 257 | } 258 | 259 | bool parse_value(std::istream& input, Value& value) { 260 | return value.parse(input); 261 | } 262 | 263 | 264 | Object::Object() : value_map_() {} 265 | 266 | Object::~Object() { 267 | reset(); 268 | } 269 | 270 | bool Object::parse(std::istream& input, Object& object) { 271 | object.reset(); 272 | 273 | if (!match("{", input)) { 274 | return false; 275 | } 276 | if (match("}", input)) { 277 | return true; 278 | } 279 | 280 | do { 281 | std::string key; 282 | if(UnquotedKeys == Enabled) { 283 | if (!parse_identifier(input, key)) { 284 | if (Parser == Permissive) { 285 | if (input.peek() == '}') 286 | break; 287 | } 288 | return false; 289 | } 290 | } 291 | else { 292 | if (!parse_string(input, key)) { 293 | if (Parser == Permissive) { 294 | if (input.peek() == '}') 295 | break; 296 | } 297 | return false; 298 | } 299 | } 300 | if (!match(":", input)) { 301 | return false; 302 | } 303 | Value* v = new Value(); 304 | if (!parse_value(input, *v)) { 305 | delete v; 306 | break; 307 | } 308 | object.value_map_[key] = v; 309 | } while (match(",", input)); 310 | 311 | 312 | if (!match("}", input)) { 313 | return false; 314 | } 315 | 316 | return true; 317 | } 318 | 319 | Value::Value() : type_(INVALID_) {} 320 | 321 | void Value::reset() { 322 | if (type_ == STRING_) { 323 | delete string_value_; 324 | string_value_ = 0; 325 | } 326 | else if (type_ == OBJECT_) { 327 | delete object_value_; 328 | object_value_ = 0; 329 | } 330 | else if (type_ == ARRAY_) { 331 | delete array_value_; 332 | array_value_ = 0; 333 | } 334 | } 335 | 336 | bool Value::parse(std::istream& input, Value& value) { 337 | value.reset(); 338 | 339 | std::string string_value; 340 | if (parse_string(input, string_value)) { 341 | value.string_value_ = new std::string(); 342 | value.string_value_->swap(string_value); 343 | value.type_ = STRING_; 344 | return true; 345 | } 346 | if (parse_number(input, value.number_value_)) { 347 | value.type_ = NUMBER_; 348 | return true; 349 | } 350 | 351 | if (parse_bool(input, value.bool_value_)) { 352 | value.type_ = BOOL_; 353 | return true; 354 | } 355 | if (parse_null(input)) { 356 | value.type_ = NULL_; 357 | return true; 358 | } 359 | if (input.peek() == '[') { 360 | value.array_value_ = new Array(); 361 | if (parse_array(input, *value.array_value_)) { 362 | value.type_ = ARRAY_; 363 | return true; 364 | } 365 | delete value.array_value_; 366 | } 367 | value.object_value_ = new Object(); 368 | if (parse_object(input, *value.object_value_)) { 369 | value.type_ = OBJECT_; 370 | return true; 371 | } 372 | delete value.object_value_; 373 | return false; 374 | } 375 | 376 | Array::Array() : values_() {} 377 | 378 | Array::~Array() { 379 | reset(); 380 | } 381 | 382 | bool Array::parse(std::istream& input, Array& array) { 383 | array.reset(); 384 | 385 | if (!match("[", input)) { 386 | return false; 387 | } 388 | if (match("]", input)) { 389 | return true; 390 | } 391 | 392 | do { 393 | Value* v = new Value(); 394 | if (!parse_value(input, *v)) { 395 | delete v; 396 | break; 397 | } 398 | array.values_.push_back(v); 399 | } while (match(",", input)); 400 | 401 | if (!match("]", input)) { 402 | return false; 403 | } 404 | return true; 405 | } 406 | 407 | static std::ostream& stream_string(std::ostream& stream, 408 | const std::string& string) { 409 | stream << '"'; 410 | for (std::string::const_iterator i = string.begin(), 411 | e = string.end(); i != e; ++i) { 412 | switch (*i) { 413 | case '"': 414 | stream << "\\\""; 415 | break; 416 | case '\\': 417 | stream << "\\\\"; 418 | break; 419 | case '/': 420 | stream << "\\/"; 421 | break; 422 | case '\b': 423 | stream << "\\b"; 424 | break; 425 | case '\f': 426 | stream << "\\f"; 427 | break; 428 | case '\n': 429 | stream << "\\n"; 430 | break; 431 | case '\r': 432 | stream << "\\r"; 433 | break; 434 | case '\t': 435 | stream << "\\t"; 436 | break; 437 | default: 438 | if (*i < 32) { 439 | stream << "\\u" << std::hex << std::setw(4) << 440 | std::setfill('0') << static_cast(*i) << std::dec << 441 | std::setw(0); 442 | } else { 443 | stream << *i; 444 | } 445 | } 446 | } 447 | stream << '"'; 448 | return stream; 449 | } 450 | 451 | } // namespace jsonxx 452 | 453 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Value& v) { 454 | using namespace jsonxx; 455 | if (v.is()) { 456 | return stream << v.get(); 457 | } else if (v.is()) { 458 | return stream_string(stream, v.get()); 459 | } else if (v.is()) { 460 | if (v.get()) { 461 | return stream << "true"; 462 | } else { 463 | return stream << "false"; 464 | } 465 | } else if (v.is()) { 466 | return stream << "null"; 467 | } else if (v.is()) { 468 | return stream << v.get(); 469 | } else if (v.is()){ 470 | return stream << v.get(); 471 | } 472 | // Shouldn't reach here. 473 | return stream; 474 | } 475 | 476 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Array& v) { 477 | stream << "["; 478 | jsonxx::Array::container::const_iterator 479 | it = v.values().begin(), 480 | end = v.values().end(); 481 | while (it != end) { 482 | stream << *(*it); 483 | ++it; 484 | if (it != end) { 485 | stream << ", "; 486 | } 487 | } 488 | return stream << "]"; 489 | } 490 | 491 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Object& v) { 492 | stream << "{"; 493 | jsonxx::Object::container::const_iterator 494 | it = v.kv_map().begin(), 495 | end = v.kv_map().end(); 496 | while (it != end) { 497 | jsonxx::stream_string(stream, it->first); 498 | stream << ": " << *(it->second); 499 | ++it; 500 | if (it != end) { 501 | stream << ", "; 502 | } 503 | } 504 | return stream << "}"; 505 | } 506 | 507 | 508 | namespace jsonxx { 509 | namespace { 510 | 511 | typedef unsigned char byte; 512 | 513 | //template 514 | std::string escape_string( const std::string &input, const bool quote = false ) { 515 | static std::string map[256], *once = 0; 516 | if( !once ) { 517 | // base 518 | for( int i = 0; i < 256; ++i ) { 519 | map[ i ] = std::string() + char(i); 520 | } 521 | // non-printable 522 | for( int i = 0; i < 32; ++i ) { 523 | std::stringstream str; 524 | str << "\\u" << std::hex << std::setw(4) << std::setfill('0') << i; 525 | map[ i ] = str.str(); 526 | } 527 | // exceptions 528 | map[ byte('"') ] = "\\\""; 529 | map[ byte('\\') ] = "\\\\"; 530 | map[ byte('/') ] = "\\/"; 531 | map[ byte('\b') ] = "\\b"; 532 | map[ byte('\f') ] = "\\f"; 533 | map[ byte('\n') ] = "\\n"; 534 | map[ byte('\r') ] = "\\r"; 535 | map[ byte('\t') ] = "\\t"; 536 | 537 | once = map; 538 | } 539 | std::string output; 540 | output.reserve( input.size() * 2 + 2 ); // worst scenario 541 | if( quote ) output += '"'; 542 | for( std::string::const_iterator it = input.begin(), end = input.end(); it != end; ++it ) 543 | output += map[ byte(*it) ]; 544 | if( quote ) output += '"'; 545 | return output; 546 | } 547 | 548 | 549 | namespace json { 550 | 551 | std::string remove_last_comma( const std::string &_input ) { 552 | std::string input( _input ); 553 | size_t size = input.size(); 554 | if( size > 2 ) 555 | if( input[ size - 2 ] == ',' ) 556 | input[ size - 2 ] = ' '; 557 | return input; 558 | } 559 | 560 | std::string tag( unsigned format, unsigned depth, const std::string &name, const jsonxx::Value &t) { 561 | std::stringstream ss; 562 | const std::string tab(depth, '\t'); 563 | 564 | if( !name.empty() ) 565 | ss << tab << '\"' << escape_string( name ) << '\"' << ':' << ' '; 566 | else 567 | ss << tab; 568 | 569 | switch( t.type_ ) 570 | { 571 | default: 572 | case jsonxx::Value::NULL_: 573 | ss << "null"; 574 | return ss.str() + ",\n"; 575 | 576 | case jsonxx::Value::BOOL_: 577 | ss << ( t.bool_value_ ? "true" : "false" ); 578 | return ss.str() + ",\n"; 579 | 580 | case jsonxx::Value::ARRAY_: 581 | ss << "[\n"; 582 | for(Array::container::const_iterator it = t.array_value_->values().begin(), 583 | end = t.array_value_->values().end(); it != end; ++it ) 584 | ss << tag( format, depth+1, std::string(), **it ); 585 | return remove_last_comma( ss.str() ) + tab + "]" ",\n"; 586 | 587 | case jsonxx::Value::STRING_: 588 | ss << '\"' << escape_string( *t.string_value_ ) << '\"'; 589 | return ss.str() + ",\n"; 590 | 591 | case jsonxx::Value::OBJECT_: 592 | ss << "{\n"; 593 | for(Object::container::const_iterator it=t.object_value_->kv_map().begin(), 594 | end = t.object_value_->kv_map().end(); it != end ; ++it) 595 | ss << tag( format, depth+1, it->first, *it->second ); 596 | return remove_last_comma( ss.str() ) + tab + "}" ",\n"; 597 | 598 | case jsonxx::Value::NUMBER_: 599 | // max precision 600 | ss << std::setprecision(std::numeric_limits::digits10 + 1); 601 | ss << t.number_value_; 602 | return ss.str() + ",\n"; 603 | } 604 | } 605 | } // namespace jsonxx::anon::json 606 | 607 | namespace xml { 608 | 609 | std::string escape_attrib( const std::string &input ) { 610 | static std::string map[256], *once = 0; 611 | if( !once ) { 612 | for( int i = 0; i < 256; ++i ) 613 | map[ i ] = "_"; 614 | for( int i = int('a'); i <= int('z'); ++i ) 615 | map[ i ] = std::string() + char(i); 616 | for( int i = int('A'); i <= int('Z'); ++i ) 617 | map[ i ] = std::string() + char(i); 618 | for( int i = int('0'); i <= int('9'); ++i ) 619 | map[ i ] = std::string() + char(i); 620 | once = map; 621 | } 622 | std::string output; 623 | output.reserve( input.size() ); // worst scenario 624 | for( std::string::const_iterator it = input.begin(), end = input.end(); it != end; ++it ) 625 | output += map[ byte(*it) ]; 626 | return output; 627 | } 628 | 629 | std::string escape_tag( const std::string &input, unsigned format ) { 630 | static std::string map[256], *once = 0; 631 | if( !once ) { 632 | for( int i = 0; i < 256; ++i ) 633 | map[ i ] = std::string() + char(i); 634 | map[ byte('<') ] = "<"; 635 | map[ byte('>') ] = ">"; 636 | 637 | switch( format ) 638 | { 639 | default: 640 | break; 641 | 642 | case jsonxx::JXML: 643 | case jsonxx::JXMLex: 644 | case jsonxx::JSONx: 645 | case jsonxx::TaggedXML: 646 | map[ byte('&') ] = "&"; 647 | break; 648 | } 649 | 650 | once = map; 651 | } 652 | std::string output; 653 | output.reserve( input.size() * 5 ); // worst scenario 654 | for( std::string::const_iterator it = input.begin(), end = input.end(); it != end; ++it ) 655 | output += map[ byte(*it) ]; 656 | return output; 657 | } 658 | 659 | std::string open_tag( unsigned format, char type, const std::string &name, const std::string &attr = std::string(), const std::string &text = std::string() ) { 660 | std::string tagname; 661 | switch( format ) 662 | { 663 | default: 664 | return std::string(); 665 | 666 | case jsonxx::JXML: 667 | if( name.empty() ) 668 | tagname = std::string("j son=\"") + type + '\"'; 669 | else 670 | tagname = std::string("j son=\"") + type + ':' + escape_string(name) + '\"'; 671 | break; 672 | 673 | case jsonxx::JXMLex: 674 | if( name.empty() ) 675 | tagname = std::string("j son=\"") + type + '\"'; 676 | else 677 | tagname = std::string("j son=\"") + type + ':' + escape_string(name) + "\" " + escape_attrib(name) + "=\"" + escape_string(text) + "\""; 678 | break; 679 | 680 | case jsonxx::JSONx: 681 | if( !name.empty() ) 682 | tagname = std::string(" name=\"") + escape_string(name) + "\""; 683 | switch( type ) { 684 | default: 685 | case '0': tagname = "json:null" + tagname; break; 686 | case 'b': tagname = "json:boolean" + tagname; break; 687 | case 'a': tagname = "json:array" + tagname; break; 688 | case 's': tagname = "json:string" + tagname; break; 689 | case 'o': tagname = "json:object" + tagname; break; 690 | case 'n': tagname = "json:number" + tagname; break; 691 | } 692 | break; 693 | 694 | case jsonxx::TaggedXML: // @TheMadButcher 695 | if( !name.empty() ) 696 | tagname = escape_attrib(name); 697 | else 698 | tagname = "JsonItem"; 699 | switch( type ) { 700 | default: 701 | case '0': tagname += " type=\"json:null\""; break; 702 | case 'b': tagname += " type=\"json:boolean\""; break; 703 | case 'a': tagname += " type=\"json:array\""; break; 704 | case 's': tagname += " type=\"json:string\""; break; 705 | case 'o': tagname += " type=\"json:object\""; break; 706 | case 'n': tagname += " type=\"json:number\""; break; 707 | } 708 | 709 | if( !name.empty() ) 710 | tagname += std::string(" name=\"") + escape_string(name) + "\""; 711 | 712 | break; 713 | } 714 | 715 | return std::string("<") + tagname + attr + ">"; 716 | } 717 | 718 | std::string close_tag( unsigned format, char type, const std::string &name ) { 719 | switch( format ) 720 | { 721 | default: 722 | return std::string(); 723 | 724 | case jsonxx::JXML: 725 | case jsonxx::JXMLex: 726 | return ""; 727 | 728 | case jsonxx::JSONx: 729 | switch( type ) { 730 | default: 731 | case '0': return ""; 732 | case 'b': return ""; 733 | case 'a': return ""; 734 | case 'o': return ""; 735 | case 's': return ""; 736 | case 'n': return ""; 737 | } 738 | break; 739 | 740 | case jsonxx::TaggedXML: // @TheMadButcher 741 | if( !name.empty() ) 742 | return ""; 743 | else 744 | return ""; 745 | } 746 | } 747 | 748 | std::string tag( unsigned format, unsigned depth, const std::string &name, const jsonxx::Value &t, const std::string &attr = std::string() ) { 749 | std::stringstream ss; 750 | const std::string tab(depth, '\t'); 751 | 752 | switch( t.type_ ) 753 | { 754 | default: 755 | case jsonxx::Value::NULL_: 756 | return tab + open_tag( format, '0', name, " /" ) + '\n'; 757 | 758 | case jsonxx::Value::BOOL_: 759 | ss << ( t.bool_value_ ? "true" : "false" ); 760 | return tab + open_tag( format, 'b', name, std::string(), format == jsonxx::JXMLex ? ss.str() : std::string() ) 761 | + ss.str() 762 | + close_tag( format, 'b', name ) + '\n'; 763 | 764 | case jsonxx::Value::ARRAY_: 765 | for(Array::container::const_iterator it = t.array_value_->values().begin(), 766 | end = t.array_value_->values().end(); it != end; ++it ) 767 | ss << tag( format, depth+1, std::string(), **it ); 768 | return tab + open_tag( format, 'a', name, attr ) + '\n' 769 | + ss.str() 770 | + tab + close_tag( format, 'a', name ) + '\n'; 771 | 772 | case jsonxx::Value::STRING_: 773 | ss << escape_tag( *t.string_value_, format ); 774 | return tab + open_tag( format, 's', name, std::string(), format == jsonxx::JXMLex ? ss.str() : std::string() ) 775 | + ss.str() 776 | + close_tag( format, 's', name ) + '\n'; 777 | 778 | case jsonxx::Value::OBJECT_: 779 | for(Object::container::const_iterator it=t.object_value_->kv_map().begin(), 780 | end = t.object_value_->kv_map().end(); it != end ; ++it) 781 | ss << tag( format, depth+1, it->first, *it->second ); 782 | return tab + open_tag( format, 'o', name, attr ) + '\n' 783 | + ss.str() 784 | + tab + close_tag( format, 'o', name ) + '\n'; 785 | 786 | case jsonxx::Value::NUMBER_: 787 | // max precision 788 | ss << std::setprecision(std::numeric_limits::digits10 + 1); 789 | ss << t.number_value_; 790 | return tab + open_tag( format, 'n', name, std::string(), format == jsonxx::JXMLex ? ss.str() : std::string() ) 791 | + ss.str() 792 | + close_tag( format, 'n', name ) + '\n'; 793 | } 794 | } 795 | 796 | // order here matches jsonxx::Format enum 797 | const char *defheader[] = { 798 | "", 799 | 800 | "" 801 | JSONXX_XML_TAG "\n", 802 | 803 | "" 804 | JSONXX_XML_TAG "\n", 805 | 806 | "" 807 | JSONXX_XML_TAG "\n", 808 | 809 | "" 810 | JSONXX_XML_TAG "\n" 811 | }; 812 | 813 | // order here matches jsonxx::Format enum 814 | const char *defrootattrib[] = { 815 | "", 816 | 817 | " xsi:schemaLocation=\"http://www.datapower.com/schemas/json jsonx.xsd\"" 818 | " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" 819 | " xmlns:json=\"http://www.ibm.com/xmlns/prod/2009/jsonx\"", 820 | 821 | "", 822 | 823 | "", 824 | 825 | "" 826 | }; 827 | 828 | } // namespace jsonxx::anon::xml 829 | 830 | } // namespace jsonxx::anon 831 | 832 | std::string Object::json() const { 833 | using namespace json; 834 | 835 | jsonxx::Value v; 836 | v.object_value_ = const_cast(this); 837 | v.type_ = jsonxx::Value::OBJECT_; 838 | 839 | std::string result = tag( jsonxx::JSON, 0, std::string(), v ); 840 | 841 | v.object_value_ = 0; 842 | return remove_last_comma( result ); 843 | } 844 | 845 | std::string Object::xml( unsigned format, const std::string &header, const std::string &attrib ) const { 846 | using namespace xml; 847 | JSONXX_ASSERT( format == jsonxx::JSONx || format == jsonxx::JXML || format == jsonxx::JXMLex || format == jsonxx::TaggedXML ); 848 | 849 | jsonxx::Value v; 850 | v.object_value_ = const_cast(this); 851 | v.type_ = jsonxx::Value::OBJECT_; 852 | 853 | std::string result = tag( format, 0, std::string(), v, attrib.empty() ? std::string(defrootattrib[format]) : attrib ); 854 | 855 | v.object_value_ = 0; 856 | return ( header.empty() ? std::string(defheader[format]) : header ) + result; 857 | } 858 | 859 | std::string Array::json() const { 860 | using namespace json; 861 | 862 | jsonxx::Value v; 863 | v.array_value_ = const_cast(this); 864 | v.type_ = jsonxx::Value::ARRAY_; 865 | 866 | std::string result = tag( jsonxx::JSON, 0, std::string(), v ); 867 | 868 | v.array_value_ = 0; 869 | return remove_last_comma( result ); 870 | } 871 | 872 | std::string Array::xml( unsigned format, const std::string &header, const std::string &attrib ) const { 873 | using namespace xml; 874 | JSONXX_ASSERT( format == jsonxx::JSONx || format == jsonxx::JXML || format == jsonxx::JXMLex || format == jsonxx::TaggedXML ); 875 | 876 | jsonxx::Value v; 877 | v.array_value_ = const_cast(this); 878 | v.type_ = jsonxx::Value::ARRAY_; 879 | 880 | std::string result = tag( format, 0, std::string(), v, attrib.empty() ? std::string(defrootattrib[format]) : attrib ); 881 | 882 | v.array_value_ = 0; 883 | return ( header.empty() ? std::string(defheader[format]) : header ) + result; 884 | } 885 | 886 | bool validate( std::istream &input ) { 887 | 888 | // trim non-printable chars 889 | for( char ch(0); !input.eof() && input.peek() <= 32; ) 890 | input.get(ch); 891 | 892 | // validate json 893 | if( input.peek() == '{' ) 894 | { 895 | jsonxx::Object o; 896 | if( parse_object( input, o ) ) 897 | return true; 898 | } 899 | else 900 | if( input.peek() == '[' ) 901 | { 902 | jsonxx::Array a; 903 | if( parse_array( input, a ) ) 904 | return true; 905 | } 906 | 907 | // bad json input 908 | return false; 909 | } 910 | 911 | bool validate( const std::string &input ) { 912 | std::istringstream is( input ); 913 | return jsonxx::validate( is ); 914 | } 915 | 916 | std::string reformat( std::istream &input ) { 917 | 918 | // trim non-printable chars 919 | for( char ch(0); !input.eof() && input.peek() <= 32; ) 920 | input.get(ch); 921 | 922 | // validate json 923 | if( input.peek() == '{' ) 924 | { 925 | jsonxx::Object o; 926 | if( parse_object( input, o ) ) 927 | return o.json(); 928 | } 929 | else 930 | if( input.peek() == '[' ) 931 | { 932 | jsonxx::Array a; 933 | if( parse_array( input, a ) ) 934 | return a.json(); 935 | } 936 | 937 | // bad json input 938 | return std::string(); 939 | } 940 | 941 | std::string reformat( const std::string &input ) { 942 | std::istringstream is( input ); 943 | return jsonxx::reformat( is ); 944 | } 945 | 946 | std::string xml( std::istream &input, unsigned format ) { 947 | using namespace xml; 948 | JSONXX_ASSERT( format == jsonxx::JSONx || format == jsonxx::JXML || format == jsonxx::JXMLex || format == jsonxx::TaggedXML ); 949 | 950 | // trim non-printable chars 951 | for( char ch(0); !input.eof() && input.peek() <= 32; ) 952 | input.get(ch); 953 | 954 | // validate json, then transform 955 | if( input.peek() == '{' ) 956 | { 957 | jsonxx::Object o; 958 | if( parse_object( input, o ) ) 959 | return o.xml(format); 960 | } 961 | else 962 | if( input.peek() == '[' ) 963 | { 964 | jsonxx::Array a; 965 | if( parse_array( input, a ) ) 966 | return a.xml(format); 967 | } 968 | 969 | // bad json, return empty xml 970 | return defheader[format]; 971 | } 972 | 973 | std::string xml( const std::string &input, unsigned format ) { 974 | std::istringstream is( input ); 975 | return jsonxx::xml( is, format ); 976 | } 977 | 978 | 979 | Object::Object(const Object &other) { 980 | import(other); 981 | } 982 | Object::Object(const std::string &key, const Value &value) { 983 | import(key,value); 984 | } 985 | void Object::import( const Object &other ) { 986 | odd.clear(); 987 | if (this != &other) { 988 | // default 989 | container::const_iterator 990 | it = other.value_map_.begin(), 991 | end = other.value_map_.end(); 992 | for (/**/ ; it != end ; ++it) { 993 | container::iterator found = value_map_.find(it->first); 994 | if( found != value_map_.end() ) { 995 | delete found->second; 996 | } 997 | value_map_[ it->first ] = new Value( *it->second ); 998 | } 999 | } else { 1000 | // recursion is supported here 1001 | import( Object(*this) ); 1002 | } 1003 | } 1004 | void Object::import( const std::string &key, const Value &value ) { 1005 | odd.clear(); 1006 | container::iterator found = value_map_.find(key); 1007 | if( found != value_map_.end() ) { 1008 | delete found->second; 1009 | } 1010 | value_map_[ key ] = new Value( value ); 1011 | } 1012 | Object &Object::operator=(const Object &other) { 1013 | odd.clear(); 1014 | if (this != &other) { 1015 | reset(); 1016 | import(other); 1017 | } 1018 | return *this; 1019 | } 1020 | Object &Object::operator<<(const Value &value) { 1021 | if (odd.empty()) { 1022 | odd = value.get(); 1023 | } else { 1024 | import( Object(odd, value) ); 1025 | odd.clear(); 1026 | } 1027 | return *this; 1028 | } 1029 | Object &Object::operator<<(const Object &value) { 1030 | import( std::string(odd),value); 1031 | odd.clear(); 1032 | return *this; 1033 | } 1034 | size_t Object::size() const { 1035 | return value_map_.size(); 1036 | } 1037 | bool Object::empty() const { 1038 | return value_map_.size() == 0; 1039 | } 1040 | const std::map &Object::kv_map() const { 1041 | return value_map_; 1042 | } 1043 | std::string Object::write( unsigned format ) const { 1044 | return format == JSON ? json() : xml(format); 1045 | } 1046 | void Object::reset() { 1047 | container::iterator i; 1048 | for (i = value_map_.begin(); i != value_map_.end(); ++i) { 1049 | delete i->second; 1050 | } 1051 | value_map_.clear(); 1052 | } 1053 | bool Object::parse(std::istream &input) { 1054 | return parse(input,*this); 1055 | } 1056 | bool Object::parse(const std::string &input) { 1057 | std::istringstream is( input ); 1058 | return parse(is,*this); 1059 | } 1060 | 1061 | 1062 | Array::Array(const Array &other) { 1063 | import(other); 1064 | } 1065 | Array::Array(const Value &value) { 1066 | import(value); 1067 | } 1068 | void Array::import(const Array &other) { 1069 | if (this != &other) { 1070 | // default 1071 | container::const_iterator 1072 | it = other.values_.begin(), 1073 | end = other.values_.end(); 1074 | for (/**/ ; it != end; ++it) { 1075 | values_.push_back( new Value(**it) ); 1076 | } 1077 | } else { 1078 | // recursion is supported here 1079 | import( Array(*this) ); 1080 | } 1081 | } 1082 | void Array::import(const Value &value) { 1083 | values_.push_back( new Value(value) ); 1084 | } 1085 | size_t Array::size() const { 1086 | return values_.size(); 1087 | } 1088 | bool Array::empty() const { 1089 | return values_.size() == 0; 1090 | } 1091 | void Array::reset() { 1092 | for (container::iterator i = values_.begin(); i != values_.end(); ++i) { 1093 | delete *i; 1094 | } 1095 | values_.clear(); 1096 | } 1097 | bool Array::parse(std::istream &input) { 1098 | return parse(input,*this); 1099 | } 1100 | bool Array::parse(const std::string &input) { 1101 | std::istringstream is(input); 1102 | return parse(is,*this); 1103 | } 1104 | Array &Array::operator<<(const Array &other) { 1105 | import(other); 1106 | return *this; 1107 | } 1108 | Array &Array::operator<<(const Value &value) { 1109 | import(value); 1110 | return *this; 1111 | } 1112 | Array &Array::operator=(const Array &other) { 1113 | if( this != &other ) { 1114 | reset(); 1115 | import(other); 1116 | } 1117 | return *this; 1118 | } 1119 | Array &Array::operator=(const Value &value) { 1120 | reset(); 1121 | import(value); 1122 | return *this; 1123 | } 1124 | 1125 | Value::Value(const Value &other) : type_(INVALID_) { 1126 | import( other ); 1127 | } 1128 | bool Value::empty() const { 1129 | if( type_ == INVALID_ ) return true; 1130 | if( type_ == STRING_ && string_value_ == 0 ) return true; 1131 | if( type_ == ARRAY_ && array_value_ == 0 ) return true; 1132 | if( type_ == OBJECT_ && object_value_ == 0 ) return true; 1133 | return false; 1134 | } 1135 | bool Value::parse(std::istream &input) { 1136 | return parse(input,*this); 1137 | } 1138 | bool Value::parse(const std::string &input) { 1139 | std::istringstream is( input ); 1140 | return parse(is,*this); 1141 | } 1142 | 1143 | } // namespace jsonxx 1144 | -------------------------------------------------------------------------------- /libs/jsonxx/jsonxx.h: -------------------------------------------------------------------------------- 1 | // -*- mode: c++; c-basic-offset: 4; -*- 2 | 3 | // Author: Hong Jiang 4 | // Contributors: 5 | // Sean Middleditch 6 | // rlyeh 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | // jsonxx versioning: major.minor-extra where 18 | // major = { number } 19 | // minor = { number } 20 | // extra = { 'a':alpha, 'b':beta, 'rc': release candidate, 'r': release, 's':stable } 21 | #define JSONXX_MAJOR "0" 22 | #define JSONXX_MINOR "22" 23 | #define JSONXX_EXTRA "a" 24 | #define JSONXX_VERSION JSONXX_MAJOR "." JSONXX_MINOR "-" JSONXX_EXTRA 25 | #define JSONXX_XML_TAG "" 26 | 27 | #if __cplusplus > 199711L 28 | #define JSONXX_COMPILER_HAS_CXX11 1 29 | #elif defined(_MSC_VER) && _MSC_VER > 1700 30 | #define JSONXX_COMPILER_HAS_CXX11 1 31 | #else 32 | #define JSONXX_COMPILER_HAS_CXX11 0 33 | #endif 34 | 35 | #define JSONXX_ASSERT(...) do { if( jsonxx::Assertions ) \ 36 | jsonxx::assertion(__FILE__,__LINE__,#__VA_ARGS__,bool(__VA_ARGS__)); } while(0) 37 | 38 | namespace jsonxx { 39 | 40 | // Settings 41 | enum Settings { 42 | // constants 43 | Enabled = true, 44 | Disabled = false, 45 | Permissive = true, 46 | Strict = false, 47 | // values 48 | Parser = Permissive, // permissive or strict parsing 49 | UnquotedKeys = Disabled, // support of unquoted keys 50 | Assertions = Enabled // enabled or disabled assertions (these asserts work both in DEBUG and RELEASE builds) 51 | }; 52 | 53 | // Constants for .write() and .xml() methods 54 | enum Format { 55 | JSON = 0, // JSON output 56 | JSONx = 1, // XML output, JSONx format. see http://goo.gl/I3cxs 57 | JXML = 2, // XML output, JXML format. see https://github.com/r-lyeh/JXML 58 | JXMLex = 3, // XML output, JXMLex format. see https://github.com/r-lyeh/JXMLex 59 | TaggedXML = 4 // XML output, tagged XML format. see https://github.com/hjiang/jsonxx/issues/12 60 | }; 61 | 62 | // Types 63 | typedef long double Number; 64 | typedef bool Boolean; 65 | typedef std::string String; 66 | struct Null {}; 67 | class Value; 68 | class Object; 69 | class Array; 70 | 71 | // Identity meta-function 72 | template 73 | struct identity { 74 | typedef T type; 75 | }; 76 | 77 | // Tools 78 | bool validate( const std::string &input ); 79 | bool validate( std::istream &input ); 80 | std::string reformat( const std::string &input ); 81 | std::string reformat( std::istream &input ); 82 | std::string xml( const std::string &input, unsigned format = JSONx ); 83 | std::string xml( std::istream &input, unsigned format = JSONx ); 84 | 85 | // Detail 86 | void assertion( const char *file, int line, const char *expression, bool result ); 87 | 88 | // A JSON Object 89 | class Object { 90 | public: 91 | Object(); 92 | ~Object(); 93 | 94 | template 95 | bool has(const std::string& key) const; 96 | 97 | // Always call has<>() first. If the key doesn't exist, consider 98 | // the behavior undefined. 99 | template 100 | T& get(const std::string& key); 101 | template 102 | const T& get(const std::string& key) const; 103 | 104 | template 105 | const T& get(const std::string& key, const typename identity::type& default_value) const; 106 | 107 | size_t size() const; 108 | bool empty() const; 109 | 110 | const std::map& kv_map() const; 111 | std::string json() const; 112 | std::string xml( unsigned format = JSONx, const std::string &header = std::string(), const std::string &attrib = std::string() ) const; 113 | std::string write( unsigned format ) const; 114 | 115 | void reset(); 116 | bool parse(std::istream &input); 117 | bool parse(const std::string &input); 118 | typedef std::map container; 119 | void import( const Object &other ); 120 | void import( const std::string &key, const Value &value ); 121 | Object &operator<<(const Value &value); 122 | Object &operator<<(const Object &value); 123 | Object &operator=(const Object &value); 124 | Object(const Object &other); 125 | Object(const std::string &key, const Value &value); 126 | template 127 | Object(const char (&key)[N], const Value &value) { 128 | import(key,value); 129 | } 130 | template 131 | Object &operator<<(const T &value); 132 | 133 | protected: 134 | static bool parse(std::istream& input, Object& object); 135 | container value_map_; 136 | std::string odd; 137 | }; 138 | 139 | class Array { 140 | public: 141 | Array(); 142 | ~Array(); 143 | 144 | size_t size() const; 145 | bool empty() const; 146 | 147 | template 148 | bool has(unsigned int i) const; 149 | 150 | template 151 | T& get(unsigned int i); 152 | template 153 | const T& get(unsigned int i) const; 154 | 155 | template 156 | const T& get(unsigned int i, const typename identity::type& default_value) const; 157 | 158 | const std::vector& values() const { 159 | return values_; 160 | } 161 | std::string json() const; 162 | std::string xml( unsigned format = JSONx, const std::string &header = std::string(), const std::string &attrib = std::string() ) const; 163 | 164 | std::string write( unsigned format ) const { return format == JSON ? json() : xml(format); } 165 | void reset(); 166 | bool parse(std::istream &input); 167 | bool parse(const std::string &input); 168 | typedef std::vector container; 169 | void import(const Array &other); 170 | void import(const Value &value); 171 | Array &operator<<(const Array &other); 172 | Array &operator<<(const Value &value); 173 | Array &operator=(const Array &other); 174 | Array &operator=(const Value &value); 175 | Array(const Array &other); 176 | Array(const Value &value); 177 | protected: 178 | static bool parse(std::istream& input, Array& array); 179 | container values_; 180 | }; 181 | 182 | // A value could be a number, an array, a string, an object, a 183 | // boolean, or null 184 | class Value { 185 | public: 186 | 187 | Value(); 188 | ~Value() { reset(); } 189 | void reset(); 190 | 191 | template 192 | void import( const T & ) { 193 | reset(); 194 | type_ = INVALID_; 195 | // debug 196 | // std::cout << "[WARN] No support for " << typeid(t).name() << std::endl; 197 | } 198 | void import( const bool &b ) { 199 | reset(); 200 | type_ = BOOL_; 201 | bool_value_ = b; 202 | } 203 | #define $number(TYPE) \ 204 | void import( const TYPE &n ) { \ 205 | reset(); \ 206 | type_ = NUMBER_; \ 207 | number_value_ = n; \ 208 | } 209 | $number( char ) 210 | $number( int ) 211 | $number( long ) 212 | $number( long long ) 213 | $number( unsigned char ) 214 | $number( unsigned int ) 215 | $number( unsigned long ) 216 | $number( unsigned long long ) 217 | $number( float ) 218 | $number( double ) 219 | $number( long double ) 220 | #undef $number 221 | #if JSONXX_COMPILER_HAS_CXX11 > 0 222 | void import( const std::nullptr_t & ) { 223 | reset(); 224 | type_ = NULL_; 225 | } 226 | #endif 227 | void import( const Null & ) { 228 | reset(); 229 | type_ = NULL_; 230 | } 231 | void import( const String &s ) { 232 | reset(); 233 | type_ = STRING_; 234 | *( string_value_ = new String() ) = s; 235 | } 236 | void import( const Array &a ) { 237 | reset(); 238 | type_ = ARRAY_; 239 | *( array_value_ = new Array() ) = a; 240 | } 241 | void import( const Object &o ) { 242 | reset(); 243 | type_ = OBJECT_; 244 | *( object_value_ = new Object() ) = o; 245 | } 246 | void import( const Value &other ) { 247 | if (this != &other) 248 | switch (other.type_) { 249 | case NULL_: 250 | import( Null() ); 251 | break; 252 | case BOOL_: 253 | import( other.bool_value_ ); 254 | break; 255 | case NUMBER_: 256 | import( other.number_value_ ); 257 | break; 258 | case STRING_: 259 | import( *other.string_value_ ); 260 | break; 261 | case ARRAY_: 262 | import( *other.array_value_ ); 263 | break; 264 | case OBJECT_: 265 | import( *other.object_value_ ); 266 | break; 267 | case INVALID_: 268 | type_ = INVALID_; 269 | break; 270 | default: 271 | JSONXX_ASSERT( !"not implemented" ); 272 | } 273 | } 274 | template 275 | Value &operator <<( const T &t ) { 276 | import(t); 277 | return *this; 278 | } 279 | template 280 | Value &operator =( const T &t ) { 281 | reset(); 282 | import(t); 283 | return *this; 284 | } 285 | Value(const Value &other); 286 | template 287 | Value( const T&t ) : type_(INVALID_) { import(t); } 288 | template 289 | Value( const char (&t)[N] ) : type_(INVALID_) { import( std::string(t) ); } 290 | 291 | bool parse(std::istream &input); 292 | bool parse(const std::string &input); 293 | 294 | template 295 | bool is() const; 296 | template 297 | T& get(); 298 | template 299 | const T& get() const; 300 | 301 | bool empty() const; 302 | 303 | public: 304 | enum { 305 | NUMBER_, 306 | STRING_, 307 | BOOL_, 308 | NULL_, 309 | ARRAY_, 310 | OBJECT_, 311 | INVALID_ 312 | } type_; 313 | union { 314 | Number number_value_; 315 | String* string_value_; 316 | Boolean bool_value_; 317 | Array* array_value_; 318 | Object* object_value_; 319 | }; 320 | 321 | protected: 322 | static bool parse(std::istream& input, Value& value); 323 | }; 324 | 325 | template 326 | bool Array::has(unsigned int i) const { 327 | if (i >= size()) { 328 | return false; 329 | } else { 330 | Value* v = values_.at(i); 331 | return v->is(); 332 | } 333 | } 334 | 335 | template 336 | T& Array::get(unsigned int i) { 337 | JSONXX_ASSERT(i < size()); 338 | Value* v = values_.at(i); 339 | return v->get(); 340 | } 341 | 342 | template 343 | const T& Array::get(unsigned int i) const { 344 | JSONXX_ASSERT(i < size()); 345 | const Value* v = values_.at(i); 346 | return v->get(); 347 | } 348 | 349 | template 350 | const T& Array::get(unsigned int i, const typename identity::type& default_value) const { 351 | if(has(i)) { 352 | const Value* v = values_.at(i); 353 | return v->get(); 354 | } else { 355 | return default_value; 356 | } 357 | } 358 | 359 | template 360 | bool Object::has(const std::string& key) const { 361 | container::const_iterator it(value_map_.find(key)); 362 | return it != value_map_.end() && it->second->is(); 363 | } 364 | 365 | template 366 | T& Object::get(const std::string& key) { 367 | JSONXX_ASSERT(has(key)); 368 | return value_map_.find(key)->second->get(); 369 | } 370 | 371 | template 372 | const T& Object::get(const std::string& key) const { 373 | JSONXX_ASSERT(has(key)); 374 | return value_map_.find(key)->second->get(); 375 | } 376 | 377 | template 378 | const T& Object::get(const std::string& key, const typename identity::type& default_value) const { 379 | if (has(key)) { 380 | return value_map_.find(key)->second->get(); 381 | } else { 382 | return default_value; 383 | } 384 | } 385 | 386 | template<> 387 | inline bool Value::is() const { 388 | return type_ == NULL_; 389 | } 390 | 391 | template<> 392 | inline bool Value::is() const { 393 | return type_ == BOOL_; 394 | } 395 | 396 | template<> 397 | inline bool Value::is() const { 398 | return type_ == STRING_; 399 | } 400 | 401 | template<> 402 | inline bool Value::is() const { 403 | return type_ == NUMBER_; 404 | } 405 | 406 | template<> 407 | inline bool Value::is() const { 408 | return type_ == ARRAY_; 409 | } 410 | 411 | template<> 412 | inline bool Value::is() const { 413 | return type_ == OBJECT_; 414 | } 415 | 416 | template<> 417 | inline bool& Value::get() { 418 | JSONXX_ASSERT(is()); 419 | return bool_value_; 420 | } 421 | 422 | template<> 423 | inline std::string& Value::get() { 424 | JSONXX_ASSERT(is()); 425 | return *string_value_; 426 | } 427 | 428 | template<> 429 | inline Number& Value::get() { 430 | JSONXX_ASSERT(is()); 431 | return number_value_; 432 | } 433 | 434 | template<> 435 | inline Array& Value::get() { 436 | JSONXX_ASSERT(is()); 437 | return *array_value_; 438 | } 439 | 440 | template<> 441 | inline Object& Value::get() { 442 | JSONXX_ASSERT(is()); 443 | return *object_value_; 444 | } 445 | 446 | template<> 447 | inline const Boolean& Value::get() const { 448 | JSONXX_ASSERT(is()); 449 | return bool_value_; 450 | } 451 | 452 | template<> 453 | inline const String& Value::get() const { 454 | JSONXX_ASSERT(is()); 455 | return *string_value_; 456 | } 457 | 458 | template<> 459 | inline const Number& Value::get() const { 460 | JSONXX_ASSERT(is()); 461 | return number_value_; 462 | } 463 | 464 | template<> 465 | inline const Array& Value::get() const { 466 | JSONXX_ASSERT(is()); 467 | return *array_value_; 468 | } 469 | 470 | template<> 471 | inline const Object& Value::get() const { 472 | JSONXX_ASSERT(is()); 473 | return *object_value_; 474 | } 475 | 476 | template 477 | inline Object &Object::operator<<(const T &value) { 478 | return *this << Value(value), *this; 479 | } 480 | 481 | } // namespace jsonxx 482 | 483 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Value& v); 484 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Object& v); 485 | std::ostream& operator<<(std::ostream& stream, const jsonxx::Array& v); 486 | -------------------------------------------------------------------------------- /src/ofxISF.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofxISF/Constants.h" 4 | #include "ofxISF/Uniforms.h" 5 | #include "ofxISF/CodeGenerater.h" 6 | #include "ofxISF/Shader.h" 7 | #include "ofxISF/Chain.h" 8 | -------------------------------------------------------------------------------- /src/ofxISF/Chain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Shader.h" 4 | 5 | OFX_ISF_BEGIN_NAMESPACE 6 | 7 | class Chain 8 | { 9 | public: 10 | 11 | Chain() : input(NULL), result(NULL) {} 12 | ~Chain() 13 | { 14 | for (int i = 0; i < passes.size(); i++) 15 | { 16 | delete passes[i]; 17 | } 18 | 19 | passes.clear(); 20 | pass_map.clear(); 21 | } 22 | 23 | void setup(int width, int height, int internalformat = GL_RGB) 24 | { 25 | this->width = width; 26 | this->height = height; 27 | this->internalformat = internalformat; 28 | } 29 | 30 | bool load(const string& path, bool enabled = true) 31 | { 32 | Shader *shader = new Shader; 33 | shader->setup(width, height, internalformat); 34 | 35 | if (!shader->load(path)) 36 | { 37 | delete shader; 38 | return false; 39 | } 40 | 41 | ShaderPass *pass = new ShaderPass; 42 | pass->enabled = enabled; 43 | pass->shader = shader; 44 | 45 | passes.push_back(pass); 46 | pass_map[shader->getName()] = pass; 47 | 48 | return true; 49 | } 50 | 51 | void update() 52 | { 53 | if (passes.empty()) return; 54 | 55 | ofTexture *tex = input; 56 | 57 | for (int i = 0; i < passes.size(); i++) 58 | { 59 | ShaderPass &p = *passes[i]; 60 | if (p.enabled == false) continue; 61 | 62 | Shader *o = p.shader; 63 | o->setImage(tex); 64 | o->update(); 65 | tex = &o->getTextureReference(); 66 | } 67 | 68 | result = tex; 69 | } 70 | 71 | inline void draw(float x, float y) { draw(x, y, width, height); } 72 | 73 | void draw(float x, float y, float width, float height) 74 | { 75 | if (result == NULL) return; 76 | result->draw(x, y, width, height); 77 | } 78 | 79 | // 80 | 81 | inline void setImage(ofTexture *img) { input = img; } 82 | inline void setImage(ofTexture &img) { setImage(&img); } 83 | inline void setImage(ofImage &img) { setImage(img.getTextureReference()); } 84 | 85 | inline float getWidth() const { return width; } 86 | inline float getHeight() const { return height; } 87 | 88 | // 89 | 90 | inline size_t size() const { return passes.size(); } 91 | inline bool hasShader(const string& name) const { return pass_map.find(name) != pass_map.end(); } 92 | 93 | Shader* getShader(size_t index) const { return passes[index]->shader; } 94 | Shader* getShader(const string& name) const 95 | { 96 | if (!hasShader(name)) return NULL; 97 | return pass_map[name]->shader; 98 | } 99 | 100 | void setEnable(size_t index, bool state) { passes[index]->enabled = state; } 101 | void setEnable(const string& name, bool state) 102 | { 103 | if (!hasShader(name)) return; 104 | pass_map[name]->enabled = state; 105 | } 106 | 107 | bool getEnable(size_t index) { return passes[index]->enabled; } 108 | bool getEnable(const string& name) 109 | { 110 | if (!hasShader(name)) return false; 111 | return pass_map[name]->enabled; 112 | } 113 | 114 | bool toggle(size_t index) { passes[index]->enabled = !passes[index]->enabled; } 115 | bool toggle(const string& name) 116 | { 117 | if (!hasShader(name)) return false;; 118 | pass_map[name]->enabled != pass_map[name]->enabled; 119 | } 120 | 121 | protected: 122 | 123 | int internalformat; 124 | int width, height; 125 | 126 | struct ShaderPass { 127 | bool enabled; 128 | Shader *shader; 129 | }; 130 | 131 | vector passes; 132 | mutable map pass_map; 133 | 134 | ofTexture *input; 135 | ofTexture *result; 136 | }; 137 | 138 | OFX_ISF_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxISF/CodeGenerater.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Poco/RegularExpression.h" 4 | 5 | #include "Constants.h" 6 | #include "Uniforms.h" 7 | 8 | OFX_ISF_BEGIN_NAMESPACE 9 | 10 | #define _S(src) # src 11 | 12 | class ImageDecl 13 | { 14 | public: 15 | 16 | ImageDecl() {} 17 | ImageDecl(const Ref_ &uniform) : uniform(uniform) {} 18 | 19 | string getImgThisPixelString() const 20 | { 21 | string s; 22 | if (uniform->isRectangleTexture()) 23 | s = "IMG_THIS_PIXEL_RECT($IMAGE$, _$IMAGE$_pct)"; 24 | else 25 | s = "IMG_THIS_PIXEL_2D($IMAGE$, _$IMAGE$_pct)"; 26 | ofStringReplace(s, "$IMAGE$", uniform->getName()); 27 | return s; 28 | } 29 | 30 | string getImgThisNormPixelString() const 31 | { 32 | string s; 33 | if (uniform->isRectangleTexture()) 34 | s = "IMG_THIS_NORM_PIXEL_RECT($IMAGE$, _$IMAGE$_pct)"; 35 | else 36 | s = "IMG_THIS_NORM_PIXEL_2D($IMAGE$, _$IMAGE$_pct)"; 37 | ofStringReplace(s, "$IMAGE$", uniform->getName()); 38 | return s; 39 | } 40 | 41 | string getImgPixlString() const 42 | { 43 | string s; 44 | if (uniform->isRectangleTexture()) 45 | s = "IMG_PIXEL_RECT($IMAGE$, _$IMAGE$_pct,"; 46 | else 47 | s = "IMG_PIXEL_2D($IMAGE$, _$IMAGE$_pct,"; 48 | ofStringReplace(s, "$IMAGE$", uniform->getName()); 49 | return s; 50 | } 51 | 52 | string getImgNormPixelString() const 53 | { 54 | string s; 55 | if (uniform->isRectangleTexture()) 56 | s = "IMG_NORM_PIXEL_RECT($IMAGE$, _$IMAGE$_pct,"; 57 | else 58 | s = "IMG_NORM_PIXEL_2D($IMAGE$, _$IMAGE$_pct,"; 59 | ofStringReplace(s, "$IMAGE$", uniform->getName()); 60 | return s; 61 | } 62 | 63 | protected: 64 | 65 | Ref_ uniform; 66 | }; 67 | 68 | class CodeGenerator 69 | { 70 | public: 71 | 72 | CodeGenerator(Uniforms &uniforms) : uniforms(uniforms) {} 73 | 74 | bool generate(const string& isf_glsl_code) 75 | { 76 | if (!generate_shader(isf_glsl_code)) return false; 77 | 78 | return true; 79 | } 80 | 81 | const string& getVertexShader() const { return vert; } 82 | const string& getFragmentShader() const { return frag; } 83 | 84 | void dumpShader() const 85 | { 86 | cout << "vert: " << endl; 87 | cout << vert << endl; 88 | cout << "===" << endl; 89 | 90 | cout << "frag: " << endl; 91 | cout << frag << endl; 92 | cout << "===" << endl; 93 | } 94 | 95 | protected: 96 | 97 | Uniforms &uniforms; 98 | 99 | string vert; 100 | string frag; 101 | 102 | protected: 103 | 104 | bool generate_shader(const string& isf_glsl_code) 105 | { 106 | const vector >& images = uniforms.getImageUniforms(); 107 | map image_decls; 108 | 109 | for (int i = 0; i < images.size(); i++) 110 | { 111 | const Ref_ &uniform = images[i]; 112 | image_decls[uniform->getName()] = ImageDecl(uniform); 113 | } 114 | 115 | string isf_source = isf_glsl_code; 116 | if (!process_lookup_macro(isf_source, image_decls)) return false; 117 | 118 | string uniform_str; 119 | for (int i = 0; i < uniforms.size(); i++) 120 | { 121 | Uniform::Ref o = uniforms.getUniform(i); 122 | uniform_str += o->getUniform() + "\n"; 123 | } 124 | 125 | { 126 | vert = _S( 127 | uniform int PASSINDEX; 128 | uniform vec2 RENDERSIZE; 129 | varying vec2 vv_FragNormCoord; 130 | 131 | void vv_vertShaderInit(void) 132 | { 133 | gl_Position = ftransform(); 134 | vv_FragNormCoord = vec2(gl_MultiTexCoord0.x, gl_MultiTexCoord0.y); 135 | } 136 | 137 | $UNIFORMS$ 138 | 139 | void main(void) 140 | { 141 | vv_vertShaderInit(); 142 | } 143 | ); 144 | 145 | ofStringReplace(vert, "$UNIFORMS$", uniform_str); 146 | } 147 | 148 | { 149 | frag = _S( 150 | uniform int PASSINDEX; 151 | uniform vec2 RENDERSIZE; 152 | varying vec2 vv_FragNormCoord; 153 | uniform float TIME; 154 | 155 | $UNIFORMS$ 156 | 157 | vec4 IMG_NORM_PIXEL_2D(sampler2D sampler, vec2 pct, vec2 normLoc) 158 | { 159 | vec2 coord = normLoc; 160 | return texture2D(sampler, coord * pct); 161 | } 162 | vec4 IMG_PIXEL_2D(sampler2D sampler, vec2 pct, vec2 loc) 163 | { 164 | return IMG_NORM_PIXEL_2D(sampler, pct, loc / RENDERSIZE); 165 | } 166 | vec4 IMG_THIS_NORM_PIXEL_2D(sampler2D sampler, vec2 pct) 167 | { 168 | vec2 coord = vv_FragNormCoord; 169 | return texture2D(sampler, coord * pct); 170 | } 171 | vec4 IMG_THIS_PIXEL_2D(sampler2D sampler, vec2 pct) 172 | { 173 | return IMG_THIS_NORM_PIXEL_2D(sampler, pct); 174 | } 175 | vec4 IMG_NORM_PIXEL_RECT(sampler2DRect sampler, vec2 pct, vec2 normLoc) 176 | { 177 | vec2 coord = normLoc; 178 | return texture2DRect(sampler, coord * RENDERSIZE); 179 | } 180 | vec4 IMG_PIXEL_RECT(sampler2DRect sampler, vec2 pct, vec2 loc) 181 | { 182 | return IMG_NORM_PIXEL_RECT(sampler, pct, loc / RENDERSIZE); 183 | } 184 | vec4 IMG_THIS_NORM_PIXEL_RECT(sampler2DRect sampler, vec2 pct) 185 | { 186 | vec2 coord = vv_FragNormCoord; 187 | return texture2DRect(sampler, coord * RENDERSIZE); 188 | } 189 | vec4 IMG_THIS_PIXEL_RECT(sampler2DRect sampler, vec2 pct) 190 | { 191 | return IMG_THIS_NORM_PIXEL_RECT(sampler, pct); 192 | } 193 | 194 | $ISF_SOURCE$ 195 | ); 196 | 197 | ofStringReplace(frag, "$UNIFORMS$", uniform_str); 198 | ofStringReplace(frag, "$ISF_SOURCE$", isf_source); 199 | } 200 | 201 | return true; 202 | } 203 | 204 | bool process_lookup_macro(string& isf_source, map &image_decls) 205 | { 206 | { 207 | string pattern = "(IMG_THIS_PIXEL|IMG_THIS_NORM_PIXEL)\\s*\\(\\s*(.*?)\\s*\\)"; 208 | 209 | Poco::RegularExpression re(pattern, Poco::RegularExpression::RE_NEWLINE_ANY); 210 | Poco::RegularExpression::Match m; 211 | m.offset = 0; 212 | 213 | while (0 != re.match(isf_source, m.offset, m)) 214 | { 215 | string found(isf_source, m.offset, m.length); 216 | 217 | string lookup_name = found; 218 | re.subst(lookup_name, "$1"); 219 | 220 | string image_name = found; 221 | re.subst(image_name, "$2"); 222 | 223 | map::iterator it = image_decls.find(image_name); 224 | if (it == image_decls.end()) 225 | { 226 | ofLogError("ofxISF::CodeGenerator") << "image name mismatch: " << image_name; 227 | return false; 228 | } 229 | 230 | ImageDecl &image_decl = it->second; 231 | string replace_string; 232 | 233 | if (lookup_name == "IMG_THIS_PIXEL") 234 | { 235 | replace_string = image_decl.getImgThisPixelString(); 236 | } 237 | else if (lookup_name == "IMG_THIS_NORM_PIXEL") 238 | { 239 | replace_string = image_decl.getImgThisNormPixelString(); 240 | } 241 | else 242 | { 243 | throw "unknown error"; 244 | } 245 | 246 | isf_source.replace(m.offset, m.length, replace_string); 247 | 248 | m.offset += replace_string.size(); 249 | } 250 | } 251 | 252 | { 253 | string pattern = "(IMG_PIXEL|IMG_NORM_PIXEL)\\s*\\(\\s*(.*?)\\s?,"; 254 | 255 | Poco::RegularExpression re(pattern, Poco::RegularExpression::RE_NEWLINE_ANY); 256 | Poco::RegularExpression::Match m; 257 | m.offset = 0; 258 | 259 | while (0 != re.match(isf_source, m.offset, m)) 260 | { 261 | string found(isf_source, m.offset, m.length); 262 | 263 | string lookup_name = found; 264 | re.subst(lookup_name, "$1"); 265 | 266 | string image_name = found; 267 | re.subst(image_name, "$2"); 268 | 269 | map::iterator it = image_decls.find(image_name); 270 | if (it == image_decls.end()) 271 | { 272 | ofLogError("ofxISF::CodeGenerator") << "image name mismatch: " << image_name; 273 | return false; 274 | } 275 | 276 | ImageDecl &image_decl = it->second; 277 | string replace_string; 278 | 279 | if (lookup_name == "IMG_PIXEL") 280 | { 281 | replace_string = image_decl.getImgPixlString(); 282 | } 283 | else if (lookup_name == "IMG_NORM_PIXEL") 284 | { 285 | replace_string = image_decl.getImgNormPixelString(); 286 | } 287 | else 288 | { 289 | throw "unknown error"; 290 | } 291 | 292 | isf_source.replace(m.offset, m.length, replace_string); 293 | 294 | m.offset += replace_string.size(); 295 | } 296 | } 297 | 298 | return true; 299 | } 300 | }; 301 | 302 | #undef _S 303 | 304 | OFX_ISF_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxISF/Constants.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define OFX_ISF_BEGIN_NAMESPACE namespace ofx { namespace ISF { 4 | #define OFX_ISF_END_NAMESPACE } } 5 | 6 | OFX_ISF_BEGIN_NAMESPACE 7 | 8 | template 9 | struct Ref_ : public ofPtr 10 | { 11 | Ref_() {} 12 | Ref_(T *t) : ofPtr(t) {} 13 | Ref_(const Ref_& o) : ofPtr(o) {} 14 | Ref_(const ofPtr& o) : ofPtr(o) {} 15 | 16 | template 17 | Ref_ cast() const { return dynamic_pointer_cast(*this); } 18 | }; 19 | 20 | template 21 | struct Type2Int 22 | { 23 | static unsigned int value() 24 | { 25 | static size_t m = 0; 26 | return (unsigned int)&m; 27 | } 28 | }; 29 | 30 | struct Input { 31 | string name, type; 32 | }; 33 | 34 | struct PresistentBuffer 35 | { 36 | string name; 37 | float width, height; 38 | }; 39 | 40 | struct Pass 41 | { 42 | string target; 43 | float width, height; 44 | }; 45 | 46 | OFX_ISF_END_NAMESPACE 47 | 48 | namespace ofxISF = ofx::ISF; -------------------------------------------------------------------------------- /src/ofxISF/Shader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Constants.h" 4 | #include "Uniforms.h" 5 | 6 | #include "jsonxx.h" 7 | 8 | OFX_ISF_BEGIN_NAMESPACE 9 | 10 | class Shader 11 | { 12 | public: 13 | 14 | Shader() 15 | :code_generator(uniforms) 16 | ,current_framebuffer(NULL) 17 | ,result_texture(NULL) 18 | ,internalformat(GL_RGB) 19 | {} 20 | 21 | void setup(int w, int h, int internalformat = GL_RGB) 22 | { 23 | render_size.set(w, h); 24 | this->internalformat = internalformat; 25 | 26 | ofFbo &fbo = framebuffer_map["DEFAULT"]; 27 | fbo.allocate(render_size.x, render_size.y, internalformat); 28 | 29 | fbo.begin(); 30 | ofClear(0); 31 | fbo.end(); 32 | } 33 | 34 | bool load(const string& path) 35 | { 36 | if (!ofFile::doesFileExist(path)) 37 | { 38 | ofLogError("ofxISF") << "no such file"; 39 | return false; 40 | } 41 | 42 | name = ofFilePath::getBaseName(path); 43 | 44 | string data = ofBufferFromFile(path).getText(); 45 | if (!parse_directive(data, header_directive, shader_directive)) return false; 46 | if (!reload_shader()) return false; 47 | 48 | return true; 49 | } 50 | 51 | void update() 52 | { 53 | const vector >& images = uniforms.getImageUniforms(); 54 | bool need_reload_shader = false; 55 | for (int i = 0; i < images.size(); i++) 56 | { 57 | if (images[i]->checkTextureFormatChanged()) 58 | { 59 | need_reload_shader = true; 60 | break; 61 | } 62 | } 63 | if (need_reload_shader) reload_shader(); 64 | 65 | current_framebuffer = &framebuffer_map["DEFAULT"]; 66 | current_framebuffer->begin(); 67 | ofClear(0); 68 | current_framebuffer->end(); 69 | 70 | if (passes.empty()) 71 | { 72 | render_pass(0); 73 | } 74 | else 75 | { 76 | for (int i = 0; i < passes.size(); i++) 77 | { 78 | Pass &pass = passes[i]; 79 | if (!pass.target.empty()) 80 | { 81 | current_framebuffer = &framebuffer_map[pass.target]; 82 | } 83 | else 84 | { 85 | current_framebuffer = &framebuffer_map["DEFAULT"]; 86 | } 87 | render_pass(i); 88 | } 89 | } 90 | } 91 | 92 | void draw(float x, float y, float w, float h) 93 | { 94 | current_framebuffer->draw(x, y, w, h); 95 | } 96 | 97 | void draw(float x, float y) 98 | { 99 | current_framebuffer->draw(x, y); 100 | } 101 | 102 | // 103 | 104 | void clear(const ofColor& color) 105 | { 106 | current_framebuffer->begin(); 107 | ofClear(color); 108 | current_framebuffer->end(); 109 | } 110 | 111 | void clear(float r, float g, float b, float a = 255) 112 | { 113 | current_framebuffer->begin(); 114 | ofClear(r, g, b, a); 115 | current_framebuffer->end(); 116 | } 117 | 118 | void clear(float b, float a = 255) 119 | { 120 | current_framebuffer->begin(); 121 | ofClear(b, a); 122 | current_framebuffer->end(); 123 | } 124 | 125 | // 126 | 127 | ofTexture& getTextureReference() 128 | { 129 | return *result_texture; 130 | } 131 | 132 | // 133 | 134 | void setImage(ofTexture *img) 135 | { 136 | if (default_image_input_name == "") 137 | { 138 | static bool shown = false; 139 | if (!shown) 140 | { 141 | shown = true; 142 | ofLogError("Shader") << "no default image input"; 143 | } 144 | 145 | return; 146 | } 147 | uniforms.setUniform(default_image_input_name, img); 148 | } 149 | 150 | void setImage(ofTexture &img) 151 | { 152 | setImage(&img); 153 | } 154 | 155 | void setImage(ofImage &img) 156 | { 157 | setImage(&img.getTextureReference()); 158 | } 159 | 160 | // 161 | 162 | template 163 | void setUniform(const string& name, const EXT_TYPE& value) 164 | { 165 | uniforms.setUniform(name, value); 166 | } 167 | 168 | void setImage(const string& name, ofTexture *img) 169 | { 170 | uniforms.setUniform(name, img); 171 | } 172 | 173 | void setImage(const string& name, ofTexture &img) 174 | { 175 | setImage(name, &img); 176 | } 177 | 178 | void setImage(const string& name, ofImage &img) 179 | { 180 | setImage(name, &img.getTextureReference()); 181 | } 182 | 183 | // 184 | 185 | template 186 | bool hasUniform(const string& name) const 187 | { 188 | if (!uniforms.hasUniform(name)) return false; 189 | if (!uniforms.getUniform(name)->isTypeOf()) return false; 190 | return true; 191 | } 192 | 193 | bool hasImage(const string& name) const 194 | { 195 | return hasUniform(name); 196 | } 197 | 198 | void dumpShader() const 199 | { 200 | code_generator.dumpShader(); 201 | } 202 | 203 | // 204 | 205 | const string& getName() const { return name; } 206 | const string& getDescription() const { return description; } 207 | const string& getCredit() const { return credit; } 208 | const vector& getCategories() const { return categories; } 209 | 210 | const Uniforms& getInputs() const { return input_uniforms; } 211 | 212 | // 213 | 214 | const vector& getTextures() const { return textures; } 215 | 216 | protected: 217 | 218 | ofVec2f render_size; 219 | int internalformat; 220 | 221 | string name; 222 | string description; 223 | string credit; 224 | vector categories; 225 | 226 | vector inputs; 227 | vector presistent_buffers; 228 | vector passes; 229 | 230 | string default_image_input_name; 231 | 232 | // 233 | 234 | Uniforms uniforms; 235 | Uniforms input_uniforms; 236 | CodeGenerator code_generator; 237 | 238 | string header_directive; 239 | string shader_directive; 240 | 241 | map framebuffer_map; 242 | ofFbo *current_framebuffer; 243 | 244 | vector textures; 245 | ofTexture *result_texture; 246 | 247 | ofShader shader; 248 | 249 | protected: 250 | 251 | void render_pass(int index) 252 | { 253 | if (!shader.isLoaded()) return; 254 | 255 | current_framebuffer->begin(); 256 | 257 | ofPushStyle(); 258 | ofEnableAlphaBlending(); 259 | ofSetColor(255); 260 | 261 | shader.begin(); 262 | shader.setUniform1i("PASSINDEX", index); 263 | shader.setUniform2fv("RENDERSIZE", render_size.getPtr()); 264 | shader.setUniform1f("TIME", ofGetElapsedTimef()); 265 | 266 | ImageUniform::resetTextureUnitID(); 267 | 268 | for (int i = 0; i < uniforms.size(); i++) 269 | uniforms.getUniform(i)->update(&shader); 270 | 271 | glBegin(GL_QUADS); 272 | glTexCoord2f(0, 0); 273 | glVertex2f(0, 0); 274 | 275 | glTexCoord2f(1, 0); 276 | glVertex2f(render_size.x, 0); 277 | 278 | glTexCoord2f(1, 1); 279 | glVertex2f(render_size.x, render_size.y); 280 | 281 | glTexCoord2f(0, 1); 282 | glVertex2f(0, render_size.y); 283 | glEnd(); 284 | 285 | shader.end(); 286 | 287 | ofPopStyle(); 288 | 289 | current_framebuffer->end(); 290 | } 291 | 292 | #pragma mark - 293 | 294 | bool parse_directive(const string &data, string& header_directive, string& shader_directive) 295 | { 296 | const string header_begin = "/*"; 297 | const string header_end = "*/"; 298 | 299 | string::size_type begin_pos = data.find_first_of(header_begin) + header_end.size(); 300 | string::size_type end_pos = data.find_first_of(header_end, begin_pos); 301 | string::size_type count = end_pos - begin_pos; 302 | 303 | if (begin_pos == end_pos 304 | || begin_pos == std::string::npos 305 | || end_pos == std::string::npos) 306 | { 307 | ofLogError("ofxISF") << "invalid format: missing header delective"; 308 | return false; 309 | } 310 | 311 | header_directive = data.substr(begin_pos, count); 312 | 313 | string::size_type shader_begin = end_pos + header_end.size(); 314 | shader_directive = data.substr(shader_begin); 315 | 316 | return true; 317 | } 318 | 319 | bool reload_shader() 320 | { 321 | textures.clear(); 322 | current_framebuffer = &framebuffer_map["DEFAULT"]; 323 | 324 | textures.push_back(&framebuffer_map["DEFAULT"].getTextureReference()); 325 | 326 | if (!parse(header_directive)) return false; 327 | 328 | for (int i = 0; i < presistent_buffers.size(); i++) 329 | { 330 | const PresistentBuffer &buf = presistent_buffers[i]; 331 | ofFbo &fbo = framebuffer_map[buf.name]; 332 | textures.push_back(&fbo.getTextureReference()); 333 | 334 | if (!fbo.isAllocated()) 335 | { 336 | fbo.allocate(buf.width, buf.height, internalformat); 337 | 338 | fbo.begin(); 339 | ofClear(0); 340 | fbo.end(); 341 | } 342 | 343 | ImageUniform *uniform = new ImageUniform(buf.name); 344 | uniform->set(&fbo.getTextureReference()); 345 | uniforms.addUniform(buf.name, Uniform::Ref(uniform)); 346 | } 347 | 348 | { 349 | string result_texture_name = ""; 350 | 351 | if (!passes.empty()) 352 | { 353 | result_texture_name = passes.back().target; 354 | } 355 | 356 | if (result_texture_name == "") 357 | result_texture_name = "DEFAULT"; 358 | 359 | result_texture = &framebuffer_map[result_texture_name].getTextureReference(); 360 | } 361 | 362 | if (!code_generator.generate(shader_directive)) return false; 363 | 364 | shader.unload(); 365 | if (!shader.setupShaderFromSource(GL_VERTEX_SHADER, code_generator.getVertexShader())) 366 | { 367 | cout << code_generator.getVertexShader() << endl; 368 | return false; 369 | } 370 | 371 | if (!shader.setupShaderFromSource(GL_FRAGMENT_SHADER, code_generator.getFragmentShader())) 372 | { 373 | cout << code_generator.getFragmentShader() << endl; 374 | return false; 375 | } 376 | 377 | if (!shader.linkProgram()) 378 | { 379 | return false; 380 | } 381 | 382 | return true; 383 | } 384 | 385 | // 386 | 387 | bool parse(const string& header_directive) 388 | { 389 | jsonxx::Object o; 390 | assert(o.parse(header_directive)); 391 | 392 | description = o.get("DESCRIPTION", ""); 393 | credit = o.get("CREDIT", ""); 394 | 395 | jsonxx::Array a; 396 | 397 | { 398 | categories.clear(); 399 | a = o.get("CATEGORIES", jsonxx::Array()); 400 | for (int i = 0; i < a.size(); i++) 401 | if (a.has(i)) 402 | categories.push_back(a.get(i)); 403 | } 404 | 405 | { 406 | default_image_input_name = ""; 407 | input_uniforms.clear(); 408 | 409 | a = o.get("INPUTS", jsonxx::Array()); 410 | for (int i = 0; i < a.size(); i++) 411 | { 412 | jsonxx::Object o = a.get(i, jsonxx::Object()); 413 | string name = o.get("NAME", ""); 414 | string type = o.get("TYPE", ""); 415 | 416 | Input input; 417 | input.name = name; 418 | input.type = type; 419 | inputs.push_back(input); 420 | 421 | if (type == "image" 422 | && default_image_input_name == "") 423 | { 424 | default_image_input_name = name; 425 | } 426 | 427 | Uniform::Ref uniform = setup_input_uniform(o); 428 | if (uniform) 429 | { 430 | // uniform type changed 431 | if (uniforms.hasUniform(name) 432 | && uniforms.getUniform(name)->getTypeID() != uniform->getTypeID()) 433 | { 434 | uniforms.removeUniform(name); 435 | } 436 | 437 | uniforms.addUniform(name, uniform); 438 | input_uniforms.addUniform(name, uniform); 439 | } 440 | } 441 | } 442 | 443 | { 444 | presistent_buffers.clear(); 445 | 446 | if (o.has("PERSISTENT_BUFFERS")) 447 | { 448 | a = o.get("PERSISTENT_BUFFERS", jsonxx::Array()); 449 | for (int i = 0; i < a.size(); i++) 450 | { 451 | string name = a.get(i); 452 | 453 | PresistentBuffer buf; 454 | buf.name = name; 455 | buf.width = render_size.x; 456 | buf.height = render_size.y; 457 | presistent_buffers.push_back(buf); 458 | } 459 | } 460 | else if (o.has("PERSISTENT_BUFFERS")) 461 | { 462 | #if 0 463 | jsonxx::Object obj = o.get("PERSISTENT_BUFFERS", jsonxx::Object()); 464 | const jsonxx::Object::container& kv_map = obj.kv_map(); 465 | 466 | jsonxx::Object::container::const_iterator it = kv_map.begin(); 467 | while (it != kv_map.end()) 468 | { 469 | string name = it->first; 470 | PresistentBuffer buf; 471 | buf.name = name; 472 | 473 | // TODO: uniform expression 474 | buf.width = ...; 475 | buf.height = ...; 476 | 477 | presistent_buffers.push_back(buf); 478 | 479 | it++; 480 | } 481 | #endif 482 | 483 | throw "not implemented yet"; 484 | } 485 | } 486 | 487 | { 488 | passes.clear(); 489 | 490 | a = o.get("PASSES", jsonxx::Array()); 491 | for (int i = 0; i < a.size(); i++) 492 | { 493 | jsonxx::Object pass = a.get(i); 494 | 495 | string target = pass.get("TARGET", ""); 496 | 497 | // TODO: uniform expression 498 | string width = pass.get("WIDTH", ""); 499 | string height = pass.get("HEIGHT", ""); 500 | 501 | Pass o; 502 | o.target = target; 503 | 504 | passes.push_back(o); 505 | } 506 | } 507 | 508 | return true; 509 | } 510 | 511 | Uniform::Ref setup_input_uniform(const jsonxx::Object& obj) 512 | { 513 | string name = obj.get("NAME", ""); 514 | string type = obj.get("TYPE", ""); 515 | 516 | Uniform::Ref uniform = NULL; 517 | 518 | if (type == "image") 519 | { 520 | uniform = new ImageUniform(name); 521 | } 522 | else if (type == "bool") 523 | { 524 | uniform = new BoolUniform(name, obj.get("DEFAULT", false)); 525 | } 526 | else if (type == "float") 527 | { 528 | FloatUniform *o = new FloatUniform(name, obj.get("DEFAULT", 0)); 529 | 530 | if (obj.has("MIN") && obj.has("MAX")) 531 | { 532 | float m0 = obj.get("MIN", std::numeric_limits::min()); 533 | float m1 = obj.get("MAX", std::numeric_limits::max()); 534 | o->setRange(m0, m1); 535 | } 536 | 537 | uniform = o; 538 | } 539 | else if (type == "color") 540 | { 541 | ofFloatColor def; 542 | 543 | jsonxx::Array a = obj.get("DEFAULT", jsonxx::Array()); 544 | if (a.size() == 4) 545 | { 546 | def.r = a.get(0, 0); 547 | def.g = a.get(1, 0); 548 | def.b = a.get(2, 0); 549 | def.a = a.get(3, 0); 550 | } 551 | 552 | uniform = new ColorUniform(name, def); 553 | } 554 | else if (type == "event") 555 | { 556 | uniform = new EventUniform(name); 557 | } 558 | else if (type == "point2D") 559 | { 560 | ofVec2f def; 561 | 562 | jsonxx::Array a = obj.get("DEFAULT", jsonxx::Array()); 563 | if (a.size() == 2) 564 | { 565 | def.x = a.get(0, 0); 566 | def.y = a.get(1, 0); 567 | } 568 | 569 | uniform = new Point2DUniform(name, def); 570 | } 571 | 572 | return uniform; 573 | } 574 | }; 575 | 576 | OFX_ISF_END_NAMESPACE -------------------------------------------------------------------------------- /src/ofxISF/Uniforms.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Constants.h" 4 | 5 | OFX_ISF_BEGIN_NAMESPACE 6 | 7 | #define _S(src) # src 8 | 9 | class Shader; 10 | class CodeGenerator; 11 | class ImageUniform; 12 | template 13 | class Uniform_; 14 | 15 | class Uniform 16 | { 17 | public: 18 | 19 | typedef Ref_ Ref; 20 | 21 | Uniform(const string& name, unsigned int type_id) : name(name), type_id(type_id) 22 | {} 23 | virtual ~Uniform() {} 24 | 25 | const string& getName() const { return name; } 26 | 27 | template 28 | bool isTypeOf() const { return Type2Int::value() == type_id; } 29 | 30 | unsigned int getTypeID() const { return type_id; } 31 | 32 | protected: 33 | 34 | friend class CodeGenerator; 35 | friend class Shader; 36 | 37 | string name; 38 | unsigned int type_id; 39 | 40 | virtual string getUniform() const = 0; 41 | virtual void update(ofShader *shader) = 0; 42 | }; 43 | 44 | // 45 | 46 | class Uniforms 47 | { 48 | public: 49 | 50 | size_t size() const 51 | { 52 | return uniforms.size(); 53 | } 54 | 55 | Uniform::Ref getUniform(size_t idx) const 56 | { 57 | return uniforms.at(idx); 58 | } 59 | 60 | Uniform::Ref getUniform(const string& key) const 61 | { 62 | if (uniforms_map.find(key) == uniforms_map.end()) return Uniform::Ref(); 63 | return uniforms_map[key]; 64 | } 65 | 66 | bool hasUniform(const string& key) const 67 | { 68 | return uniforms_map.find(key) != uniforms_map.end(); 69 | } 70 | 71 | const vector >& getImageUniforms() const 72 | { 73 | return image_uniforms; 74 | } 75 | 76 | public: 77 | 78 | bool addUniform(const string& key, Uniform::Ref uniform) 79 | { 80 | if (hasUniform(key)) return false; 81 | 82 | uniforms_map[key] = uniform; 83 | updateCache(); 84 | return true; 85 | } 86 | 87 | void removeUniform(const string& key) 88 | { 89 | if (hasUniform(key)) return false; 90 | 91 | uniforms_map.erase(key); 92 | updateCache(); 93 | } 94 | 95 | template 96 | void setUniform(const string& name, const T1& value); 97 | 98 | void clear() 99 | { 100 | uniforms.clear(); 101 | uniforms_map.clear(); 102 | image_uniforms.clear(); 103 | } 104 | 105 | protected: 106 | 107 | vector uniforms; 108 | mutable map uniforms_map; 109 | vector > image_uniforms; 110 | 111 | void updateCache(); 112 | }; 113 | 114 | // 115 | 116 | template 117 | class Uniform_ : public Uniform 118 | { 119 | public: 120 | 121 | typedef T Type; 122 | 123 | T value; 124 | T min, max; 125 | bool has_range; 126 | 127 | Uniform_(const string& name, const T& default_value = T()) : Uniform(name, Type2Int::value()), value(default_value), has_range(false) {} 128 | 129 | void setRange(const T& min_, const T& max_) 130 | { 131 | has_range = true; 132 | min = min_; 133 | max = max_; 134 | } 135 | 136 | template 137 | void set(const TT& v) 138 | { 139 | value = v; 140 | } 141 | 142 | template 143 | TT get() const 144 | { 145 | TT v = value; 146 | return v; 147 | } 148 | }; 149 | 150 | class BoolUniform : public Uniform_ 151 | { 152 | public: 153 | 154 | BoolUniform(const string& name, const bool& default_value = Type()) : Uniform_(name, default_value) {} 155 | 156 | void update(ofShader *shader) 157 | { 158 | shader->setUniform1i(name, value); 159 | } 160 | 161 | protected: 162 | 163 | string getUniform() const 164 | { 165 | string s = _S( 166 | uniform bool $NAME$; 167 | ); 168 | ofStringReplace(s, "$NAME$", getName()); 169 | return s; 170 | } 171 | }; 172 | 173 | class FloatUniform : public Uniform_ 174 | { 175 | public: 176 | 177 | FloatUniform(const string& name, const float& default_value = Type()) : Uniform_(name, default_value) {} 178 | 179 | void update(ofShader *shader) 180 | { 181 | if (has_range) value = ofClamp(value, min, max); 182 | shader->setUniform1f(name, value); 183 | } 184 | 185 | protected: 186 | 187 | string getUniform() const 188 | { 189 | string s = _S( 190 | uniform float $NAME$; 191 | ); 192 | ofStringReplace(s, "$NAME$", getName()); 193 | return s; 194 | } 195 | }; 196 | 197 | class ColorUniform : public Uniform_ 198 | { 199 | public: 200 | 201 | ColorUniform(const string& name, const ofFloatColor& default_value = Type()) : Uniform_(name, default_value) {} 202 | 203 | void update(ofShader *shader) 204 | { 205 | if (has_range) 206 | { 207 | value.r = ofClamp(value.r, min.r, max.r); 208 | value.g = ofClamp(value.g, min.g, max.g); 209 | value.b = ofClamp(value.b, min.b, max.b); 210 | value.a = ofClamp(value.a, min.a, max.a); 211 | } 212 | shader->setUniform4fv(name, &value.r); 213 | } 214 | 215 | protected: 216 | 217 | string getUniform() const 218 | { 219 | string s = _S( 220 | uniform vec4 $NAME$; 221 | ); 222 | ofStringReplace(s, "$NAME$", getName()); 223 | return s; 224 | } 225 | }; 226 | 227 | class Point2DUniform : public Uniform_ 228 | { 229 | public: 230 | 231 | Point2DUniform(const string& name, const ofVec2f& default_value = Type()) : Uniform_(name, default_value) {} 232 | 233 | void update(ofShader *shader) 234 | { 235 | shader->setUniform2fv(name, value.getPtr()); 236 | } 237 | 238 | protected: 239 | 240 | string getUniform() const 241 | { 242 | string s = _S( 243 | uniform vec2 $NAME$; 244 | ); 245 | ofStringReplace(s, "$NAME$", getName()); 246 | return s; 247 | } 248 | }; 249 | 250 | class ImageUniform : public Uniform_ 251 | { 252 | public: 253 | 254 | ImageUniform(const string& name) : Uniform_(name, NULL), is_rectangle_texture(false) {} 255 | 256 | void update(ofShader *shader) 257 | { 258 | if (value == NULL) return; 259 | int &texture_unit_id = getTextureUnitID(); 260 | shader->setUniformTexture(name, *value, ++texture_unit_id); 261 | 262 | string s = "_$NAME$_pct"; 263 | ofStringReplace(s, "$NAME$", getName()); 264 | 265 | ofVec2f pct = value->getCoordFromPercent(1, 1); 266 | shader->setUniform2fv(s, pct.getPtr()); 267 | } 268 | 269 | bool isValid() const { return value != NULL; } 270 | 271 | bool isRectangleTexture() const 272 | { 273 | if (value == NULL) return false; 274 | return value->texData.textureTarget == GL_TEXTURE_RECTANGLE_ARB; 275 | } 276 | 277 | bool checkTextureFormatChanged() 278 | { 279 | if (value == NULL) return false; 280 | bool result = is_rectangle_texture != isRectangleTexture(); 281 | is_rectangle_texture = isRectangleTexture(); 282 | return result; 283 | } 284 | 285 | public: 286 | 287 | static void resetTextureUnitID() 288 | { 289 | getTextureUnitID() = 0; 290 | } 291 | 292 | protected: 293 | 294 | bool is_rectangle_texture; 295 | 296 | string getUniform() const 297 | { 298 | string s = _S( 299 | uniform $SAMPLER$ $NAME$; 300 | uniform vec2 _$NAME$_pct; 301 | ); 302 | ofStringReplace(s, "$NAME$", getName()); 303 | ofStringReplace(s, "$SAMPLER$", isRectangleTexture() ? "sampler2DRect" : "sampler2D"); 304 | return s; 305 | } 306 | 307 | static int& getTextureUnitID() 308 | { 309 | static int id = 0; 310 | return id; 311 | } 312 | }; 313 | 314 | class EventUniform : public Uniform_ 315 | { 316 | public: 317 | 318 | EventUniform(const string& name) : Uniform_(name, false) {} 319 | 320 | void update(ofShader *shader) 321 | { 322 | shader->setUniform1i(name, value); 323 | value = false; 324 | } 325 | 326 | protected: 327 | 328 | string getUniform() const 329 | { 330 | string s = _S( 331 | uniform bool $NAME$; 332 | ); 333 | ofStringReplace(s, "$NAME$", getName()); 334 | return s; 335 | } 336 | }; 337 | 338 | // 339 | 340 | template 341 | inline void Uniforms::setUniform(const string& name, const EXT_TYPE& value) 342 | { 343 | if (!hasUniform(name)) 344 | { 345 | ofLogError("ofxISF::Uniforms") << "uniform not found: " << name; 346 | return; 347 | } 348 | 349 | Uniform::Ref &p = uniforms_map[name]; 350 | if (!p->isTypeOf()) 351 | { 352 | ofLogError("ofxISF::Uniforms") << "type mismatch"; 353 | return; 354 | } 355 | 356 | Uniform_ *ptr = (Uniform_*)p.get(); 357 | ptr->value = value; 358 | } 359 | 360 | // 361 | 362 | inline void Uniforms::updateCache() 363 | { 364 | uniforms.clear(); 365 | image_uniforms.clear(); 366 | 367 | map::iterator it = uniforms_map.begin(); 368 | while (it != uniforms_map.end()) 369 | { 370 | Uniform::Ref o = it->second; 371 | uniforms.push_back(o); 372 | if (o->isTypeOf()) 373 | { 374 | Ref_ p = o.cast(); 375 | image_uniforms.push_back(p); 376 | } 377 | it++; 378 | } 379 | } 380 | 381 | #undef _S 382 | 383 | OFX_ISF_END_NAMESPACE --------------------------------------------------------------------------------