Fixed the render viewport not updating when the metal view resizes

When the phone is in portrait mode and the window is in landscape mode, the view changes orientation after layoutSubviews runs. In this case we need some way of notifying the application that the Metal view has changed.
This commit is contained in:
Sam Lantinga 2024-07-24 15:10:15 -07:00
parent 195c26a50a
commit b98e1e9ef0
7 changed files with 22 additions and 2 deletions

View file

@ -830,7 +830,8 @@ static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
}
if (event->type == SDL_EVENT_WINDOW_RESIZED ||
event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) {
event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED ||
event->type == SDL_EVENT_WINDOW_METAL_VIEW_RESIZED) {
UpdateMainViewDimensions(renderer);
UpdateLogicalPresentation(renderer);
} else if (event->type == SDL_EVENT_WINDOW_HIDDEN) {