MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / SetShaderProgram

Method SetShaderProgram

Sources/nCine/Graphics/Material.cpp:51–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 }
50
51 void Material::SetShaderProgram(GLShaderProgram* program)
52 {
53 // Allow self-assignment to take into account the case where the shader program loads new shaders
54
55 shaderProgramType_ = ShaderProgramType::Custom;
56 shaderProgram_ = program;
57 // The camera uniforms are handled separately as they have a different update frequency
58 shaderUniforms_.SetProgram(shaderProgram_, nullptr, ProjectionViewMatrixExcludeString);
59 shaderUniformBlocks_.SetProgram(shaderProgram_);
60
61 RenderResources::SetDefaultAttributesParameters(*shaderProgram_);
62 }
63
64 bool Material::SetShader(Shader* shader)
65 {

Callers 4

SetupRenderCommandMethod · 0.80
AddMethod · 0.80
SetShaderMethod · 0.80
ResetShaderMethod · 0.80

Calls 1

SetProgramMethod · 0.45

Tested by

no test coverage detected