mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-12 08:15:34 +00:00
Modified Wgl.SupportsExtension to be more defensive when calling Wgl.Arb.GetExtensionString. It now bails out if the extension string is empty.
This commit is contained in:
parent
7b85450e9b
commit
42d467d57f
|
@ -141,11 +141,15 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
if (Wgl.Delegates.wglGetExtensionsStringARB != null)
|
if (Wgl.Delegates.wglGetExtensionsStringARB != null)
|
||||||
{
|
{
|
||||||
if (extensions == null || rebuildExtensionList)
|
if (rebuildExtensionList)
|
||||||
{
|
{
|
||||||
extensions = Wgl.Arb.GetExtensionsString(context.DeviceContext).Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
Array.Sort(extensions);
|
|
||||||
rebuildExtensionList = false;
|
rebuildExtensionList = false;
|
||||||
|
|
||||||
|
extensions = Wgl.Arb.GetExtensionsString(context.DeviceContext).Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
if (extensions == null || extensions.Length == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Array.Sort(extensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Array.BinarySearch(extensions, ext) != -1;
|
return Array.BinarySearch(extensions, ext) != -1;
|
||||||
|
|
Loading…
Reference in a new issue