public abstract class JoglWireframeStateUtil {
public static void apply(final JoglRenderer renderer, final WireframeState state) {
// ask for the current state record
final RenderContext context = ContextManager.getCurrentContext();
final WireframeStateRecord record = (WireframeStateRecord) context.getStateRecord(StateType.Wireframe);
context.setCurrentState(StateType.Wireframe, state);
if (state.isEnabled()) {
renderer.setupLineParameters(state.getLineWidth(), 1, (short) 0xFFFF, state.isAntialiased());
switch (state.getFace()) {
case Front:
applyPolyMode(GL2GL3.GL_LINE, GL2GL3.GL_FILL, record);
break;
case Back:
applyPolyMode(GL2GL3.GL_FILL, GL2GL3.GL_LINE, record);
break;
case FrontAndBack:
default:
applyPolyMode(GL2GL3.GL_LINE, GL2GL3.GL_LINE, record);
break;
}
} else {
applyPolyMode(GL2GL3.GL_FILL, GL2GL3.GL_FILL, record);
}
if (!record.isValid()) {
record.validate();
}
}