package speiger.src.coreengine.rendering.utils.states;

import org.lwjgl.opengl.GL11;

public class BlendState extends GLState
{
	int src;
	int func;
	
	public BlendState()
	{
		super(GL11.GL_BLEND, false);
	}
	
	@Override
	public BlendState push(boolean newValue)
	{
		super.push(newValue);
		return this;
	}
	
	public BlendState setFunction(int src, int func)
	{
		if(this.src != src && this.func != func)
		{
			this.src = src;
			this.func = func;
			GL11.glBlendFunc(src, func);
		}
		return this;
	}
	
	public void setDefault()
	{
		setFunction(GL11.GL_ONE, GL11.GL_ONE);
	}
}
