forked from BradLarson/GPUImage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a multiview test for the Mac. For now, locking focus on views t…
…o prevent glitches with multiple NSOpenGLViews on the Mac.
- Loading branch information
1 parent
58e680e
commit 7eaf5d3
Showing
22 changed files
with
4,131 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
403 changes: 403 additions & 0 deletions
403
examples/Mac/MultiViewFilterExample/MultiViewFilterExample.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Info.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>${EXECUTABLE_NAME}</string> | ||
<key>CFBundleIconFile</key> | ||
<string></string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.sunsetlakesoftware.${PRODUCT_NAME:rfc1034identifier}</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>${PRODUCT_NAME}</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>${MACOSX_DEPLOYMENT_TARGET}</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>Copyright © 2013 Sunset Lake Software LLC. All rights reserved.</string> | ||
<key>NSMainNibFile</key> | ||
<string>MainMenu</string> | ||
<key>NSPrincipalClass</key> | ||
<string>NSApplication</string> | ||
</dict> | ||
</plist> |
7 changes: 7 additions & 0 deletions
7
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/MultiViewFilterExample-Prefix.pch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// | ||
// Prefix header for all source files of the 'MultiViewFilterExample' target in the 'MultiViewFilterExample' project | ||
// | ||
|
||
#ifdef __OBJC__ | ||
#import <Cocoa/Cocoa.h> | ||
#endif |
11 changes: 11 additions & 0 deletions
11
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSAppDelegate.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#import <Cocoa/Cocoa.h> | ||
#import "SLSMultiViewWindowController.h" | ||
|
||
@interface SLSAppDelegate : NSObject <NSApplicationDelegate> | ||
{ | ||
SLSMultiViewWindowController *multiViewWindowController; | ||
} | ||
|
||
@property (assign) IBOutlet NSWindow *window; | ||
|
||
@end |
11 changes: 11 additions & 0 deletions
11
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSAppDelegate.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#import "SLSAppDelegate.h" | ||
|
||
@implementation SLSAppDelegate | ||
|
||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | ||
{ | ||
multiViewWindowController = [[SLSMultiViewWindowController alloc] initWithWindowNibName:@"SLSMultiViewWindowController"]; | ||
[multiViewWindowController showWindow:self]; | ||
} | ||
|
||
@end |
12 changes: 12 additions & 0 deletions
12
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSMultiViewWindowController.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#import <Cocoa/Cocoa.h> | ||
#import <GPUImage/GPUImage.h> | ||
|
||
@interface SLSMultiViewWindowController : NSWindowController | ||
{ | ||
GPUImageFilter *filter1, *filter2, *filter3; | ||
GPUImageAVCamera *videoCamera; | ||
} | ||
|
||
@property(readwrite) IBOutlet GPUImageView *upperLeftView, *upperRightView, *lowerLeftView, *lowerRightView; | ||
|
||
@end |
45 changes: 45 additions & 0 deletions
45
examples/Mac/MultiViewFilterExample/MultiViewFilterExample/SLSMultiViewWindowController.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#import "SLSMultiViewWindowController.h" | ||
|
||
@interface SLSMultiViewWindowController () | ||
|
||
@end | ||
|
||
@implementation SLSMultiViewWindowController | ||
|
||
@synthesize upperLeftView = _upperLeftView, upperRightView = _upperRightView, lowerLeftView = _lowerLeftView, lowerRightView = _lowerRightView; | ||
|
||
- (id)initWithWindow:(NSWindow *)window | ||
{ | ||
self = [super initWithWindow:window]; | ||
if (self) { | ||
// Initialization code here. | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (void)windowDidLoad | ||
{ | ||
[super windowDidLoad]; | ||
|
||
videoCamera = [[GPUImageAVCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionUnspecified]; | ||
|
||
filter1 = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader1"]; | ||
filter2 = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"Shader2"]; | ||
filter3 = [[GPUImageSepiaFilter alloc] init]; | ||
[filter1 forceProcessingAtSizeRespectingAspectRatio:self.upperRightView.sizeInPixels]; | ||
[filter2 forceProcessingAtSizeRespectingAspectRatio:self.lowerLeftView.sizeInPixels]; | ||
[filter3 forceProcessingAtSizeRespectingAspectRatio:self.upperRightView.sizeInPixels]; | ||
|
||
[videoCamera addTarget:self.upperLeftView]; | ||
[videoCamera addTarget:filter1]; | ||
[filter1 addTarget:self.upperRightView]; | ||
[videoCamera addTarget:filter2]; | ||
[filter2 addTarget:self.lowerLeftView]; | ||
[videoCamera addTarget:filter3]; | ||
[filter3 addTarget:self.lowerRightView]; | ||
|
||
[videoCamera startCameraCapture]; | ||
} | ||
|
||
@end |
Oops, something went wrong.