MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / LinkShaders

Function LinkShaders

src/libutils/oglapphelpers/glsl.cpp:182–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void 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

Callers 1

buildProgramMethod · 0.85

Calls 1

CheckStatusFunction · 0.85

Tested by

no test coverage detected