Examples of ZBufferStateRecord


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

public abstract class LwjglZBufferStateUtil {

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

        enableDepthTest(state.isEnabled(), record);
        if (state.isEnabled()) {
            int depthFunc = 0;
            switch (state.getFunction()) {
                case Never:
                    depthFunc = GL11.GL_NEVER;
                    break;
                case LessThan:
                    depthFunc = GL11.GL_LESS;
                    break;
                case EqualTo:
                    depthFunc = GL11.GL_EQUAL;
                    break;
                case LessThanOrEqualTo:
                    depthFunc = GL11.GL_LEQUAL;
                    break;
                case GreaterThan:
                    depthFunc = GL11.GL_GREATER;
                    break;
                case NotEqualTo:
                    depthFunc = GL11.GL_NOTEQUAL;
                    break;
                case GreaterThanOrEqualTo:
                    depthFunc = GL11.GL_GEQUAL;
                    break;
                case Always:
                    depthFunc = GL11.GL_ALWAYS;
            }
            applyFunction(depthFunc, record);
        }

        enableWrite(state.isWritable(), record);

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

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

        _writable = capsule.readBoolean("writable", true);
    }

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

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

public abstract class JoglZBufferStateUtil {

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

        enableDepthTest(state.isEnabled(), record);
        if (state.isEnabled()) {
            int depthFunc = 0;
            switch (state.getFunction()) {
                case Never:
                    depthFunc = GL.GL_NEVER;
                    break;
                case LessThan:
                    depthFunc = GL.GL_LESS;
                    break;
                case EqualTo:
                    depthFunc = GL.GL_EQUAL;
                    break;
                case LessThanOrEqualTo:
                    depthFunc = GL.GL_LEQUAL;
                    break;
                case GreaterThan:
                    depthFunc = GL.GL_GREATER;
                    break;
                case NotEqualTo:
                    depthFunc = GL.GL_NOTEQUAL;
                    break;
                case GreaterThanOrEqualTo:
                    depthFunc = GL.GL_GEQUAL;
                    break;
                case Always:
                    depthFunc = GL.GL_ALWAYS;
            }
            applyFunction(depthFunc, record);
        }

        enableWrite(state.isWritable(), record);

        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.