diff --git a/src/osg/GL2Extensions.cpp b/src/osg/GL2Extensions.cpp index 8d9ac3afc..9ec4b7e1d 100644 --- a/src/osg/GL2Extensions.cpp +++ b/src/osg/GL2Extensions.cpp @@ -2158,7 +2158,7 @@ bool GL2Extensions::getProgramInfoLog( GLuint program, std::string& result ) con { GLchar* infoLog = new GLchar[bufLen]; glGetProgramInfoLog( program, bufLen, &strLen, infoLog ); - if( strLen > 0 ) result = infoLog; + if( strLen > 0 ) result = reinterpret_cast(infoLog); delete [] infoLog; } return (strLen > 0); @@ -2175,7 +2175,7 @@ bool GL2Extensions::getShaderInfoLog( GLuint shader, std::string& result ) const { GLchar* infoLog = new GLchar[bufLen]; glGetShaderInfoLog( shader, bufLen, &strLen, infoLog ); - if( strLen > 0 ) result = infoLog; + if( strLen > 0 ) result = reinterpret_cast(infoLog); delete [] infoLog; } return (strLen > 0); @@ -2194,7 +2194,7 @@ bool GL2Extensions::getAttribLocation( const char* attribName, GLuint& location if( linked == GL_FALSE ) return false; // is there such a named attribute? - GLint loc = glGetAttribLocation( program, attribName ); + GLint loc = glGetAttribLocation( program, reinterpret_cast(attribName) ); if( loc < 0 ) return false; location = loc; @@ -2217,7 +2217,7 @@ bool GL2Extensions::getFragDataLocation( const char* fragDataName, GLuint& locat if (_glGetFragDataLocation == NULL) return false; // is there such a named attribute? - GLint loc = glGetFragDataLocation( program, fragDataName ); + GLint loc = glGetFragDataLocation( program, reinterpret_cast(fragDataName) ); if( loc < 0 ) return false; location = loc; diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index 8b7ca7da3..f08ce9c64 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -490,7 +490,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) itr != programBindlist.end(); ++itr ) { osg::notify(osg::NOTICE)<<"Program's vertex attrib binding "<second<<", "<first<glBindAttribLocation( _glProgramHandle, itr->second, itr->first.c_str() ); + _extensions->glBindAttribLocation( _glProgramHandle, itr->second, reinterpret_cast(itr->first.c_str()) ); } // set any explicit vertex attribute bindings that are set up via osg::State, such as the vertex arrays @@ -502,7 +502,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) itr != stateBindlist.end(); ++itr ) { osg::notify(osg::NOTICE)<<"State's vertex attrib binding "<second<<", "<first<glBindAttribLocation( _glProgramHandle, itr->second, itr->first.c_str() ); + _extensions->glBindAttribLocation( _glProgramHandle, itr->second, reinterpret_cast(itr->first.c_str()) ); } } @@ -511,7 +511,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) for( FragDataBindingList::const_iterator itr = fdbindlist.begin(); itr != fdbindlist.end(); ++itr ) { - _extensions->glBindFragDataLocation( _glProgramHandle, itr->second, itr->first.c_str() ); + _extensions->glBindFragDataLocation( _glProgramHandle, itr->second, reinterpret_cast(itr->first.c_str()) ); } // link the glProgram @@ -562,7 +562,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) if( loc != -1 ) { - _uniformInfoMap[name] = ActiveVarInfo(loc,type,size); + _uniformInfoMap[reinterpret_cast(name)] = ActiveVarInfo(loc,type,size); osg::notify(osg::INFO) << "\tUniform \"" << name << "\"" @@ -594,7 +594,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state) if( loc != -1 ) { - _attribInfoMap[name] = ActiveVarInfo(loc,type,size); + _attribInfoMap[reinterpret_cast(name)] = ActiveVarInfo(loc,type,size); osg::notify(osg::INFO) << "\tAttrib \"" << name << "\"" diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index b4b4b1f64..9b4171bcf 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -500,7 +500,7 @@ void Shader::PerContextShader::compileShader(osg::State& state) } GLint compiled = GL_FALSE; - const char* sourceText = source.c_str(); + const GLchar* sourceText = reinterpret_cast(source.c_str()); _extensions->glShaderSource( _glShaderHandle, 1, &sourceText, NULL ); _extensions->glCompileShader( _glShaderHandle ); _extensions->glGetShaderiv( _glShaderHandle, GL_COMPILE_STATUS, &compiled );