Closed peter-r-g closed 1 year ago
Thanks for this - wasn't aware it was an issue as my main/default monitor is the one on the left.. so my window coordinates never become negative (unless I move the window off-screen).
This was caused by a breaking change in ImGui v1.89 - see here: https://github.com/ocornut/imgui/releases/tag/v1.89#:~:text=Instead%2C%20please-,submit%20an%20item,-%3A%0ABegin(...). Since we're getting the position of the main viewport and then moving the cursor based on that, the cursor position becomes negative when moving to the left of the default Windows monitor (eg. on dual-monitor setups where the main monitor is the one on the right).
When moving the main game window of Mocha to another monitor it causes a crash with the error:
Expression: 0 && "Code uses SetCursorPos()/SetCursorScreenPos() to extend window/parent boundaries."
https://user-images.githubusercontent.com/11802285/211881397-813127fd-5767-4174-8d1a-14f9ad4333ac.mp4