| | |
| | | misrepresented as being the original software. |
| | | 3. This notice may not be removed or altered from any source distribution. |
| | | */ |
| | | |
| | | #include "../../SDL_internal.h" |
| | | |
| | | #if SDL_VIDEO_DRIVER_COCOA |
| | |
| | | #include "SDL_shape.h" |
| | | #include "SDL_cocoashape.h" |
| | | #include "../SDL_sysvideo.h" |
| | | #include "SDL_assert.h" |
| | | |
| | | SDL_WindowShaper* |
| | | Cocoa_CreateShaper(SDL_Window* window) |
| | |
| | | |
| | | [windata->nswindow setStyleMask:NSWindowStyleMaskBorderless]; |
| | | |
| | | SDL_WindowShaper* result = result = malloc(sizeof(SDL_WindowShaper)); |
| | | SDL_WindowShaper* result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper)); |
| | | result->window = window; |
| | | result->mode.mode = ShapeModeDefault; |
| | | result->mode.parameters.binarizationCutoff = 1; |
| | | result->userx = result->usery = 0; |
| | | window->shaper = result; |
| | | |
| | | SDL_ShapeData* data = malloc(sizeof(SDL_ShapeData)); |
| | | SDL_ShapeData* data = (SDL_ShapeData *)SDL_malloc(sizeof(SDL_ShapeData)); |
| | | result->driverdata = data; |
| | | data->context = [windata->nswindow graphicsContext]; |
| | | data->saved = SDL_FALSE; |
| | |
| | | [NSGraphicsContext setCurrentContext:data->context]; |
| | | |
| | | [[NSColor clearColor] set]; |
| | | NSRectFill([[windata->nswindow contentView] frame]); |
| | | NSRectFill([windata->sdlContentView frame]); |
| | | data->shape = SDL_CalculateShapeTree(*shape_mode,shape); |
| | | |
| | | closure.view = [windata->nswindow contentView]; |
| | | closure.view = windata->sdlContentView; |
| | | closure.path = [NSBezierPath bezierPath]; |
| | | closure.window = shaper->window; |
| | | SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure); |