24 #if SDL_VIDEO_DRIVER_COCOA
29 #include "../SDL_sysvideo.h"
37 if ([windata->
nswindow respondsToSelector:
@selector(setStyleMask:)]) {
38 [windata->nswindow setStyleMask:NSBorderlessWindowMask];
50 data->
context = [windata->nswindow graphicsContext];
67 SDL_CocoaClosure* data = (SDL_CocoaClosure*)closure;
70 [data->path appendBezierPathWithRect:[data->view convertRect:rect toView:nil]];
78 SDL_CocoaClosure closure;
79 NSAutoreleasePool *pool =
NULL;
81 [data->context restoreGraphicsState];
87 [NSGraphicsContext setCurrentContext:data->context];
89 [[NSColor clearColor] set];
90 NSRectFill([[windata->
nswindow contentView] frame]);
93 pool = [[NSAutoreleasePool alloc] init];
94 closure.view = [windata->nswindow contentView];
95 closure.path = [[NSBezierPath bezierPath] autorelease];
96 closure.window = shaper->
window;
98 [closure.path addClip];
SDL_ShapeTree * SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape)
A collection of pixels used in software blitting.
GLsizei const GLchar *const * path
int Cocoa_SetWindowShape(SDL_WindowShaper *shaper, SDL_Surface *shape, SDL_WindowShapeMode *shape_mode)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
SDL_WindowShaper * shaper
SDL_WindowShaper * Cocoa_CreateShaper(SDL_Window *window)
The default mode, a binarized alpha cutoff of 1.
SDL_WindowShapeParams parameters
Window-shape parameters.
#define SDL_assert(condition)
void SDL_TraverseShapeTree(SDL_ShapeTree *tree, SDL_TraversalFunction function, void *closure)
int Cocoa_ResizeWindowShape(SDL_Window *window)
NSGraphicsContext * context
Uint8 binarizationCutoff
a cutoff alpha value for binarization of the window shape's alpha channel.
A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents...
WindowShapeMode mode
The mode of these window-shape parameters.