Package com.ardor3d.renderer.jogl.state.record

Examples of com.ardor3d.renderer.jogl.state.record.JoglRendererRecord


    public void setOrtho() {
        if (_inOrthoMode) {
            throw new Ardor3dException("Already in Orthographic mode.");
        }
        // set up ortho mode
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_PROJECTION);
        matRecord.getMatrixBackend().pushMatrix();
        matRecord.getMatrixBackend().loadIdentity();

        final Camera camera = Camera.getCurrentCamera();
        final double viewportWidth = camera.getWidth() * (camera.getViewPortRight() - camera.getViewPortLeft());
        final double viewportHeight = camera.getHeight() * (camera.getViewPortTop() - camera.getViewPortBottom());
        matRecord.getMatrixBackend().setOrtho(0, viewportWidth, 0, viewportHeight, -1, 1);
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_MODELVIEW);
        matRecord.getMatrixBackend().pushMatrix();
        matRecord.getMatrixBackend().loadIdentity();
        _inOrthoMode = true;
    }
View Full Code Here


        if (!_inOrthoMode) {
            throw new Ardor3dException("Not in Orthographic mode.");
        }
        // remove ortho mode, and go back to original
        // state
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_PROJECTION);
        matRecord.getMatrixBackend().popMatrix();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_MODELVIEW);
        matRecord.getMatrixBackend().popMatrix();
        _inOrthoMode = false;
    }
View Full Code Here

        // set world matrix
        if (!transform.isIdentity()) {
            synchronized (_transformMatrix) {
                transform.getGLApplyMatrix(_transformBuffer);

                final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                        .getRendererRecord();
                JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_MODELVIEW);
                matRecord.getMatrixBackend().pushMatrix();
                matRecord.getMatrixBackend().multMatrix(_transformBuffer);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }

    public void undoTransforms(final ReadOnlyTransform transform) {
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_MODELVIEW);
        matRecord.getMatrixBackend().popMatrix();
    }
View Full Code Here

        throw new IllegalArgumentException("Unknown buffer type: " + indices.getBuffer());
    }

    public void setModelViewMatrix(final FloatBuffer matrix) {
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_MODELVIEW);

        loadMatrix(matrix);
    }
View Full Code Here

        loadMatrix(matrix);
    }

    public void setProjectionMatrix(final FloatBuffer matrix) {
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        JoglRendererUtil.switchMode(matRecord, GLMatrixFunc.GL_PROJECTION);

        loadMatrix(matrix);
    }
View Full Code Here

        loadMatrix(matrix);
    }

    private void loadMatrix(final FloatBuffer matrix) {
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        matRecord.getMatrixBackend().loadMatrix(matrix);
    }
View Full Code Here

    private FloatBuffer getMatrix(final int matrixType, final FloatBuffer store) {
        FloatBuffer result = store;
        if (result.remaining() < 16) {
            result = BufferUtils.createFloatBuffer(16);
        }
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        matRecord.getMatrixBackend().getMatrix(matrixType, store);
        // GLContext.getCurrentGL().glGetFloatv(matrixType, store);
        return result;
    }
View Full Code Here

        super(key, caps, shared);
    }

    @Override
    protected JoglRendererRecord createRendererRecord() {
        final JoglRendererRecord rendererRecord = new JoglRendererRecord();
        return rendererRecord;
    }
View Full Code Here

        // Should we apply the transform?
        final boolean doTrans = !texture.getTextureMatrix().isIdentity();

        // Now do them.
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
        if (doTrans) {
            checkAndSetUnit(unit, record, caps);
            JoglRendererUtil.switchMode(matRecord, GL.GL_TEXTURE);
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.jogl.state.record.JoglRendererRecord

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.