I need to load a *.glsl to draw something. My environment is Ubuntu 13.04, hence it doesn\'t exist GLuint InitShader (GLuint, GLuint). It is my config for object creation, pre-l
const char *vertex_source = "./shader/vshader21.glsl";
^^^^^^^^^^^^^^^^^^^^^^^ wat
glShaderSource (vertex_shader, 1, &vertex_source, NULL);
glShaderSource() does not work that way!
string
: Specifies an array of pointers to strings containing the source code to be loaded into the shader.
There's absolutely nothing in there about interpreting string
as a filesystem path.
You need to load the shader from file yourself, then pass the string(s) containing the shader code to glShaderSource()
.