///////////////////////////////////////////////////////
| 951 | |
| 952 | //////////////////////////////////////////////////////////// |
| 953 | void Shader::bindTextures() const |
| 954 | { |
| 955 | auto it = m_textures.begin(); |
| 956 | for (std::size_t i = 0; i < m_textures.size(); ++i) |
| 957 | { |
| 958 | const auto index = static_cast<GLsizei>(i + 1); |
| 959 | glCheck(GLEXT_glUniform1i(it->first, index)); |
| 960 | glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0 + static_cast<GLenum>(index))); |
| 961 | Texture::bind(it->second); |
| 962 | ++it; |
| 963 | } |
| 964 | |
| 965 | // Make sure that the texture unit which is left active is the number 0 |
| 966 | glCheck(GLEXT_glActiveTexture(GLEXT_GL_TEXTURE0)); |
| 967 | } |
| 968 | |
| 969 | |
| 970 | //////////////////////////////////////////////////////////// |