Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::map <const char*, GLint> shaderMap;
- void TheShader::BindAttributes(const char* attribute)
- {
- auto it = shaderMap.find(attribute);
- //add vertex attribute to the map if it can't be found
- if (it == shaderMap.end())
- {
- shaderMap[attribute] = glGetAttribLocation(m_shaderProgramID, attribute);
- }
- }
- void TheShader::BindUniform(const char* attribute)
- {
- auto it = shaderMap.find(attribute);
- //add uniform data to the map if it can't be found
- if (it == shaderMap.end())
- {
- shaderMap[attribute] = glGetUniformLocation(m_shaderProgramID, attribute);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement