mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 16:25:26 +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 (extensions == null || rebuildExtensionList)
|
||||
if (rebuildExtensionList)
|
||||
{
|
||||
extensions = Wgl.Arb.GetExtensionsString(context.DeviceContext).Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
|
||||
Array.Sort(extensions);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue