* Checks to see if any errors occured while linking * the shaders to the program. * @return true if nothing went wrong and false if anything * bad happened */
| 71 | * bad happened |
| 72 | */ |
| 73 | static bool checkProgramError(GLuint program, const std::vector<Shader> & shaders) { |
| 74 | GLint linkStatus; |
| 75 | glGetProgramiv(program, GL_LINK_STATUS, &linkStatus); |
| 76 | if (!linkStatus) { |
| 77 | std::string files; |
| 78 | for (auto& s : shaders) files += s.filename + " "; |
| 79 | STRATUS_ERROR << "[error] Program failed during linking ( files were: " << files << ")" << std::endl; |
| 80 | |
| 81 | GLint logLength; |
| 82 | glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength); |
| 83 | |
| 84 | if (logLength > 0) { |
| 85 | std::string errorLog; |
| 86 | errorLog.resize(static_cast<uint32_t>(logLength)); |
| 87 | glGetProgramInfoLog(program, logLength, nullptr, &errorLog[0]); |
| 88 | std::cout << errorLog << std::endl; |
| 89 | } |
| 90 | return false; |
| 91 | } |
| 92 | return true; |
| 93 | } |
| 94 | |
| 95 | static std::unordered_set<std::string> BuildFileList(const std::filesystem::path& root) { |
| 96 | std::unordered_set<std::string> result; |