Ejemplo n.º 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;
}
Ejemplo n.º 2
0
 void activeTextureUnit(GLuint _unit) { glActiveTexture(getTextureUnit(_unit)); }
Ejemplo n.º 3
0
	virtual inline void bind(GLuint program) override
	{
		_value->bind(_textureUnit);
		setUniform(program, getLocation(),  static_cast<GLint>(getTextureUnit()));
	}
Ejemplo n.º 4
0
	virtual Uniform<Texture>* clone() const override
	{
		return new Uniform<Texture>(getName(), getLocation(), getTextureUnit(), getValue());
	}