diff options
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index 3d9d98d1..a687350c 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -380,6 +380,7 @@ static void drawBlank_Window_(iWindow *d) { | |||
380 | 380 | ||
381 | void init_Window(iWindow *d, iRect rect) { | 381 | void init_Window(iWindow *d, iRect rect) { |
382 | theWindow_ = d; | 382 | theWindow_ = d; |
383 | iZap(d->cursors); | ||
383 | d->isDrawFrozen = iTrue; | 384 | d->isDrawFrozen = iTrue; |
384 | uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; | 385 | uint32_t flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; |
385 | #if defined (iPlatformApple) | 386 | #if defined (iPlatformApple) |
@@ -442,6 +443,11 @@ void deinit_Window(iWindow *d) { | |||
442 | if (theWindow_ == d) { | 443 | if (theWindow_ == d) { |
443 | theWindow_ = NULL; | 444 | theWindow_ = NULL; |
444 | } | 445 | } |
446 | iForIndices(i, d->cursors) { | ||
447 | if (d->cursors[i]) { | ||
448 | SDL_FreeCursor(d->cursors[i]); | ||
449 | } | ||
450 | } | ||
445 | iReleasePtr(&d->root); | 451 | iReleasePtr(&d->root); |
446 | deinit_Text(); | 452 | deinit_Text(); |
447 | SDL_DestroyRenderer(d->render); | 453 | SDL_DestroyRenderer(d->render); |
@@ -564,6 +570,13 @@ void setFreezeDraw_Window(iWindow *d, iBool freezeDraw) { | |||
564 | d->isDrawFrozen = freezeDraw; | 570 | d->isDrawFrozen = freezeDraw; |
565 | } | 571 | } |
566 | 572 | ||
573 | void setCursor_Window(iWindow *d, int cursor) { | ||
574 | if (!d->cursors[cursor]) { | ||
575 | d->cursors[cursor] = SDL_CreateSystemCursor(cursor); | ||
576 | } | ||
577 | SDL_SetCursor(d->cursors[cursor]); | ||
578 | } | ||
579 | |||
567 | iInt2 rootSize_Window(const iWindow *d) { | 580 | iInt2 rootSize_Window(const iWindow *d) { |
568 | return d->root->rect.size; | 581 | return d->root->rect.size; |
569 | } | 582 | } |