[PATCH 1/2] wined3d: Only use default SetPixelFormat on private windows.

Connor McAdams cmcadams at codeweavers.com
Fri Apr 16 15:34:30 CDT 2021


On Fri, Apr 16, 2021 at 04:01:25PM -0400, Connor McAdams wrote:
> Only use the default SetPixelFormat function if the format is unset and
> the window is private. If the window isn't private, use
> wglSetPixelFormatWINE, which allows for another application to change
> the pixel format.
> 
> Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
> ---
> I'm not sure if this is the correct way to do this, so you'll have to
> let me know if there's a better way. Currently, the application I'm
> trying to get work sets the pixel format after wined3d's initial format
> set. So, in this case, I'm assuming it'd make sense to only use the
> default SetPixelFormat if we know the window is private to wined3d.
> ---
>  dlls/wined3d/context_gl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
> index 123214afd5d..bbed7f46875 100644
> --- a/dlls/wined3d/context_gl.c
> +++ b/dlls/wined3d/context_gl.c
> @@ -1196,7 +1196,7 @@ static BOOL wined3d_context_gl_set_pixel_format(struct wined3d_context_gl *conte
>      current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc);
>      if (current == format) goto success;
>  
> -    if (!current)
> +    if (!current && private)
>      {
>          if (!SetPixelFormat(dc, format, NULL))
>          {
> -- 
> 2.25.1
> 
Actually, I think this is a bad idea, it'd be better to check for
private inside of the 'if (!current)' check and switch between the two
functions there. I'll fix it and send a v2.



More information about the wine-devel mailing list