[PATCH 3/5] opengl32: Fix extension checks on OpenGL core profile contexts.

Henri Verbeet hverbeet at gmail.com
Mon Jan 5 11:33:44 CST 2015


On 5 January 2015 at 17:17, Matteo Bruni <mbruni at codeweavers.com> wrote:
>  static BOOL has_extension( const char *list, const char *ext, size_t len )
>  {
> +    if (!list)
> +    {
> +        const struct opengl_funcs *funcs = NtCurrentTeb()->glTable;
> +        const char *gl_ext;
> +        unsigned int i;
> +        GLint extensions_count;
> +
> +        glGetIntegerv(GL_NUM_EXTENSIONS, &extensions_count);
> +        for (i = 0; i < extensions_count; ++i)
> +        {
> +            gl_ext = (const char *)funcs->ext.p_glGetStringi(GL_EXTENSIONS, i);
> +            if (!strncmp(gl_ext, ext, len) && !gl_ext[len])
> +                return TRUE;
> +        }
> +        return FALSE;
> +    }
> +
If I'm reading this correctly, this effectively ignores
DisabledExtensions for anything newer than GL 3.0. (And at least as
far as wglGetProcAddress() is concerned it affects both compatibility
and core contexts.)

> +    gl_version = (const char *)glGetString(GL_VERSION);
> +    sscanf(gl_version, "%u", &major);
> +    if (major >= 3)
> +    {
It seems tempting to just flag the context in
wglCreateContextAttribsARB() under the appropriate conditions, perhaps
in a similar way to wgl_handle_type. Not sure if it would really make
it better though.

As an aside, note that winex11.drv also uses
"glGetString(GL_EXTENSIONS);" in X11DRV_WineGL_InitOpenglInfo().



More information about the wine-devel mailing list