Package com.ardor3d.renderer.state.record

Examples of com.ardor3d.renderer.state.record.WireframeStateRecord


public abstract class LwjglWireframeStateUtil {

    public static void apply(final LwjglRenderer 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(GL11.GL_LINE, GL11.GL_FILL, record);
                    break;
                case Back:
                    applyPolyMode(GL11.GL_FILL, GL11.GL_LINE, record);
                    break;
                case FrontAndBack:
                default:
                    applyPolyMode(GL11.GL_LINE, GL11.GL_LINE, record);
                    break;
            }
        } else {
            applyPolyMode(GL11.GL_FILL, GL11.GL_FILL, record);
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
View Full Code Here


        _antialiased = capsule.readBoolean("antialiased", false);
    }

    @Override
    public StateRecord createStateRecord(final ContextCapabilities caps) {
        return new WireframeStateRecord();
    }
View Full Code Here

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();
        }
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.record.WireframeStateRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.