MCPcopy Create free account
hub / github.com/cginternals/globjects / getActiveUniformName

Method getActiveUniformName

source/globjects/source/Program.cpp:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392std::string Program::getActiveUniformName(const GLuint uniformIndex) const
393{
394 checkDirty();
395
396 GLint length = getActiveUniform(uniformIndex, GL_UNIFORM_NAME_LENGTH);
397 assert(length > 1); // Has to include at least 1 char and '\0'
398
399 std::vector<char> name(length);
400 glGetActiveUniformName(id(), uniformIndex, length, nullptr, name.data());
401
402 // glGetActiveUniformName() insists we query '\0' as well, but it
403 // shouldn't be passed to std::string(), otherwise std::string::size()
404 // returns <actual size> + 1 (on clang)
405 auto numChars = length - 1;
406 return std::string(name.data(), numChars);
407}
408
409UniformBlock * Program::uniformBlock(const GLuint uniformBlockIndex)
410{

Callers

nothing calls this directly

Calls 1

dataMethod · 0.80

Tested by

no test coverage detected