MCPcopy Create free account
hub / github.com/JeanPhilippeKernel/RendererEngine / _GetLocationUniform

Method _GetLocationUniform

ZEngine/src/Shader.cpp:59–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 GLint Shader::_GetLocationUniform(const char* name) {
60 const auto it = std::find_if(std::begin(m_uniform_location_map), std::end(m_uniform_location_map), [&](const auto& kv) { return strcmp(kv.first, name) == 0; });
61
62 if (it != std::end(m_uniform_location_map))
63 return it->second;
64
65 GLint location = glGetUniformLocation(m_program, name);
66 if (location == -1) {
67 ZENGINE_CORE_WARN("Error while finding uniform location : Name : {0}", name);
68 return -1;
69 }
70
71 m_uniform_location_map[name] = location;
72 return location;
73 }
74
75 void Shader::SetUniform(const char* name, int value) {
76 if (IsActive()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected