mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-03-03 05:54:19 +01:00
Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms.
This commit is contained in:
parent
545fba7886
commit
00394996eb
@ -35,6 +35,10 @@ SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned
|
|||||||
SDL_Window *result = NULL;
|
SDL_Window *result = NULL;
|
||||||
result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */);
|
result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */);
|
||||||
if(result != NULL) {
|
if(result != NULL) {
|
||||||
|
if (SDL_GetVideoDevice()->shape_driver.CreateShaper == NULL) {
|
||||||
|
SDL_DestroyWindow(result);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result);
|
result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result);
|
||||||
if(result->shaper != NULL) {
|
if(result->shaper != NULL) {
|
||||||
result->shaper->userx = x;
|
result->shaper->userx = x;
|
||||||
|
Loading…
Reference in New Issue
Block a user