Exemple #1
0
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)); }
Exemple #3
0
	virtual inline void bind(GLuint program) override
	{
		_value->bind(_textureUnit);
		setUniform(program, getLocation(),  static_cast<GLint>(getTextureUnit()));
	}
Exemple #4
0
	virtual Uniform<Texture>* clone() const override
	{
		return new Uniform<Texture>(getName(), getLocation(), getTextureUnit(), getValue());
	}