How to check if aspect ratio auto adjustment is enabled in monitor
Game application is written in C++ and uses DirectX 8.
I am getting a maximum monitor resolution to calculate it's aspect ratio. Then I use this value to fix game rendering (scale and set clipping to receive normal 4:3 image with black borders on wide screen monitors).
How can I check if monitor is using aspect ratio auto adjustment 开发者_运维知识库now? Because my scaling plus monitor scaling makes resulting image overscaled.
Thanks
EDIT: I saw correct different monitor resolution handling with or without aspect ratio auto adjustment in "Royal Envoy" casual game. But don't know how do they do this.
Often this is implemented in the monitor itself, so the application would have no way to detect this case.
Note that you also need to handle the case where the monitor resolution is set to 1280x1024, which is 5:4 resolution using non-square pixels (where the display dimensions are still physically 4:3). Assuming your pixels are square is not always correct. (Although there's probably a way to query the OS or other window manager for this information.)
精彩评论