From 1b4d28edd06e98cd8b06a129b4aad3e29de38938 Mon Sep 17 00:00:00 2001 From: Kent Sutherland Date: Thu, 23 Feb 2006 23:30:47 +0000 Subject: [PATCH] Renamed "Core Image - Ripple" to "Ripple" Ripple effect added to effects list only if CoreImage acceleration is available. --- ITCoreImageWindowEffect.m | 2 +- ITKit.xcodeproj/project.pbxproj | 4 ++++ ITWindowEffect.m | 19 +++++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ITCoreImageWindowEffect.m b/ITCoreImageWindowEffect.m index ea68c84..afef08f 100644 --- a/ITCoreImageWindowEffect.m +++ b/ITCoreImageWindowEffect.m @@ -20,7 +20,7 @@ static BOOL _running = NO; + (NSString *)effectName { - return @"Core Image - Ripple"; + return @"Ripple"; } + (NSDictionary *)supportedPositions diff --git a/ITKit.xcodeproj/project.pbxproj b/ITKit.xcodeproj/project.pbxproj index 692d4ee..a02dc4c 100644 --- a/ITKit.xcodeproj/project.pbxproj +++ b/ITKit.xcodeproj/project.pbxproj @@ -31,6 +31,7 @@ 37B7F6750754F87A0089C005 /* ITSplashWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 37B7F66E0754F87A0089C005 /* ITSplashWindow.m */; }; 37B7F6760754F87A0089C005 /* ITSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 37B7F66F0754F87A0089C005 /* ITSplashScreen.m */; }; 37B7F6780754F87A0089C005 /* ITSplashScreen.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B7F6710754F87A0089C005 /* ITSplashScreen.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37D4862009AE7C8300B68439 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37D4861F09AE7C8300B68439 /* OpenGL.framework */; }; 37FA493F094DE2650078A329 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37FA493E094DE2650078A329 /* QuartzCore.framework */; }; 37FA494D094DE28B0078A329 /* ITCoreImageWindowEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FA494B094DE28B0078A329 /* ITCoreImageWindowEffect.h */; }; 37FA494E094DE28B0078A329 /* ITCoreImageWindowEffect.m in Sources */ = {isa = PBXBuildFile; fileRef = 37FA494C094DE28B0078A329 /* ITCoreImageWindowEffect.m */; }; @@ -220,6 +221,7 @@ 37B7F66E0754F87A0089C005 /* ITSplashWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ITSplashWindow.m; sourceTree = ""; }; 37B7F66F0754F87A0089C005 /* ITSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ITSplashScreen.m; sourceTree = ""; }; 37B7F6710754F87A0089C005 /* ITSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ITSplashScreen.h; sourceTree = ""; }; + 37D4861F09AE7C8300B68439 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 37FA493E094DE2650078A329 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; 37FA494B094DE28B0078A329 /* ITCoreImageWindowEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITCoreImageWindowEffect.h; sourceTree = ""; }; 37FA494C094DE28B0078A329 /* ITCoreImageWindowEffect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ITCoreImageWindowEffect.m; sourceTree = ""; }; @@ -330,6 +332,7 @@ 7CC84BE5054F6CAA001DC704 /* Carbon.framework in Frameworks */, 7C105BDC07D787C0002DE061 /* ITFoundation.framework in Frameworks */, 37FA493F094DE2650078A329 /* QuartzCore.framework in Frameworks */, + 37D4862009AE7C8300B68439 /* OpenGL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -403,6 +406,7 @@ 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( + 37D4861F09AE7C8300B68439 /* OpenGL.framework */, 37FA493E094DE2650078A329 /* QuartzCore.framework */, 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, 7CC84BE4054F6CAA001DC704 /* Carbon.framework */, diff --git a/ITWindowEffect.m b/ITWindowEffect.m index 300819d..b58a0fb 100644 --- a/ITWindowEffect.m +++ b/ITWindowEffect.m @@ -1,12 +1,14 @@ #import "ITWindowEffect.h" #import "ITTransientStatusWindow.h" - +#import +#import +#import @implementation ITWindowEffect + (NSArray *)effectClasses { - NSArray *classes = [NSArray arrayWithObjects: + NSMutableArray *classes = [NSArray arrayWithObjects: NSClassFromString(@"ITCutWindowEffect"), NSClassFromString(@"ITDissolveWindowEffect"), NSClassFromString(@"ITSlideHorizontallyWindowEffect"), @@ -15,9 +17,18 @@ NSClassFromString(@"ITZoomWindowEffect"), NSClassFromString(@"ITSpinWindowEffect"), NSClassFromString(@"ITSpinAndZoomWindowEffect"), - NSClassFromString(@"ITCoreImageWindowEffect"), nil]; - + + NSOpenGLView *view = [[NSOpenGLView alloc] initWithFrame:NSMakeRect(0, 0, 1, 1) pixelFormat:[NSOpenGLView defaultPixelFormat]]; + if ([view openGLContext]) { + NSString *string = [NSString stringWithCString:glGetString(GL_EXTENSIONS)]; + NSRange result = [string rangeOfString:@"ARB_fragment_program"]; + if (result.location != NSNotFound) { + [classes addObject:NSClassFromString(@"ITCoreImageWindowEffect")]; + } + } + [view release]; + return classes; } -- 2.20.1