Example usage for org.lwjgl.opengl GL11 glClearDepth

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

Introduction

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

Prototype

public static void glClearDepth(@NativeType("GLdouble") double depth) 

Source Link

Document

Sets the depth value used when clearing the depth buffer.

Usage

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void clearDepth(float d) {
    GL11.glClearDepth(d);
}

From source file:rtype.Prototyp.java

License:Open Source License

private void initGL() {

    GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping

    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
    GL11.glClearDepth(1.0f); // Depth Buffer Setup
    GL11.glDisable(GL11.GL_DEPTH_TEST); // Enables Depth Testing
    GL11.glEnable(GL11.GL_BLEND);/*  w ww  . j a va  2  s. c o m*/
    GL11.glDepthMask(false);
    GL11.glMatrixMode(GL11.GL_PROJECTION); // Select The Projection Matrix
    GL11.glLoadIdentity(); // Reset The Projection Matrix

    GLU.gluOrtho2D(-(int) SCREEN_WIDTH / 2, (int) SCREEN_WIDTH / 2, (int) -SCREEN_HEIGHT / 2,
            (int) SCREEN_HEIGHT / 2);

    GL11.glMatrixMode(GL11.GL_MODELVIEW);

    if (useDevil)
        ;//textureLoader = new DevilTextureLoader();
    else {
        textureLoader = new WorkAroundTextureLoader();
    }
    textureLoader.init();
}

From source file:steamcraft.common.items.armor.ItemBrassGoggles.java

License:Minecraft Mod Public

@Override
@SideOnly(Side.CLIENT)/*from w w w.  j  ava  2 s .com*/
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution,
        float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
    if ((ClientHelper.player() == null) || (ClientHelper.screen() != null))
        return;

    ItemStack helmet = ClientHelper.player().inventory.armorItemInSlot(3);

    if ((ClientHelper.settings().thirdPersonView == 0) && (helmet != null)
            && (helmet.getItem() == InitItems.itemBrassGoggles)) {
        ClientHelper.textureManager().bindTexture(overlay);
        Tessellator tessellator = Tessellator.instance;
        ScaledResolution scaledResolution = ClientHelper.resolution();
        int width = scaledResolution.getScaledWidth();
        int height = scaledResolution.getScaledHeight();

        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glDepthMask(false);

        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glClearDepth(1.0D);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
        tessellator.draw();
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_BLEND);
    }
}

From source file:steamcraft.common.items.armor.ItemDivingHelmet.java

License:Minecraft Mod Public

@Override
@SideOnly(Side.CLIENT)/* www  .  j a  va  2s .c  o m*/
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution,
        float partialTicks, boolean hasScreen, int mouseX, int mouseY) {
    if ((ClientHelper.player() == null) || (ClientHelper.screen() != null))
        return;

    ItemStack helmet = ClientHelper.player().inventory.armorItemInSlot(3);

    if ((ClientHelper.settings().thirdPersonView == 0) && (helmet != null)
            && (helmet.getItem() == InitItems.itemDivingHelmet))// &&
    // KeyHandler.keyPressed)
    {
        ClientHelper.textureManager().bindTexture(overlay);
        Tessellator tessellator = Tessellator.instance;
        ScaledResolution scaledResolution = ClientHelper.resolution();
        int width = scaledResolution.getScaledWidth();
        int height = scaledResolution.getScaledHeight();

        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glDepthMask(false);
        // GL11.glEnable(GL11.GL_BLEND);
        // GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR);
        // GL11.glColor3f(1.0F, 1.0F, 1.0F);
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glClearDepth(1.0D);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
        tessellator.draw();
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_BLEND);

        /*
         * if (!mc.gameSettings.hideGUI || mc.currentScreen != null) { int x = (Mouse.getX() * width) / mc.displayWidth; int y = height - (Mouse.getY() *
         * height) / mc.displayHeight - 1; mc.ingameGUI.renderGameOverlay(0.0F, mc.currentScreen != null, x, y); }
         */
    }
}

From source file:steamcraft.common.lib.events.EventHandlerClient.java

License:Minecraft Mod Public

@SubscribeEvent
@SideOnly(Side.CLIENT)/*from   w  ww  .j a v a  2  s.  c  om*/
public void onRenderOverlay(RenderGameOverlayEvent.Post event) {
    ResourceLocation overlay = new ResourceLocation(ModInfo.PREFIX + "textures/misc/spyglass.png");

    if (event.type != RenderGameOverlayEvent.ElementType.HELMET)
        return;

    EntityClientPlayerMP player = ClientHelper.player();

    if ((player != null) && (ClientHelper.screen() == null) && (player.inventory.getCurrentItem() != null)
            && (player.inventory.getCurrentItem().getItem() == InitItems.itemSpyglass)
            && (ClientHelper.settings().thirdPersonView == 0)) {
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_BLEND);

        ClientHelper.textureManager().bindTexture(overlay);
        Tessellator tessellator = Tessellator.instance;
        ScaledResolution scaledResolution = ClientHelper.resolution();
        int width = scaledResolution.getScaledWidth();
        int height = scaledResolution.getScaledHeight();

        GL11.glDepthMask(false);
        GL11.glClearDepth(1.0D);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
        tessellator.draw();
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_BLEND);
    }
}

From source file:steamcraft.common.lib.events.EventHandlerForge.java

License:Minecraft Mod Public

@SubscribeEvent
@SideOnly(Side.CLIENT)//from   www  .j av  a  2  s .  co  m
public void onRenderOverlay(RenderGameOverlayEvent.Chat event) {
    EntityClientPlayerMP player = ClientHelper.player();

    if ((player != null) && (ClientHelper.screen() == null) && (player.inventory.getCurrentItem() != null)
            && (player.inventory.getCurrentItem().getItem() == InitItems.itemSpyglass)
            && (ClientHelper.settings().thirdPersonView == 0)) {
        GL11.glDisable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_DEPTH_TEST);

        ClientHelper.textureManager().bindTexture(overlay);
        Tessellator tessellator = Tessellator.instance;
        ScaledResolution scaledResolution = ClientHelper.resolution();
        int width = scaledResolution.getScaledWidth();
        int height = scaledResolution.getScaledHeight();

        GL11.glDepthMask(false);

        GL11.glClearDepth(1.0D);
        tessellator.startDrawingQuads();
        tessellator.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D);
        tessellator.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D);
        tessellator.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D);
        tessellator.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D);
        tessellator.draw();
        GL11.glDepthMask(true);
        GL11.glEnable(GL11.GL_DEPTH_TEST);
        GL11.glEnable(GL11.GL_ALPHA_TEST);
        GL11.glDisable(GL11.GL_BLEND);
    }
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glClearDepth(double a) {
    GL11.glClearDepth(a);
}

From source file:tk.jacklin213.voxelgale.rendering.BasicRenderer.java

License:Apache License

private void initGL() {
    GL11.glEnable(GL11.GL_TEXTURE_2D);//from  w w w .j  av a  2 s  .  c  om
    GL11.glShadeModel(GL11.GL_SMOOTH);
    GL11.glClearColor(0, 0, 0, 0);
    GL11.glClearDepth(1);
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glDepthFunc(GL11.GL_LEQUAL);

    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();

    GLU.gluPerspective(45, (float) displayMode.getWidth() / (float) displayMode.getHeight(), 0.1f, 100);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
}

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

License:Open Source License

private void initGL() {
    GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping
    GL11.glShadeModel(GL11.GL_SMOOTH); // Enable Smooth Shading
    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
    GL11.glClearDepth(1.0f); // Depth Buffer Setup
    GL11.glEnable(GL11.GL_DEPTH_TEST); // Enables Depth Testing
    GL11.glDepthFunc(GL11.GL_LEQUAL); // The Type Of Depth Testing To Do

    // initProjectionScene();

    GL11.glEnable(GL11.GL_CULL_FACE);/*from ww w  .  j  a va  2  s  . c  o m*/

    ByteBuffer temp = ByteBuffer.allocateDirect(16);
    temp.order(ByteOrder.nativeOrder());
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer) temp.asFloatBuffer().put(lightAmbient).flip()); // Setup The Ambient
    // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, (FloatBuffer) temp.asFloatBuffer().put(lightDiffuse).flip()); // Setup The Diffuse
    // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION,
            (FloatBuffer) temp.asFloatBuffer().put(lightPosition).flip()); // Position The
    // Light
    GL11.glEnable(GL11.GL_LIGHT1); // Enable Light One

    // GL11.glEnable(GL11.GL_LIGHTING);

    Display.setVSyncEnabled(true);

}

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

License:Open Source License

private void initGL() {
    GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping
    GL11.glShadeModel(GL11.GL_SMOOTH); // Enable Smooth Shading
    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
    GL11.glClearDepth(1.0f); // Depth Buffer Setup
    GL11.glEnable(GL11.GL_DEPTH_TEST); // Enables Depth Testing
    GL11.glDepthFunc(GL11.GL_LEQUAL); // The Type Of Depth Testing To Do

    // initProjectionScene();

    GL11.glEnable(GL11.GL_CULL_FACE);/*from ww  w. ja va2  s. co m*/

    ByteBuffer temp = ByteBuffer.allocateDirect(16);
    temp.order(ByteOrder.nativeOrder());
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer) temp.asFloatBuffer().put(lightAmbient).flip()); // Setup The Ambient
                                                                                                                // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_DIFFUSE, (FloatBuffer) temp.asFloatBuffer().put(lightDiffuse).flip()); // Setup The Diffuse
                                                                                                                // Light
    GL11.glLight(GL11.GL_LIGHT1, GL11.GL_POSITION,
            (FloatBuffer) temp.asFloatBuffer().put(lightPosition).flip()); // Position The
                                                                                                                          // Light
    GL11.glEnable(GL11.GL_LIGHT1); // Enable Light One

    // GL11.glEnable(GL11.GL_LIGHTING);

    Display.setVSyncEnabled(true);

}