elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.27k stars 90 forks source link

Cursor issue when scaling video with dd7to9 #176

Open nicklemarr opened 1 year ago

nicklemarr commented 1 year ago

I am using latest release. All DDraw games I test, running in (equivalent) borderless window mode with the following boolean'd true.

DdrawUseNativeResolution DdrawMaintainAspectRatio EnableWindowMode FullscreenWindowMode

Results in expected behavior for video buffer, but mouse being confined to game starts at top-left 0x0 pixel following correct resolution. I have tried Intel UHD 630, nVidia GTX 1070 Ti, and Radeon R5. All three branches exibit same behavior, Anything we can do, or it's for DD7to9 team?

elishacloud commented 1 year ago

Yes, depending on how the game detects mouse movement or how the mouse cursor appears this could be an issue. I am already aware of this issue.

At this point I just scale the video. That works for many games. However, for some games I would need to scale the mouse along with the video. I am not sure how much work that would be.

I have not looked into this much at this point because it is not a key focus for this project. I'm really just focused on getting the games to work natively, without enhancements, like scaling. However, I may try and look into this just to see how much work it would be. If it is easy I may add it to an update.

nicklemarr commented 1 year ago

Well, first off thank you for your attention, time, and response. I've been using your hard work for a long time. I will say, that I don't count scaling the video a solution, for myself personally. The best solution for me, when this occurs, is under "Behavior" in dgVoodoo2. There's an application controlled fullscreen/windowed state. If you uncheck it, and let dgVoodoo2 control it, their implementation is working, when running borderless fullscreen equivalent config. I'm not sure if it's a faux pas to bring up other projects or implying anything, but maybe you could get inspiration from their method. I understand that it's not a priority for you, but it is for me, so it behooves me to try and get it solved. The overhead on your programming is so low, I prefer to use it. I must respect your focus on your work obviously, but I have been silent for a long time. Maybe others have the same feelings as I to put it higher up on the list.

(PS: To be clear, when you say scale the video, you mean, back to top left?)

mirh commented 1 year ago

Take note borderless behavior is wildly different between d3d9 and d3d11 to begin with.

elishacloud commented 1 year ago

To be clear, when you say scale the video, you mean, back to top left?

The following options in dxwrapper will scale the video:

DdrawUseNativeResolution
DdrawOverrideWidth
DdrawOverrideHeight

Scaling the video means displaying the graphics at a higher (or lower) resolution to what the game is actually outputting. For example, if the game is outputting 640x480 and you enable DdrawUseNativeResolution then you are scaling the game up to whatever resolution your desktop is using.

To prevent dxwrapper from scaling the video you can just make sure to disable those three options.

I'm not sure if it's a faux pas to bring up other projects or implying anything, but maybe you could get inspiration from their method.

Unfortunately, I cannot look at dgVoodoo2 since it is not open source. There is no code to look at. But I do have some example code I can check out online.

The overhead on your programming is so low, I prefer to use it.

Thanks! Glad to hear it. I have tried to make my code convert call-for-call from DirectDraw to Direct3D9 to make the overhead as small as possible.

elishacloud commented 1 year ago

Related to #91