45 lines
719 B
Java
45 lines
719 B
Java
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;
|
|
}
|
|
|
|
@Override
|
|
public void reapply()
|
|
{
|
|
super.reapply();
|
|
GL11.glBlendFunc(src, func);
|
|
}
|
|
|
|
public void setDefault()
|
|
{
|
|
setFunction(GL11.GL_ONE, GL11.GL_ONE);
|
|
}
|
|
}
|