MCPcopy Create free account
hub / github.com/SFML/SFML / bindTextures

Method bindTextures

src/SFML/Graphics/Shader.cpp:953–967  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

951
952////////////////////////////////////////////////////////////
953void 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////////////////////////////////////////////////////////////

Callers 1

bindMethod · 0.80

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected