mirror of https://github.com/encounter/SDL.git
metal: Make sure layer drawableSize is adjusted on resize.
Fixes Bugzilla #4250.
This commit is contained in:
parent
0cf1ae9d0b
commit
264b81b481
|
@ -752,8 +752,12 @@ METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load)
|
||||||
static void
|
static void
|
||||||
METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
||||||
{
|
{
|
||||||
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED ||
|
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
|
||||||
event->event == SDL_WINDOWEVENT_SHOWN ||
|
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) {
|
event->event == SDL_WINDOWEVENT_HIDDEN) {
|
||||||
// !!! FIXME: write me
|
// !!! FIXME: write me
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue