mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-20 22:07:54 +00:00
Add DrawToWindow and SupportOpenGL flags to GetModesARB and check whether Wgl.Arb.ChoosePixelFormat() worked correctly (to avoid undefined results).
This commit is contained in:
parent
f4a7bf2a93
commit
d19244feb5
|
@ -215,11 +215,16 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
(int)WGL_ARB_pixel_format.AccelerationArb,
|
(int)WGL_ARB_pixel_format.AccelerationArb,
|
||||||
(int)WGL_ARB_pixel_format.FullAccelerationArb,
|
(int)WGL_ARB_pixel_format.FullAccelerationArb,
|
||||||
|
(int)WGL_ARB_pixel_format.SupportOpenglArb, 1,
|
||||||
|
(int)WGL_ARB_pixel_format.DrawToWindowArb, 1,
|
||||||
0, 0
|
0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
int[] num_formats = new int[1];
|
int[] num_formats = new int[1];
|
||||||
Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, 0, null, num_formats);
|
// Get the number of available formats
|
||||||
|
if (Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, 0, null, num_formats))
|
||||||
|
{
|
||||||
|
// Create an array big enough to hold all available formats and get those formats
|
||||||
int[] pixel = new int[num_formats[0]];
|
int[] pixel = new int[num_formats[0]];
|
||||||
|
|
||||||
if (Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, pixel.Length, pixel, num_formats))
|
if (Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, pixel.Length, pixel, num_formats))
|
||||||
|
@ -247,6 +252,7 @@ namespace OpenTK.Platform.Windows
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue