Example usage for org.lwjgl.opengl GL11 glDisable

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

Introduction

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

Prototype

public static void glDisable(@NativeType("GLenum") int target) 

Source Link

Document

Disables the specified OpenGL state.

Usage

From source file:com.gameminers.mav.render.Rendering.java

License:Open Source License

public static void drawRectangle(float x, float y, float width, float height, float r, float g, float b,
        float a, float z) {
    GL11.glPushMatrix();//from w w w.  jav a 2  s.com
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glTranslatef(0, 0, z);
    GL11.glColor4f(r, g, b, a);
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2f(x, y);
    GL11.glVertex2f(x + width, y);
    GL11.glVertex2f(x + width, y + height);
    GL11.glVertex2f(x, y + height);
    GL11.glEnd();
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glPopMatrix();
}

From source file:com.gameminers.mav.render.Rendering.java

License:Open Source License

public static void setUpGL() {
    GL11.glEnable(GL11.GL_TEXTURE_2D);/*from  ww w .j  a  v a2  s.c  o m*/
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_LIGHTING);

    GL11.glClearDepth(1);

    GL11.glShadeModel(GL11.GL_FLAT);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}

From source file:com.ggollmer.inevera.client.renderer.GreatwardComponentBlockRenderer.java

License:LGPL

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
        RenderBlocks renderer) {//from  ww w .  j a v a2 s . c o m
    if (!(block instanceof BlockGreatwardComponent)) {
        return false;
    }

    GL11.glEnable(GL11.GL_BLEND);
    renderInnerCube(world, x, y, z, block,
            ((BlockGreatwardComponent) block).getCoreIcon(world.getBlockMetadata(x, y, z)));
    renderer.renderStandardBlock(block, x, y, z);
    GL11.glDisable(GL11.GL_BLEND);

    return true;
}

From source file:com.gjkf.fc.client.gui.inventory.CoreGui.java

License:Open Source License

@Override
public void drawForeground() {
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_DEPTH_TEST);/*ww  w  .ja v a2s  .co  m*/

    /*
     * This will write the desidered type of degree
     */

    if (type[selectedType].equals("C")) {
        GuiDraw.drawString(String.format("Temperature: %.2f %s", temp, type[0]), 20, 30, 0x1c9727);
    } else if (type[selectedType].equals("F")) {
        GuiDraw.drawString(String.format("Temperature: %.2f %s", temp, type[1]), 20, 30, 0x1c9727);
    } else if (type[selectedType].equals("K")) {
        GuiDraw.drawString(String.format("Temperature: %.2f %s", temp, type[2]), 20, 30, 0x1c9727);
    } else {
        GuiDraw.drawString(String.format("Temperature: %.2f %s", temp, type[0]), 20, 30, 0x1c9727);
    }

    GuiDraw.drawString(String.format("Humidity: %.2f", hum), 20, 50, 0x1c9727);
    GuiDraw.drawString(String.format("Pressure: %.2f millibar", press), 20, 70, 0x1c9727);

    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_DEPTH_TEST);
}

From source file:com.golden.gamedev.engine.lwjgl.LWJGLGraphics.java

License:Open Source License

public void drawLine(int x1, int y1, int x2, int y2) {
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    GL11.glColor4f((float) this.color.getRed() / 255f, (float) this.color.getGreen() / 255f,
            (float) this.color.getBlue() / 255f, (float) this.color.getAlpha() / 255f);
    GL11.glLineWidth(1.0f);//  w  w w .  j  av  a  2  s  .  com

    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2f(x1, y1);
    GL11.glVertex2f(x2, y2);
    GL11.glEnd();

    GL11.glColor3f(1.0f, 1.0f, 1.0f);

    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:com.golden.gamedev.engine.lwjgl.LWJGLGraphics.java

License:Open Source License

public void setClip(Shape clip) {
    this.clipArea = (Rectangle) clip;

    if (this.clipArea == null) {
        GL11.glDisable(GL11.GL_SCISSOR_TEST);

    } else {/* ww w .  jav a  2s .  c  om*/
        this.setClip(this.clipArea.x, this.clipArea.y, this.clipArea.width, this.clipArea.height);
    }
}

From source file:com.golden.gamedev.engine.lwjgl.LWJGLGraphics.java

License:Open Source License

private void drawRect(int x, int y, int width, int height, int type, Color col) {
    GL11.glDisable(GL11.GL_TEXTURE_2D);

    GL11.glColor4f((float) col.getRed() / 255f, (float) col.getGreen() / 255f, (float) col.getBlue() / 255f,
            (float) col.getAlpha() / 255f);
    GL11.glLineWidth(1.0f);/*from w w w.  ja  v  a  2  s  .co m*/

    GL11.glBegin(type);
    GL11.glVertex2f(x, y);
    GL11.glVertex2f(x + width, y);
    GL11.glVertex2f(x + width, y + height);
    GL11.glVertex2f(x, y + height);
    GL11.glEnd();

    GL11.glColor3f(1.0f, 1.0f, 1.0f);

    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:com.golden.gamedev.engine.lwjgl.LWJGLMode.java

License:Open Source License

private void initGL() {
    // init GL/*w w w  . j  ava  2  s.  c om*/
    // enable textures since we're going to use these for our sprites
    GL11.glEnable(GL11.GL_TEXTURE_2D);

    // disable the OpenGL depth test since we're rendering 2D graphics
    GL11.glDisable(GL11.GL_DEPTH_TEST);

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

    GL11.glOrtho(0, this.size.width, this.size.height, 0, -1, 1);

    // enable transparency
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}

From source file:com.grillecube.client.renderer.gui.GuiRenderer.java

@Override
public void render() {

    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_BLEND);//w w  w  . ja  v a2  s. c  o m
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    // render them in the correct order
    for (Gui gui : this.renderingList) {
        gui.render(this);
    }

    GL11.glDisable(GL11.GL_BLEND);
}

From source file:com.grillecube.client.renderer.model.ModelRenderer.java

/** render world terrains */
public void render(CameraProjective camera, HashMap<Model, ArrayList<ModelInstance>> renderingList) {

    if (this.getMainRenderer().getGLFWWindow().isKeyPressed(GLFW.GLFW_KEY_F)) {
        GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
    }/*from  ww  w . j  a  v a  2  s .  c  o  m*/

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_DEPTH_TEST);

    // enable model program
    this.programModel.useStart();
    {
        // load global uniforms
        this.programModel.loadCamera(camera);

        // for each entity to render
        for (ArrayList<ModelInstance> models : renderingList.values()) {
            if (models.size() > 0) {
                Model model = models.get(0).getModel();
                model.bind();
                this.programModel.loadModel(model);
                for (ModelInstance instance : models) {
                    this.programModel.loadModelInstance(instance);
                    model.draw();
                }
            }
        }
    }
    this.programModel.useStop();
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
}