metal: Make sure layer drawableSize is adjusted on resize.

Fixes Bugzilla #4250.
This commit is contained in:
Ryan C. Gordon 2018-09-06 00:56:13 -04:00
parent 0cf1ae9d0b
commit 264b81b481
1 changed files with 6 additions and 2 deletions

View File

@ -752,8 +752,12 @@ METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load)
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
}