src/video/cocoa/SDL_cocoashape.m
changeset 4833 34fb492cefe3
parent 4832 0c82f20327ec
child 4834 fd5bb97ec05d
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);