AggrorJorn Posted January 5, 2017 Share Posted January 5, 2017 So I ran a my winter game fullscreen for the first time and I noticed that my mouse position was of in comparison to the the UI. At first I though this was a problem with FlowGUI, but after some testing I saw some weird results when looking at the mouse position, I ran 2 test where I would print the mouse x coordinate when it was somewhere around the horizontal center of the screen. When using Titlebar + fulscreen, the mouse x returned: 1279 (It is a UHD screen so that value is correct). Then I proceeded to do the same thing with just Fulscreen. Now the center mouse x gives back the value: 1022. Is this a bug or am doing something wrong here? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted January 5, 2017 Share Posted January 5, 2017 To be honest, I don't understand the problem. You're talking about both vertical centering, including the titlebar and also horizontal centering (mouse x) so I'm confused. Maybe an image and a little code would help. That said, I assume you know that context and window return different widths and heights (not sure if you're using both). Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 5, 2017 Author Share Posted January 5, 2017 Sorry my mistake, I meant horizontal. My monitor has a resolution of 2560 x 1440. So the middle X mouse position would be 1280. When using Titlebar + FullScreen the value is around 1280. So that is correct. When using only FullScreen the value is 1022. Meaning the width of the screen would be around 2040, which is incorrect. I am aware of the small difference between context and window but these values are way off. 1 Quote Link to comment Share on other sites More sharing options...
aiaf Posted January 8, 2017 Share Posted January 8, 2017 I have a monitor resolution of 1920x1080, tested this on windows 10 Window is created 1920x1080 resolution no fullscreen, the windows is much bigger then the actual screen it continues to the right like another 1/4 of the screen. Width reported is 1904. I can see this with Alt-Space-M windows shortcut that let me move the window. When i go fullscreen is the same the right part of my game interface is not visible. Fullscreen width reported is 1920. Might be something similar to what was reported earlier Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
martyj Posted January 9, 2017 Share Posted January 9, 2017 What does Context::GetWidth() and Context::GetHeight show compared to Window::GetWidth() and Window::GetHeight()? 1 Quote Link to comment Share on other sites More sharing options...
aiaf Posted January 9, 2017 Share Posted January 9, 2017 -------------------------windowed fullscreenContext::GetWidth() 1904 1920 Window::GetWidth() 1920 1920 Context::GetHeight() 1041 1080 Window::GetHeight() 1080 1080 Mouse cursor width 960 height 540, looks ok. But its not, cursor is way off the middle of the physical screen. I will try on another computer i might find one with windows 7. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
aiaf Posted January 9, 2017 Share Posted January 9, 2017 I figured this out, its a windows 10 thing .. Go to Display Settings -> Change the size of text, apps, and other items I had it set to 125% and had those issues If i set it to 100% Leadwerks behaves as expected. 1 Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 9, 2017 Author Share Posted January 9, 2017 Thanks man. That is the problem. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 9, 2017 Share Posted January 9, 2017 So you guys changed the size of thing on win 10 and it caused this bug? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 9, 2017 Author Share Posted January 9, 2017 Yips. I have mine to 125 because I like the fonts a little bigger. Quote Link to comment Share on other sites More sharing options...
Rick Posted January 9, 2017 Share Posted January 9, 2017 If you don't notice issues with other games then I would think josh is missing considering this in Leadwerks perhaps? Must be a way from win API to get this info and do something with it? Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 9, 2017 Author Share Posted January 9, 2017 I sure hope so. I don't have problems like this in other (non-leadwerks) games. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 This is the SetMousePosition function on Windows: void Window::SetMousePosition(const float x, const float y) { POINT point; point.x = Math::Round(x); point.y = Math::Round(y); ClientToScreen(hwnd, &point); SetCursorPos(point.x, point.y); } Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 I tried setting my scaling to 125% in Windows 7 and Leadwerks still worked the same. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted January 12, 2017 Share Posted January 12, 2017 That would seem like ClientToScreen changed between the version then. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 I presently cannot test this because Windows 10 bricked itself during an update. It seems very strange that MS would change the behavior of basic API commands. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 Adding more info: https://msdn.microsoft.com/en-us/library/windows/desktop/ee671605(v=vs.85).aspx Default = 96 Note By default, the DWM does not perform scaling for non-dpi-aware applications when the user sets the dpi to 120, but does perform scaling when the dpi is set to a custom value of 144 or higher. However, the user can override the default behavior. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 I tried 150% on Windows 7 and it's working fine. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 12, 2017 Author Share Posted January 12, 2017 I can record a video of it if you want. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 12, 2017 Share Posted January 12, 2017 I believe you, I just can't do anything about it right this moment. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 13, 2017 Author Share Posted January 13, 2017 There is no rush. We have a work around for now. Quote Link to comment Share on other sites More sharing options...
Josh Posted January 13, 2017 Share Posted January 13, 2017 The problem is not the mouse coordinates. The problem is when you create a 1920x1080 fullscreen it is creating a larger window. The mouse is still being centered on the center of the window, but the window extends beyond the desktop edges. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 13, 2017 Share Posted January 13, 2017 Okay, I found if you create a 1280x720 window it works fine... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 13, 2017 Share Posted January 13, 2017 GetGraphicsMode() is spitting out the regular unscaled modes: 320 x 200 320 x 240 400 x 300 512 x 384 640 x 400 640 x 480 720 x 480 720 x 576 800 x 600 1024 x 768 1152 x 864 1280 x 600 1280 x 720 1280 x 768 1280 x 800 1280 x 960 1280 x 1024 1360 x 768 1366 x 768 1400 x 1050 1440 x 900 1600 x 900 1680 x 1050 1920 x 1080 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted January 13, 2017 Share Posted January 13, 2017 These commands have no effect: SetProcessDPIAware() SetProcessDpiAwareness(PROCESS_DPI_AWARENESS::PROCESS_SYSTEM_DPI_AWARE) SetProcessDpiAwareness(PROCESS_DPI_AWARENESS::PROCESS_DPI_UNAWARE) Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.