[5/5] WineD3D: Use the disabled opengl extension string
Chris Robinson
chris.kcat at gmail.com
Thu Dec 6 18:46:54 CST 2007
On Thursday 06 December 2007 02:05:52 pm Stefan Dösinger wrote:
> + if(wined3d_settings.disabled_extensions &&
> + strstr(wined3d_settings.disabled_extensions,
> ThisExtn)) {
You need to be careful with this. I read somewhere that using strstr to check
for an opengl extension in an extension list is discourage because it can
find false positives. Especially in this case, if you have, say:
wined3d_settings.disabled_extensions = "GL_NV_texture_shader3
GL_NV_vertex_program2_option GL_NV_vertex_program3"
Then if you check for "GL_NV_texture_shader", "GL_NV_vertex_program2",
or "GL_NV_vertex_program", they'll all show up as being disabled, when
they're not. Which is a double problem because "GL_NV_vertex_program1_1"
would still be enabled, which requires "GL_NV_vertex_program".
AFAIK, the proper way to check for OpenGL extensions in a space-delimitted
list is like this:
const char *ptr = strstr(wined3d_settings.disabled_extensions, ThisExtn);
if(ptr) {
if(ptr == wined3d_settings.disabled_extensions || isspace(ptr[-1])) {
int len = strlen(ThisExtn);
if(!ptr[len] || isspace(ptr[len])) {
/* is disabled */
}
}
}
More information about the wine-devel
mailing list