[Commits] SDL: metal: Make sure layer drawableSize is adjusted on resize.

libsdl.org revision control commits-owner at libsdl.org
Wed Sep 5 21:58:36 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/c06be57c5a01
changeset: 12179:c06be57c5a01
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Thu Sep 06 00:56:13 2018 -0400
description:
metal: Make sure layer drawableSize is adjusted on resize.

Fixes Bugzilla #4250.

diffstat:

 src/render/metal/SDL_render_metal.m |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 3136903f2edc -r c06be57c5a01 src/render/metal/SDL_render_metal.m
--- a/src/render/metal/SDL_render_metal.m	Wed Sep 05 21:24:13 2018 -0400
+++ b/src/render/metal/SDL_render_metal.m	Thu Sep 06 00:56:13 2018 -0400
@@ -752,8 +752,12 @@
 static void
 METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
 {
-    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
-        event->event == SDL_WINDOWEVENT_SHOWN ||
+    if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
+        METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
+        data.mtllayer.drawableSize = CGSizeMake(event->data1, event->data2);
+    }
+
+    if (event->event == SDL_WINDOWEVENT_SHOWN ||
         event->event == SDL_WINDOWEVENT_HIDDEN) {
         // !!! FIXME: write me
     }


More information about the commits mailing list