Message from C, C++ talks

June 2019

— Why initialize a new std::string called vertexCode?

— Becous the way i'm reading the file

— That string contains the content of the file

— Well tbh your code doesn't make sense


So you want me to initializa a shader object, so then i can go and load a shader which in turn gives me a new shader object

— It's a static method

— So i can do Shader shader = Shader::loadShader(filepaths..);

— I don’t recommend you combining these two types of shaders. but also separate them

— There’s also geometry/tesselation, etc.

— Ah then it's ok

— So you must make it so the constructor copies the two things you pass to it

— Otherwise you'll have lifetime issues

— ^

— Because remeber that you're passing pointers to characters

— Not strings