MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_SetWindowShape

Function SDL_SetWindowShape

deps/SDL2/src/video/SDL_shape.c:258–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258int
259SDL_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
281static SDL_bool
282SDL_WindowHasAShape(SDL_Window *window)

Callers 1

mainFunction · 0.85

Calls 3

SDL_IsShapedWindowFunction · 0.85
SDL_GetVideoDeviceFunction · 0.85
SDL_SetWindowPositionFunction · 0.85

Tested by 1

mainFunction · 0.68