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

Function GetRelativeWindowOffset

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

Source from the content-addressed store, hash-verified

697}
698
699void GetRelativeWindowOffset(WindowType type, SDLWindow* parentWindow, Int2& positionOffset)
700{
701 if (!IsPopupWindow(type))
702 return;
703
704 SDLWindow* window = parentWindow;
705 while (window != nullptr)
706 {
707 Int2 parentPosition;
708 SDL_GetWindowPosition(window->GetSDLWindow(), &parentPosition.X, &parentPosition.Y);
709 positionOffset -= parentPosition;
710
711 if (!IsPopupWindow(window->GetSettings().Type))
712 break;
713
714 window = window->GetSettings().Parent;
715 }
716}
717
718Int2 GetSDLWindowScreenPosition(const SDLWindow* window)
719{

Callers 3

SDLWindowMethod · 0.85

Calls 3

IsPopupWindowFunction · 0.85
GetSDLWindowMethod · 0.80
GetSettingsMethod · 0.80

Tested by

no test coverage detected