mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
Shader tab fix.
This commit is contained in:
@@ -167,28 +167,28 @@ private:
|
|||||||
// utility function for checking shader compilation/linking errors.
|
// utility function for checking shader compilation/linking errors.
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void checkCompileErrors(GLuint shader, std::string type)
|
void checkCompileErrors(GLuint shader, std::string type)
|
||||||
{
|
{
|
||||||
GLint success;
|
GLint success;
|
||||||
GLchar infoLog[1024];
|
GLchar infoLog[1024];
|
||||||
if(type != "PROGRAM")
|
if(type != "PROGRAM")
|
||||||
{
|
{
|
||||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
||||||
if(!success)
|
if(!success)
|
||||||
{
|
{
|
||||||
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
||||||
if(!success)
|
if(!success)
|
||||||
{
|
{
|
||||||
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -141,28 +141,28 @@ private:
|
|||||||
// utility function for checking shader compilation/linking errors.
|
// utility function for checking shader compilation/linking errors.
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void checkCompileErrors(GLuint shader, std::string type)
|
void checkCompileErrors(GLuint shader, std::string type)
|
||||||
{
|
{
|
||||||
GLint success;
|
GLint success;
|
||||||
GLchar infoLog[1024];
|
GLchar infoLog[1024];
|
||||||
if(type != "PROGRAM")
|
if (type != "PROGRAM")
|
||||||
{
|
{
|
||||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
||||||
if(!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
||||||
if(!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -97,28 +97,28 @@ private:
|
|||||||
// utility function for checking shader compilation/linking errors.
|
// utility function for checking shader compilation/linking errors.
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
void checkCompileErrors(GLuint shader, std::string type)
|
void checkCompileErrors(GLuint shader, std::string type)
|
||||||
{
|
{
|
||||||
GLint success;
|
GLint success;
|
||||||
GLchar infoLog[1024];
|
GLchar infoLog[1024];
|
||||||
if(type != "PROGRAM")
|
if (type != "PROGRAM")
|
||||||
{
|
{
|
||||||
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
glGetShaderiv(shader, GL_COMPILE_STATUS, &success);
|
||||||
if(!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
glGetShaderInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::SHADER_COMPILATION_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
glGetProgramiv(shader, GL_LINK_STATUS, &success);
|
||||||
if(!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
glGetProgramInfoLog(shader, 1024, NULL, infoLog);
|
||||||
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
std::cout << "ERROR::PROGRAM_LINKING_ERROR of type: " << type << "\n" << infoLog << "\n -- --------------------------------------------------- -- " << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user