You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Checks if the different Shaders have compiled properly
void Shader::compileErrors(unsigned int shader /* Sidenote: shouldn't this be GLuint for maximum generality? */, const char* type)
{
// ...
if (type != "PROGRAM") // This is never true because const char* is not std::string and this simply compares the memory addresses. If you want to check to see if the values aren't the same use strcmp(type, program) != 0 in <cstring>
{
// ...
}
else
{
// ...
}
}
The text was updated successfully, but these errors were encountered:
My personal fix for this was to change the comparison to if (shader != ID), which I think is overall better than making it actually compare the string properly. Could also rename the variables and add a comment to make the comparison more clear.
The text was updated successfully, but these errors were encountered: