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
1 changed files with 7 additions and 3 deletions
|
@ -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