Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileErrors() doesn't work as intended #27

Open
YourAverageFTCPerson opened this issue Jan 27, 2024 · 2 comments
Open

compileErrors() doesn't work as intended #27

YourAverageFTCPerson opened this issue Jan 27, 2024 · 2 comments

Comments

@YourAverageFTCPerson
Copy link

YourAverageFTCPerson commented Jan 27, 2024

// 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
	{
		// ...
	}
}
@PhoenixWhitefire
Copy link

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.

@CharaVerKys
Copy link

i guess author abandon this... i come here to wrote this issue, and also seen it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants