Skip to content

gdkglcontext-win32.c: Fix running with Mesa drivers

Chun-wei Fan requested to merge mesa.win32.fixes into master

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/NGL on Windows using the Mesa drivers.

With blessings, thank you!

Merge request reports