Renamed "Core Image - Ripple" to "Ripple"
authorKent Sutherland <ksuther@ithinksw.com>
Thu, 23 Feb 2006 23:30:47 +0000 (23:30 +0000)
committerKent Sutherland <ksuther@ithinksw.com>
Thu, 23 Feb 2006 23:30:47 +0000 (23:30 +0000)
Ripple effect added to effects list only if CoreImage acceleration is available.

ITCoreImageWindowEffect.m
ITKit.xcodeproj/project.pbxproj
ITWindowEffect.m

index ea68c84..afef08f 100644 (file)
@@ -20,7 +20,7 @@ static BOOL _running = NO;
 
 + (NSString *)effectName
 {
-    return @"Core Image - Ripple";
+    return @"Ripple";
 }
 
 + (NSDictionary *)supportedPositions
index 692d4ee..a02dc4c 100644 (file)
@@ -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 */; };
                37B7F66E0754F87A0089C005 /* ITSplashWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ITSplashWindow.m; sourceTree = "<group>"; };
                37B7F66F0754F87A0089C005 /* ITSplashScreen.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ITSplashScreen.m; sourceTree = "<group>"; };
                37B7F6710754F87A0089C005 /* ITSplashScreen.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ITSplashScreen.h; sourceTree = "<group>"; };
+               37D4861F09AE7C8300B68439 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
                37FA493E094DE2650078A329 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
                37FA494B094DE28B0078A329 /* ITCoreImageWindowEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ITCoreImageWindowEffect.h; sourceTree = "<group>"; };
                37FA494C094DE28B0078A329 /* ITCoreImageWindowEffect.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ITCoreImageWindowEffect.m; sourceTree = "<group>"; };
                                7CC84BE5054F6CAA001DC704 /* Carbon.framework in Frameworks */,
                                7C105BDC07D787C0002DE061 /* ITFoundation.framework in Frameworks */,
                                37FA493F094DE2650078A329 /* QuartzCore.framework in Frameworks */,
+                               37D4862009AE7C8300B68439 /* OpenGL.framework in Frameworks */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               37D4861F09AE7C8300B68439 /* OpenGL.framework */,
                                37FA493E094DE2650078A329 /* QuartzCore.framework */,
                                1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
                                7CC84BE4054F6CAA001DC704 /* Carbon.framework */,
index 300819d..b58a0fb 100644 (file)
@@ -1,12 +1,14 @@
 #import "ITWindowEffect.h"
 #import "ITTransientStatusWindow.h"
-
+#import <OpenGL/gl.h>
+#import <OpenGL/glu.h>
+#import <OpenGL/glext.h>
 
 @implementation ITWindowEffect
 
 + (NSArray *)effectClasses
 {
-    NSArray *classes = [NSArray arrayWithObjects:
+    NSMutableArray *classes = [NSArray arrayWithObjects:
         NSClassFromString(@"ITCutWindowEffect"),
         NSClassFromString(@"ITDissolveWindowEffect"),
         NSClassFromString(@"ITSlideHorizontallyWindowEffect"),
         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;
 }