SimpleJavaEngine/src/main/java/speiger/src/coreengine/rendering/utils/states/CullState.java

41 lines
618 B
Java

package speiger.src.coreengine.rendering.utils.states;
import org.lwjgl.opengl.GL11;
public class CullState extends GLState
{
int type;
public CullState(int defaultState)
{
super(GL11.GL_CULL_FACE, false);
type = defaultState;
}
@Override
public CullState push(boolean newValue)
{
super.push(newValue);
return this;
}
public void setCullType(int type)
{
if(this.type != type)
{
this.type = type;
if(lastState)
{
GL11.glCullFace(type);
}
}
}
@Override
public void reapply()
{
super.reapply();
GL11.glCullFace(type);
}
}