Package com.ardor3d.renderer.state.record

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


public abstract class LwjglOffsetStateUtil {

    public static void apply(final LwjglRenderer renderer, final OffsetState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final OffsetStateRecord record = (OffsetStateRecord) context.getStateRecord(StateType.Offset);
        context.setCurrentState(StateType.Offset, state);

        if (state.isEnabled()) {
            // enable any set offset types
            setOffsetEnabled(OffsetType.Fill, state.isTypeEnabled(OffsetType.Fill), record);
            setOffsetEnabled(OffsetType.Line, state.isTypeEnabled(OffsetType.Line), record);
            setOffsetEnabled(OffsetType.Point, state.isTypeEnabled(OffsetType.Point), record);

            // set factor and units.
            setOffset(state.getFactor(), state.getUnits(), record);
        } else {
            // disable all offset types
            setOffsetEnabled(OffsetType.Fill, false, record);
            setOffsetEnabled(OffsetType.Line, false, record);
            setOffsetEnabled(OffsetType.Point, false, record);

            // set factor and units to default 0, 0.
            setOffset(0, 0, record);
        }

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


        }
    }

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

public abstract class JoglOffsetStateUtil {

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

        if (state.isEnabled()) {
            // enable any set offset types
            setOffsetEnabled(OffsetType.Fill, state.isTypeEnabled(OffsetType.Fill), record);
            setOffsetEnabled(OffsetType.Line, state.isTypeEnabled(OffsetType.Line), record);
            setOffsetEnabled(OffsetType.Point, state.isTypeEnabled(OffsetType.Point), record);

            // set factor and units.
            setOffset(state.getFactor(), state.getUnits(), record);
        } else {
            // disable all offset types
            setOffsetEnabled(OffsetType.Fill, false, record);
            setOffsetEnabled(OffsetType.Line, false, record);
            setOffsetEnabled(OffsetType.Point, false, record);

            // set factor and units to default 0, 0.
            setOffset(0, 0, record);
        }

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

TOP

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

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.