[PATCH v2 3/6] wined3d: Move fullscreen window setup/restore to new struct and functions.

cmccarthy at codeweavers.com cmccarthy at codeweavers.com
Tue Jun 25 08:29:04 CDT 2019


June 25, 2019 9:54 PM, "Józef Kucia" <joseph.kucia at gmail.com> wrote:
> This patch can be made much smaller. Just put the new functions, e.g.
> wined3d_fullscreen_setup_window(), in the place where old functions
> were. In result, you will get a few renames and removal of
> "filter_messages". Moving functions to the end of the file is not
> necessary.
> 
>> - /* Window styles to restore when switching fullscreen mode */
>> - LONG style;
>> - LONG exStyle;
>> + struct wined3d_fullscreen_state fullscreen_state;
> 
> The fullscreen_state should probably be moved to wined3d swapchain.

I kept wined3d_device_setup_fullscreen_window() and its opposite as wrappers because they are used elsewhere, for example ddraw calls them, but the swapchain pointer in struct ddraw can be null which makes it complicated. Rather than change all calls to these functions it was simpler to make it call a helper that D3D12 can use too.

> 
>> +struct wined3d_fullscreen_state
>> +{
>> + /* Window styles to restore when switching fullscreen mode */
>> + LONG style;
>> + LONG exStyle;
>> +};
> 
> It might be better to not expose implementation details and make
> wined3d_fullscreen_state opaque.

D3D12 needs to declare one in d3d12_swapchain. It could be made opaque if dynamically allocated instead, but that seems excessive.

Conor



More information about the wine-devel mailing list