MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / CheckForWindowResize

Method CheckForWindowResize

Source/Engine/Platform/SDL/SDLWindow.cpp:955–982  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

953}
954
955void SDLWindow::CheckForWindowResize()
956{
957 return;
958 // Cache client size
959 _clientSize = GetClientSize();
960 int32 width = (int32)(_clientSize.X);
961 int32 height = (int32)(_clientSize.Y);
962
963 // Check for windows maximized size and see if it needs to adjust position if needed
964 if (_maximized)
965 {
966 // Pick the current monitor data for sizing
967 SDL_Rect rect;
968 auto displayId = SDL_GetDisplayForWindow(_window);
969 SDL_GetDisplayUsableBounds(displayId, &rect);
970
971 if (width > rect.w && height > rect.h)
972 {
973 width = rect.w;
974 height = rect.h;
975 SDL_SetWindowSize(_window, width, height);
976 }
977 }
978
979 // Check if window size has been changed
980 if (width > 0 && height > 0 && (_swapChain == nullptr || width != _swapChain->GetWidth() || height != _swapChain->GetHeight()))
981 OnResize(width, height);
982}
983
984void SDLWindow::UpdateCursor()
985{

Callers

nothing calls this directly

Calls 3

GetClientSizeFunction · 0.85
GetWidthMethod · 0.80
GetHeightMethod · 0.45

Tested by

no test coverage detected