Example usage for org.lwjgl.opengl GL11 glFlush

List of usage examples for org.lwjgl.opengl GL11 glFlush

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glFlush.

Prototype

public static void glFlush() 

Source Link

Document

Causes all previously issued GL commands to complete in finite time (although such commands may still be executing when Flush returns).

Usage

From source file:zsawyer.mods.stereoscopic3d.DebugUtil.java

License:Open Source License

public static void debugSwapBuffers(Eye eye) {
    if (eye == Stereoscopic3D.instance.renderer.currentEye) {
        try {/* w  w w  .ja  va  2  s .c  o  m*/
            GL11.glFlush();
            Display.swapBuffers();
            Thread.sleep(1000);
            Display.swapBuffers();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

From source file:zsawyer.mods.stereoscopic3d.DebugUtil.java

License:Open Source License

public static void drawStereoscopicSquare(Eye eye) {
    // switch position depending on eye
    int offset = 10 * eye.ordinal();
    // switch color depending on eye
    GL11.glColor3f(eye.ordinal(), 0, 1 - eye.ordinal());
    // draw quad/*from ww w  . j  a  v a2s .c  om*/
    GL11.glBegin(GL11.GL_QUADS);
    {
        GL11.glVertex2f(100 + offset, 100);
        GL11.glVertex2f(100 + 200 + offset, 100);
        GL11.glVertex2f(100 + 200 + offset, 100 + 200);
        GL11.glVertex2f(100 + offset, 100 + 200);
    }
    GL11.glEnd();
    checkGLError();

    GL11.glFlush();
}

From source file:zsawyer.mods.stereoscopic3d.renderers.ScalingRenderer.java

License:Open Source License

@Override
public synchronized void cleanUpAfterFrame() {
    if (isPlaying()) {
        GL11.glFlush();
    }
}

From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java

License:Open Source License

protected synchronized void reinit() {
    reinitPending = true;// w  w w. j a va 2 s . c  o  m

    if (!Display.isDirty()) {
        int width = mc.displayWidth;
        int height = mc.displayHeight;

        savePreviousState();
        initStencilState();

        setupView(width, height);

        prepareStencilBuffer();

        drawStencilPattern(width, height);

        // disabling changes in stencil buffer
        GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
        GL11.glFlush();

        recoverPreviousState();

        reinitPending = false;
    }
}

From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java

License:Open Source License

public void cleanUpAfterFrame() {
    if (this.mc.theWorld != null && !this.mc.skipRenderWorld) {
        if (currentEye == Eye.LEFT) {
            GL11.glFlush();
        } else {/*from w w w.j a  va 2s  .  c om*/
            GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01);
        }
    }
}