comparison src/video/cocoa/SDL_cocoashape.m @ 4833:34fb492cefe3

Shaped windows for Cocoa build and testshape runs, but the actual shaping doesn't work. Something, however, is definitely happening, because we get the backgrounds drawn in two different colors.
author egottlieb
date Thu, 05 Aug 2010 01:03:24 -0400
parents 0c82f20327ec
children fd5bb97ec05d
comparison
equal deleted inserted replaced
4832:0c82f20327ec 4833:34fb492cefe3
18 18
19 Eli Gottlieb 19 Eli Gottlieb
20 eligottlieb@gmail.com 20 eligottlieb@gmail.com
21 */ 21 */
22 22
23 #include "SDL_assert.h"
23 #include "SDL_stdinc.h" 24 #include "SDL_stdinc.h"
24 #include "SDL_cocoavideo.h" 25 #include "SDL_cocoavideo.h"
25 #include "SDL_shape.h" 26 #include "SDL_shape.h"
26 #include "SDL_cocoashape.h" 27 #include "SDL_cocoashape.h"
27 #include "../SDL_sysvideo.h" 28 #include "../SDL_sysvideo.h"
79 80
80 //[[NSColor clearColor] set]; 81 //[[NSColor clearColor] set];
81 //NSRectFill([[((SDL_WindowData*)shaper->window->driverdata)->nswindow contentView] frame]); 82 //NSRectFill([[((SDL_WindowData*)shaper->window->driverdata)->nswindow contentView] frame]);
82 /* TODO: It looks like Cocoa can set a clipping path based on a list of rectangles. That's what we get from the 83 /* TODO: It looks like Cocoa can set a clipping path based on a list of rectangles. That's what we get from the
83 Windoze shape-calculation code: a list of rectangles. This will work... I think. */ 84 Windoze shape-calculation code: a list of rectangles. This will work... I think. */
85 data->shape = SDL_CalculateShapeTree(*shapeMode,shape,SDL_FALSE);
84 NSBezierPath* clipPath = [NSBezierPath bezierPath]; 86 NSBezierPath* clipPath = [NSBezierPath bezierPath];
85 87
86 SDL_PathConglomeration cong = {clipPath,shaper->window}; 88 SDL_PathConglomeration cong = {clipPath,shaper->window};
87 89
88 SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong); 90 SDL_TraverseShapeTree(data->shape,(SDL_TraversalFunction)&ConglomerateShapeTree,(void*)&cong);