| 180 | } |
| 181 | |
| 182 | void LinkShaders(GLuint program, GLuint fragShader) |
| 183 | { |
| 184 | CheckStatus(); |
| 185 | |
| 186 | if (!fragShader) |
| 187 | { |
| 188 | throw Exception("Missing shader program"); |
| 189 | } |
| 190 | else |
| 191 | { |
| 192 | glAttachShader(program, fragShader); |
| 193 | } |
| 194 | |
| 195 | glLinkProgram(program); |
| 196 | |
| 197 | GLint stat; |
| 198 | glGetProgramiv(program, GL_LINK_STATUS, &stat); |
| 199 | if (!stat) |
| 200 | { |
| 201 | GLchar log[1000]; |
| 202 | GLsizei len; |
| 203 | glGetProgramInfoLog(program, 1000, &len, log); |
| 204 | |
| 205 | std::string err("Shader link error:\n"); |
| 206 | err += log; |
| 207 | throw Exception(err.c_str()); |
| 208 | } |
| 209 | } |
| 210 | } |
| 211 | |
| 212 |
no test coverage detected