| 256 | } |
| 257 | |
| 258 | int |
| 259 | SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode) |
| 260 | { |
| 261 | int result; |
| 262 | if(window == NULL || !SDL_IsShapedWindow(window)) |
| 263 | /* The window given was not a shapeable window. */ |
| 264 | return SDL_NONSHAPEABLE_WINDOW; |
| 265 | if(shape == NULL) |
| 266 | /* Invalid shape argument. */ |
| 267 | return SDL_INVALID_SHAPE_ARGUMENT; |
| 268 | |
| 269 | if(shape_mode != NULL) |
| 270 | window->shaper->mode = *shape_mode; |
| 271 | result = SDL_GetVideoDevice()->shape_driver.SetWindowShape(window->shaper,shape,shape_mode); |
| 272 | window->shaper->hasshape = SDL_TRUE; |
| 273 | if(window->shaper->userx != 0 && window->shaper->usery != 0) { |
| 274 | SDL_SetWindowPosition(window,window->shaper->userx,window->shaper->usery); |
| 275 | window->shaper->userx = 0; |
| 276 | window->shaper->usery = 0; |
| 277 | } |
| 278 | return result; |
| 279 | } |
| 280 | |
| 281 | static SDL_bool |
| 282 | SDL_WindowHasAShape(SDL_Window *window) |