Skip to content

gdkglcontext-win32.c: Fix running with Mesa drivers

Chun-wei Fan requested to merge mesa.win32-4.0 into gtk-4.0

Hi,

From the commit message:

Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on a given HDC if one pixel format has been already set for it, so first check the HDC with GetPixelFormat() to see whether a pixel format has already been set with the HDC, and only attempt to acquire the pixel format if one has not been set.

This will fix running with GL on Windows using the Mesa drivers.

With blessings, thank you!

Merge request reports