MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Apply

Method Apply

Source/Graphics/drawbatch.cpp:284–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void Uniform::Apply() const {
285 CHECK_GL_ERROR();
286 int bound_program = Shaders::Instance()->bound_program;
287 GLint var = Shaders::Instance()->returnShaderVariable(name, bound_program);
288
289 switch (type) {
290 case _mat3:
291 Shaders::Instance()->SetUniformMat3(var, &data[0]);
292 break;
293 case _mat4:
294 Shaders::Instance()->SetUniformMat4(var, &data[0]);
295 break;
296 case _vec3:
297 Shaders::Instance()->SetUniformVec3(var, &data[0]);
298 break;
299 case _vec4:
300 Shaders::Instance()->SetUniformVec4(var, &data[0]);
301 break;
302 case _float:
303 Shaders::Instance()->SetUniformFloat(var, data[0]);
304 break;
305 default:
306 // mjh - what's the reasonable thing to do here?
307 break;
308 }
309 CHECK_GL_ERROR();
310}
311
312Uniform::Uniform() : individual(false) {
313}

Callers 2

SetStartStateMethod · 0.45

Calls 6

returnShaderVariableMethod · 0.80
SetUniformMat3Method · 0.80
SetUniformMat4Method · 0.80
SetUniformVec3Method · 0.45
SetUniformVec4Method · 0.45
SetUniformFloatMethod · 0.45

Tested by

no test coverage detected