Package com.ardor3d.renderer.state.record

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


public abstract class LwjglCullStateUtil {

    public static void apply(final CullState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final CullStateRecord record = (CullStateRecord) context.getStateRecord(StateType.Cull);
        context.setCurrentState(StateType.Cull, state);

        if (state.isEnabled()) {
            final Face useCullMode = state.getCullFace();

            switch (useCullMode) {
                case Front:
                    setCull(GL11.GL_FRONT, record);
                    setCullEnabled(true, record);
                    break;
                case Back:
                    setCull(GL11.GL_BACK, record);
                    setCullEnabled(true, record);
                    break;
                case FrontAndBack:
                    setCull(GL11.GL_FRONT_AND_BACK, record);
                    setCullEnabled(true, record);
                    break;
                case None:
                    setCullEnabled(false, record);
                    break;
            }
            setGLPolygonWind(state.getPolygonWind(), record);
        } else {
            setCullEnabled(false, record);
            setGLPolygonWind(PolygonWind.CounterClockWise, record);
        }

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


        polygonWind = capsule.readEnum("polygonWind", PolygonWind.class, PolygonWind.CounterClockWise);
    }

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

public abstract class JoglCullStateUtil {

    public static void apply(final JoglRenderer renderer, final CullState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final CullStateRecord record = (CullStateRecord) context.getStateRecord(StateType.Cull);
        context.setCurrentState(StateType.Cull, state);

        if (state.isEnabled()) {
            final Face useCullMode = state.getCullFace();

            switch (useCullMode) {
                case Front:
                    setCull(GL.GL_FRONT, state, record);
                    setCullEnabled(true, state, record);
                    break;
                case Back:
                    setCull(GL.GL_BACK, state, record);
                    setCullEnabled(true, state, record);
                    break;
                case FrontAndBack:
                    setCull(GL.GL_FRONT_AND_BACK, state, record);
                    setCullEnabled(true, state, record);
                    break;
                case None:
                    setCullEnabled(false, state, record);
                    break;
            }
            setGLPolygonWind(state.getPolygonWind(), state, record);
        } else {
            setCullEnabled(false, state, record);
            setGLPolygonWind(PolygonWind.CounterClockWise, state, record);
        }

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

TOP

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

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.