Am Freitag, 7. März 2008 22:29:01 schrieb Denver Gingerich:
The DirectX refresh rate override feature that this patch implements is described in main.c below.
In order for the override to take effect only on SetDisplayMode and not on RestoreDisplayMode it was necessary to move the functionality of SetDisplayMode into a helper function (DDRAW_SetDisplayMode) and let IDirectDrawImpl_SetDisplayMode and IDirectDrawImpl_RestoreDisplayMode call the helper function.
I have two concerns:
First, do you have an application that needs this, or is this just for making this aspect of ddraw compatible with Windows? There's nothing wrong with that in principle, but I am curious
I do not really like the name DDRAW_SetDisplayMode. It somewhat goes away from the convention by starting with DDRAW, but yet it does not tell more about what the function does.
On Fri, Mar 7, 2008 at 6:14 PM, Stefan Dösinger stefan@codeweavers.com wrote:
Am Freitag, 7. März 2008 22:29:01 schrieb Denver Gingerich:
The DirectX refresh rate override feature that this patch implements is described in main.c below.
In order for the override to take effect only on SetDisplayMode and not on RestoreDisplayMode it was necessary to move the functionality of SetDisplayMode into a helper function (DDRAW_SetDisplayMode) and let IDirectDrawImpl_SetDisplayMode and IDirectDrawImpl_RestoreDisplayMode call the helper function.
I have two concerns:
First, do you have an application that needs this, or is this just for making this aspect of ddraw compatible with Windows? There's nothing wrong with that in principle, but I am curious
I described my reasoning to some extent in the following message/threads: http://www.winehq.org/pipermail/wine-patches/2008-March/050965.html http://www.winehq.org/pipermail/wine-devel/2008-March/063147.html
Basically, I am running an application that calls SetDisplayMode and doesn't specify a refresh rate. ChangeDisplaySettingsEx picks the first mode that matches the bpp, and resolution, and that mode just so happens to have a bad refresh rate for me. So I want a way to override it.
I do not really like the name DDRAW_SetDisplayMode. It somewhat goes away from the convention by starting with DDRAW, but yet it does not tell more about what the function does.
I modeled this after DDRAW_Create in dlls/ddraw/main.c. It seemed like using a DDRAW_ prefix might specify a helper function so I went with it. But I will admit it didn't seem that standard.
I couldn't really think of anything better than SetDisplayMode for a suffix. Setting the display mode is what it does, after all. I could rename it to something like SetDisplayModeHelper. Does that seem reasonable? Are there other suggestions?
Denver
Am Samstag, 8. März 2008 00:52:23 schrieb Denver Gingerich:
Basically, I am running an application that calls SetDisplayMode and doesn't specify a refresh rate. ChangeDisplaySettingsEx picks the first mode that matches the bpp, and resolution, and that mode just so happens to have a bad refresh rate for me. So I want a way to override it.
Fair enough. I can't argue that using this key for that is wrong, since it exists as-is on Windows, but it doesn't really attack the root of the problem. You'll run into the same issue again with d3d8/9 apps or apps that use ChangeDisplaySettingsEx directly with a refresh rate of 0
On Sat, Mar 8, 2008 at 5:33 AM, Stefan Dösinger stefan@codeweavers.com wrote:
Am Samstag, 8. März 2008 00:52:23 schrieb Denver Gingerich:
Basically, I am running an application that calls SetDisplayMode and doesn't specify a refresh rate. ChangeDisplaySettingsEx picks the first mode that matches the bpp, and resolution, and that mode just so happens to have a bad refresh rate for me. So I want a way to override it.
Fair enough. I can't argue that using this key for that is wrong, since it exists as-is on Windows, but it doesn't really attack the root of the problem. You'll run into the same issue again with d3d8/9 apps or apps that use ChangeDisplaySettingsEx directly with a refresh rate of 0
The problem is that Windows doesn't attack the root of the problem so Wine can't either. The previous patch I sent [1] changed the behavior of ChangeDisplaySettingsEx and even allowed you to customize the refresh rate at different resolutions, which I felt was attacking the root of the problem. But since Windows doesn't do it that way, the patch was rejected.
Some limited testing has revealed that Windows usually picks the first mode that matches the bpp and resolution when no refresh rate is given to ChangeDisplaySettingsEx. I will post the complete results of my tests when I get around to it.
The only way I've found to force a refresh rate for a program that uses ChangeDisplaySettingsEx is to change the available refresh rates of the monitor, which is essentially changing the list of modes available. Changing the list of modes is not something Wine handles. Rather, it's up to the libraries it uses (like Xrandr) to modify the mode list.
So I think we're stuck with leaving ChangeDisplaySettingsEx as it is and implementing what hacks Windows has for DirectX applications so that we can at least get a partial fix.
Denver
1. http://www.winehq.org/pipermail/wine-patches/2008-March/050965.html