Examples of ShadingStateRecord


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

public abstract class LwjglShadingStateUtil {

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

        // If not enabled, we'll use smooth
        final int toApply = state.isEnabled() ? getGLShade(state.getShadingMode()) : GL11.GL_SMOOTH;
        // only apply if we're different. Update record to reflect any changes.
        if (!record.isValid() || toApply != record.lastShade) {
            GL11.glShadeModel(toApply);
            record.lastShade = toApply;
        }

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

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

        _shadeMode = capsule.readEnum("shadeMode", ShadingMode.class, ShadingMode.Smooth);
    }

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

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

    public static void apply(final JoglRenderer renderer, final ShadingState state) {
        final GL gl = GLContext.getCurrentGL();

        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final ShadingStateRecord record = (ShadingStateRecord) context.getStateRecord(StateType.Shading);
        context.setCurrentState(StateType.Shading, state);

        // If not enabled, we'll use smooth
        final int toApply = state.isEnabled() ? getGLShade(state.getShadingMode()) : GLLightingFunc.GL_SMOOTH;
        // only apply if we're different. Update record to reflect any changes.
        if (!record.isValid() || toApply != record.lastShade) {
            gl.getGL2().glShadeModel(toApply);
            record.lastShade = toApply;
        }

        if (!record.isValid()) {
            record.validate();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.