mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-19 19:28:28 +00:00
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:
parent
195c26a50a
commit
b98e1e9ef0
7 changed files with 22 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue