I have a struct, known as Shader, which holds the following information:
struct Shader {
enum ValueType{ VT_Attribute, VT_Uniform, VT_Varying };
GLuint Memory;
GLenum Type;
char* Source;
char* Name;
std::map< Shader::ValueType, float* > Values;
};
Yet, if I do something like:
glShaderSource( shaderMem, 1, &shader.Source, NULL );
I get the following error:
error: invalid conversion from 'char* const*' to 'const char**'
Why is this happening?
It happens because
shaderisconstat that point. AssumingglShaderSourcewon’t attempt to write the contents of its 3rd argument, then you canconst_casttheconstaway: