package speiger.src.coreengine.rendering.shaderOld.uniforms;

import org.lwjgl.opengl.GL20;

import speiger.src.coreengine.rendering.utils.AllocationTracker;

public class UniformBoolean extends Uniform {
	boolean last = false;
	boolean first = true;

	public UniformBoolean(String id) {
		super(id);
	}

	public void storeData(boolean value) {
		if (last != value || first) {
			first = false;
			last = value;
			GL20.glUniform1f(getPosition(), value ? 1F : 0F);
			AllocationTracker.INSTANCE.addGPUBytes(1L);
		}
	}
}
