On Fri, Mar 25, 2011 at 11:57 AM, Jorge Izquierdo Ciges
<[email protected]> wrote:
> 5th - OpenGL and GLSL version identification changed to recognize GLES
>  versions properly

Dear Jorge, Robert and all,

Unfortunately this seems to have broken version detection for "normal"
desktop systems.

I have two machines I can test with:
fglrx 11.4 on HD4200:
GL: "3.3.10666 Compatibility Profile Context"
GLSL: "3.30"

nvidia 270.41.06 on 8600M-GT:
GL: "3.3.0 NVIDIA 270.41.06"
GLSL: "3.30 NVIDIA via Cg compiler"

GL original code: return( asciiToFloat( vs.substr( 0, vs.find( " " )
).c_str() ) );
GL new code: return( asciiToFloat( vs.substr( vs.find( " " )+1 ).c_str() ) );

Notice how the original code converts the leading part up to the first
space, while the new code converts the substring after the first
space.

GLSL original code: _glslLanguageVersion = asciiToFloat( langVerStr );
GLSL new code: _glslLanguageVersion = ( asciiToFloat(
glslvs.substr(glslvs.find( "GLSL "+5 ) ).c_str() ) );

Notice the +5 is in the wrong place, inside the find() call and not
outside as probably intended. Also, my version strings do not contain
GLSL at all, so even with the +5 in the right place, the return value
would be npos which is usually -1 thus resulting in a substring
starting at position 4, effectively chopping off the leading version
number that we want to parse.

Since the original code seems to work fine for the non-GLES case, can
we just put that back in the appropriate #if branches?

-- 
Cheers,
Csaba
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to