| 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()) { |
nothing calls this directly
no outgoing calls
no test coverage detected