bool RenderState::textureUnit(GLuint unit) { if (!m_textureUnit.set || m_textureUnit.unit != unit) { m_textureUnit = { unit, true }; // Our cached texture handle is irrelevant on the new unit, so unset it. m_texture.set = false; GL::activeTexture(getTextureUnit(unit)); return false; } return true; }
void activeTextureUnit(GLuint _unit) { glActiveTexture(getTextureUnit(_unit)); }
virtual inline void bind(GLuint program) override { _value->bind(_textureUnit); setUniform(program, getLocation(), static_cast<GLint>(getTextureUnit())); }
virtual Uniform<Texture>* clone() const override { return new Uniform<Texture>(getName(), getLocation(), getTextureUnit(), getValue()); }