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

Method PostHandleEvents

Source/Engine/Platform/SDL/SDLPlatform.Windows.cpp:151–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void SDLPlatform::PostHandleEvents()
152{
153 SDL_RemoveEventWatch(EventFilterCallback, &WinImpl::DraggedWindow);
154
155 // Handle window dragging release here
156 if (WinImpl::DraggedWindow != nullptr)
157 {
158 Float2 mousePosition;
159 auto buttons = SDL_GetGlobalMouseState(&mousePosition.X, &mousePosition.Y);
160
161 // Send simulated mouse up event
162 SDL_Event buttonUpEvent { 0 };
163 buttonUpEvent.motion.type = SDL_EVENT_MOUSE_BUTTON_UP;
164 buttonUpEvent.button.down = false;
165 buttonUpEvent.motion.windowID = SDL_GetWindowID(WinImpl::DraggedWindow->GetSDLWindow());
166 buttonUpEvent.motion.timestamp = SDL_GetTicksNS();
167 buttonUpEvent.motion.state = SDL_BUTTON_LEFT;
168 buttonUpEvent.button.clicks = 1;
169 buttonUpEvent.motion.x = mousePosition.X;
170 buttonUpEvent.motion.y = mousePosition.Y;
171 WinImpl::DraggedWindow->HandleEvent(buttonUpEvent);
172 WinImpl::DraggedWindow = nullptr;
173 }
174}
175
176bool SDLWindow::HandleEventInternal(SDL_Event& event)
177{

Callers

nothing calls this directly

Calls 2

GetSDLWindowMethod · 0.80
HandleEventMethod · 0.45

Tested by

no test coverage detected