Example usage for org.lwjgl.opengl GL11 glClear

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

Introduction

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

Prototype

public static void glClear(@NativeType("GLbitfield") int mask) 

Source Link

Document

Sets portions of every pixel in a particular buffer to the same value.

Usage

From source file:zildo.fwk.gfx.filter.BlurFilter.java

License:Open Source License

@Override
public void preFilter() {
    // Copy last texture in TexBuffer
    fbo.bindToTextureAndDepth(texBuffer[currentImage], depthTextureID, fboId);
    fbo.startRendering(fboId, sizeX, sizeY);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
}

From source file:zildo.fwk.opengl.compatibility.FBOHardware.java

License:Open Source License

@Override
public void startRendering(int myFBOId, int sizeX, int sizeY) {
    EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, myFBOId);

    GL11.glPushAttrib(GL11.GL_VIEWPORT_BIT);
    GL11.glViewport(0, 0, Zildo.viewPortX, Zildo.viewPortY);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
}

From source file:zildo.fwk.opengl.OpenGLZildo.java

License:Open Source License

@Override
public void render(boolean p_clientReady) {

    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear
    // The//w w  w.j  av a 2s.c om
    // Screen
    // And
    // The
    // Depth
    // Buffer

    GL11.glLoadIdentity(); // Reset The Projection Matrix

    // invert the y axis, down is positive
    float zz = z * 5.0f;
    if (zz != 0.0f) {
        GL11.glTranslatef(-zoomPosition.getX() * zz, zoomPosition.getY() * zz, 0.0f);
    }
    GL11.glScalef(1 + zz, -1 - zz, 1);
    if (ClientEngineZildo.filterCommand != null) {
        ClientEngineZildo.filterCommand.doPreFilter();
    }

    clientEngineZildo.renderFrame(awt);
    if (!p_clientReady && !awt) {
        clientEngineZildo.renderMenu();
    }

    if (ClientEngineZildo.filterCommand != null) {
        ClientEngineZildo.filterCommand.doFilter();
        ClientEngineZildo.filterCommand.doPostFilter();
    }

    if (framerate != 0) {
        Display.sync(framerate);
    }

    if (!awt) {
        Display.update();
    }
}

From source file:zildo.platform.filter.LwjglBilinearFilter.java

License:Open Source License

@Override
public void preFilter() {
    graphicStuff.fbo.startRendering(fboId, sizeX, sizeY);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
}

From source file:zildo.platform.filter.LwjglBlendFilter.java

License:Open Source License

@Override
public void preFilter() {
    // Copy last texture in TexBuffer
    graphicStuff.fbo.bindToTexture(textureID, fboId);
    graphicStuff.fbo.startRendering(fboId, sizeX, sizeY);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
}

From source file:zildo.platform.filter.LwjglBlurFilter.java

License:Open Source License

@Override
public void preFilter() {
    // Copy last texture in TexBuffer
    graphicStuff.fbo.bindToTexture(texBuffer[currentImage], fboId);
    graphicStuff.fbo.startRendering(fboId, sizeX, sizeY);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
}

From source file:zildo.platform.opengl.LwjglOpenGLGestion.java

License:Open Source License

@Override
public void render(boolean p_clientReady) {

    // Clear the screen and the depth buffer
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity(); // Reset The Projection Matrix

    // invert the y axis, down is positive
    float zz = z * 5.0f;
    if (zz != 0.0f) {
        GL11.glTranslatef(-zoomPosition.getX() * zz, zoomPosition.getY() * zz, 0.0f);
    }/*from  w w w.j a  v a 2s  .  co  m*/
    GL11.glScalef(1 + zz, -1 - zz, 1);
    if (ClientEngineZildo.filterCommand != null) {
        ClientEngineZildo.filterCommand.doPreFilter();
    }

    clientEngineZildo.renderFrame(awt);
    /*
    if (!p_clientReady && !awt) {
       clientEngineZildo.renderMenu();
    }
    */
    for (GameStage stage : ClientEngineZildo.getClientForGame().getCurrentStages()) {
        stage.renderGame();
    }

    if (ClientEngineZildo.filterCommand != null) {
        ClientEngineZildo.filterCommand.doFilter();
        ClientEngineZildo.filterCommand.doPostFilter();
    }

    if (framerate != 0) {
        Display.sync(framerate);
    }

    if (!awt) {
        Display.update();
    }
}

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

License:Open Source License

/**
 * Displays a new screen.// w  w  w . j  ava2s. c o m
 */
public static void loadScreen() throws LWJGLException {
    ScaledResolution var1 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
    GL11.glClear(16640);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
    GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
    GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_FOG);
    Tessellator var2 = Tessellator.instance;
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("/title/mojang.png"));
    var2.startDrawingQuads();
    var2.setColorOpaque_I(16777215);
    var2.addVertexWithUV(0.0D, (double) mc.displayHeight, 0.0D, 0.0D, 0.0D);
    var2.addVertexWithUV((double) mc.displayWidth, (double) mc.displayHeight, 0.0D, 0.0D, 0.0D);
    var2.addVertexWithUV((double) mc.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
    var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
    var2.draw();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    var2.setColorOpaque_I(16777215);
    short var3 = 256;
    short var4 = 256;
    mc.scaledTessellator((var1.getScaledWidth() - var3) / 2, (var1.getScaledHeight() - var4) / 2, 0, 0, var3,
            var4);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_FOG);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
    Display.swapBuffers();
}

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

License:Open Source License

protected void prepareStencilBuffer() {
    GL11.glDrawBuffer(GL11.GL_BACK);//from  w w  w . j  ava  2s .co m
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    GL11.glStencilMask(0xff);
    GL11.glClearStencil(0);
    GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT
    // | GL11.GL_DEPTH_BUFFER_BIT);

    GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE);
    // to avoid interaction with stencil content
    GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01);
}

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

License:Open Source License

protected void setupImage(int stencilFunc) {
    GL11.glDrawBuffer(GL11.GL_BACK);//from w w  w  .j a v a2  s . c  om
    GL11.glStencilFunc(stencilFunc, 1, 0x01);
    // Clear the screen and depth buffer
    GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT);
}