Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-Game: [Windows] application_surface dimensions do not match window_get_height/width() values after player manually resizes the game window #6440

Closed
gm-bug-reporter bot opened this issue Jun 28, 2024 · 1 comment
Assignees
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes

Comments

@gm-bug-reporter
Copy link

Description

Using application_get_position and summing the position plus dimensions of the app surface, you would expect those values to match what is reported by window_get_width and window_get_height

This is demonstrably false after updating the window size via resize handles and comparing the returned values. This may come down to rounding errors though as the integer values are returned, meaning some sort of truncation could be yielding an off by 1 (sometimes 2) error.

Steps To Reproduce

Enable the ability to resize the window in the game options for the windows target, under the graphics option.

Create an object that prints the window width and height.

use application_get_position and sum indices [0] and [2] to calculate the width, and [1] and [3] to calculate the height.

Print those values out, and compare them to the other printed values.

Prior to updating the window size, these values will be equal.

resize the window.

Compare the values now and see they are off by either 1 or 2.

Optionally run the included project and update the window, then compare

Which version of GameMaker are you reporting this issue for?

IDE v2024.4.0.137 Runtime v2024.4.0.168

Which operating system(s) are you seeing the problem on?

Windows 10.0.19045.0

Which platform(s) are you seeing the problem on?

Windows

7552081e-13aa-43c0-ae4a-8c38e3c313fa

@gm-bug-reporter gm-bug-reporter bot added project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes labels Jun 28, 2024
@YYDan YYDan changed the title App Surface dimensions do not match the reported window dimensions on Windows n-Game: [Windows] application_surface dimensions do not match window_get_height/width() values after player manually resizes the game window Jul 1, 2024
@YYDan YYDan changed the title n-Game: [Windows] application_surface dimensions do not match window_get_height/width() values after player manually resizes the game window In-Game: [Windows] application_surface dimensions do not match window_get_height/width() values after player manually resizes the game window Jul 1, 2024
@jackerley jackerley self-assigned this Jul 1, 2024
@jackerley jackerley moved this from Triage to Backlog in Team Workload Jul 1, 2024
@jackerley
Copy link

This is just the result of the application_surface being rendered at integer coordinates, consider a 1366x768 application surface being rendered in a 1769x768 window, it'll be rendered at 152,0 to 1518,768 so you have a 152 pixel left border, 1366 pixels of application surface and then a 151 pixel right border (152+1366+151=1669) so when you're adding the left border to the width as you are in your sample you won't get the width, you'll get one more than the width, you get 1670

Hope this helps,
Fritz

@jackerley jackerley closed this as not planned Won't fix, can't repro, duplicate, stale Dec 4, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Team Workload Dec 4, 2024
@YYBartT YYBartT moved this from Done to Ready for QA in Team Workload Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project This issue has a sample project attached runner-bug In-game bugs with the "GameMaker Studio 2" runtimes
Projects
Status: Ready for QA
Development

No branches or pull requests

1 participant