X11Drv: move WGL extension code

Alexandre Julliard julliard at winehq.org
Mon Sep 11 05:16:08 CDT 2006


"Roderick Colenbrander" <thunderbird2k at gmx.net> writes:

> The patch adds new WGL extension loading code based on code written
> by an old opengl32 -> x11drv patch written by Tomas Carnacky. The
> code properly advertises WGL extensions and only returns function
> pointers when the extension is really available.

It would be nicer to declare the extensions as constant variables
instead of building everything at run time. Something like:

static const struct wglextension swap_control =
{
  "WGL_EXT_swap_control",
  {
    { "wglSwapIntervalEXT", X11DRV_wglSwapIntervalEXT },
    { "wglGetSwapIntervalEXT", X11DRV_wglGetSwapIntervalEXT },
  }
};

static void load_extensions(void)
{
    if (glxRequireExtension("GLX_SGI_swap_control"))
        register_extension( &swap_control );
    ... etc.
}

Then the extension list can simply store a pointer instead of copying
the whole thing once more, and you avoid a lot of nasty macros.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list