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

Method WndProc

Source/Engine/Platform/Windows/WindowsWindow.cpp:879–1321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879LRESULT WindowsWindow::WndProc(UINT msg, WPARAM wParam, LPARAM lParam)
880{
881 const UINT_PTR MouseStopTimerID = 1;
882 switch (msg)
883 {
884 case WM_PAINT:
885 {
886 // Check if window is during resizing
887 if (_isResizing && _swapChain)
888 {
889 // Redraw window backbuffer on DX11
890 switch (GPUDevice::Instance->GetRendererType())
891 {
892 case RendererType::DirectX10:
893 case RendererType::DirectX10_1:
894 case RendererType::DirectX11:
895 _swapChain->Present(false);
896 break;
897 }
898 }
899 break;
900 }
901 case WM_TIMER:
902 {
903 if (wParam == MouseStopTimerID)
904 {
905 // Kill the timer after processing it
906 KillTimer(_handle, MouseStopTimerID);
907 return 0;
908 }
909 break;
910 }
911 case WM_SETCURSOR:
912 {
913 if (LOWORD(lParam) == HTCLIENT)
914 {
915 UpdateCursor();
916 return true;
917 }
918 break;
919 }
920 case WM_MOUSEMOVE:
921 {
922 if (!_trackingMouse)
923 {
924 TrackMouse(_handle);
925 _trackingMouse = true;
926 }
927
928 if (_isTrackingMouse)
929 {
930 KillTimer(_handle, MouseStopTimerID);
931 SetTimer(_handle, MouseStopTimerID, 100, nullptr);
932 }
933
934 // Here we can transfer mouse pointer over virtual workspace
935 if (_isTrackingMouse && _isUsingMouseOffset)
936 {

Callers

nothing calls this directly

Calls 13

TrackMouseFunction · 0.85
ClientToScreenFunction · 0.85
ScreenToClientFunction · 0.85
IsWindowMaximizedFunction · 0.85
RestoreFunction · 0.85
MaximizeFunction · 0.85
IsCompositionEnabledFunction · 0.85
Float2Class · 0.85
WndProcFunction · 0.70
NearEqualFunction · 0.50
AbsFunction · 0.50
PresentMethod · 0.45

Tested by

no test coverage detected