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:
the_fiddler 2009-05-19 09:44:47 +00:00
parent 7b85450e9b
commit 42d467d57f

View file

@ -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;