[AD] is_wgl_extension_supported

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


wgl_disp.c:

~~~
static bool is_wgl_extension_supported(AL_CONST char *extension, HDC dc)
{
   ALLEGRO_GetExtensionsStringARB_t __wglGetExtensionsStringARB;
   int ret;

   if (!glGetString(GL_EXTENSIONS))
      return false;

   __wglGetExtensionsStringARB = (ALLEGRO_GetExtensionsStringARB_t)

wglGetProcAddress("wglGetExtensionsStringARB");
   ret = _al_ogl_look_for_an_extension(extension,
         (const GLubyte*)__wglGetExtensionsStringARB(dc));

   return ret;
}
~~~

__wglGetExtensionsStringARB can be null after the function call on
some computers. I think it happened on the GeForce 2 MX 400 card I was
testing on.

Adding this fixed the crash:

if (!__wglGetExtensionsStringARB) return false;

Of course then the OpenGL mode couldn't be set, but that was better
then a crash...

Anyway, I'm pretty sure that's the change I had to make. I don't know
if it makes any sense or if there's a better way to do it.

an ASSERT in _al_ogl_look_for_an_extension() might help too.

--
Matthew Leverton




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/