On 5 January 2015 at 17:17, Matteo Bruni mbruni@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().