Open Athari opened 4 years ago
I've messed with this too, more for making fullscreen programs run in a window, and ran into big problems quickly. For example, I got Loderunner 3 into a movable window but found it uses screen relative mouse positions so the moment the window is moved it registers mouse clicks in the wrong place or ignores them entirely. Building upscaling into winevdm would be a huge task. Almost everything would be affected: window coordinates, gdi drawing commands, text size, mouse coordinates. If a window has children, those would also have to be scaled and adjusted. As you say, it would be nice if windows supported this natively especially with the compositor making it almost free at least for drawing.
I've put a pr to add support for reading the compatibility mode from the registry for 640x480 screen size. Loderunner 3 is scaled properly with integerscaler but it forces the window to be centered which messes up the mouse inputs. It would probably work fine if it would magnify the window in place.
There're a few solutions for upscaling applications (free IntegerScaler, paid Lossless Scaling) which use Windows Magnification API. However, there're a few problems with this.
The first problem is that scaling isn't built into WineVDM, so it's necessary to configure multiple apps to run the needed app. Second, some apps aren't very friendly with this approach. In particular, the game I'm running (Disney Animated Storybooks) create a full-screen window, then draw 640x480 in the center. Upscalers think that scaling is unnecessary and do nothing.
I've had success with running The Lion King Animated Storybook with IntegerScaler by lying about screen resolution in
GetSystemMetrics
.The upscalers use undocumented Magnification API functions (
MagSetFullscreenUseBitmapSmoothing
andMagSetLensUseBitmapSmoothing
) to switch between usual upscaling (somewhat similar to hqx/xbrz algorithms, so pretty good for apps and pixel art) and nearest neighboor. There was a function for custom upscaling, but now it's deprecated apparently. There's also a function for transforming colors, but this doesn't seem very useful for us.So... There're a few options.
Add functionality to lie about screen resolution, rely on external apps for upscaling. Options may seem weird in .ini config, but it's enough.
Build upscaling into WineVDM, with setting both source and target resolution, and changing of upscaling mode.
In either case allowing users to completely bypass even
ChangeDisplaySettings
is also an option. Windows still messes up windows of apps when changing resolutions, alt-tabbing becomes a pain, so allowing to change resolution "virtually" can be of great help. (I don't have any apps that do change resolution, so it's theoretical.)A lot of older apps, especially games, are optimized for low resolutions, so I think it would be a very useful feature. Upscaling is built into pretty much all console emulators. It's a pity there's no way to scale native windows apps with such freedom, but this approach is at least something.