Example usage for org.lwjgl.opengl GL11 glLogicOp

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

Introduction

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

Prototype

public static void glLogicOp(@NativeType("GLenum") int op) 

Source Link

Document

Sets the logical framebuffer operation.

Usage

From source file:com.badlogic.gdx.backends.lwjgl.LwjglGL10.java

License:Apache License

public final void glLogicOp(int opcode) {
    GL11.glLogicOp(opcode);
}

From source file:jpcsp.graphics.RE.RenderingEngineLwjgl.java

License:Open Source License

@Override
public void setLogicOp(int logicOp) {
    GL11.glLogicOp(logicOpToGL[logicOp]);
}

From source file:net.malisis.core.client.gui.component.interaction.UITextField.java

License:Open Source License

/**
 * Draw the selection box of this {@link UITextField}.
 *
 * @param renderer the renderer/*w  w  w  .j ava  2  s .co m*/
 */
public void drawSelectionBox(GuiRenderer renderer) {

    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glLogicOp(GL11.GL_OR_REVERSE);

    CursorPosition first = cursorPosition.textPosition < selectionPosition.textPosition ? cursorPosition
            : selectionPosition;
    CursorPosition last = cursorPosition == first ? selectionPosition : cursorPosition;

    for (int i = first.line; i <= last.line; i++) {
        if (i >= lineOffset && i < lineOffset + visibleLines() && i < lines.size()) {
            int x = 0;
            int y = (i - lineOffset) * getLineHeight();
            int X = GuiRenderer.getStringWidth(lines.get(i), fontScale);

            if (i == first.line)
                x = first.getXOffset();
            if (i == last.line)
                X = last.getXOffset();

            selectShape.resetState();
            selectShape.setSize(Math.min(getWidth() - 2, X) - x, getLineHeight());
            selectShape.setPosition(x + 2, y + 1);

            rp.useTexture.set(false);
            rp.colorMultiplier.set(0x0000FF);

            renderer.drawShape(selectShape, rp);
        }
    }

    renderer.next();

    GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:net.wurstclient.altmanager.PasswordField.java

License:Open Source License

private void func_146188_c(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) {
    int var5;

    if (p_146188_1_ < p_146188_3_) {
        var5 = p_146188_1_;
        p_146188_1_ = p_146188_3_;/*from  w  w  w  .ja  v  a2s  . c  o m*/
        p_146188_3_ = var5;
    }

    if (p_146188_2_ < p_146188_4_) {
        var5 = p_146188_2_;
        p_146188_2_ = p_146188_4_;
        p_146188_4_ = var5;
    }

    if (p_146188_3_ > field_146209_f + field_146218_h)
        p_146188_3_ = field_146209_f + field_146218_h;

    if (p_146188_1_ > field_146209_f + field_146218_h)
        p_146188_1_ = field_146209_f + field_146218_h;

    Tessellator ts = Tessellator.getInstance();
    VertexBuffer vb = ts.getBuffer();
    GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glLogicOp(GL11.GL_OR_REVERSE);
    vb.begin(7, DefaultVertexFormats.POSITION_TEX);
    vb.pos(p_146188_1_, p_146188_4_, 0.0D);
    vb.pos(p_146188_3_, p_146188_4_, 0.0D);
    vb.pos(p_146188_3_, p_146188_2_, 0.0D);
    vb.pos(p_146188_1_, p_146188_2_, 0.0D);
    ts.draw();
    GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

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

License:Open Source License

public static void glLogicOp(int a) {
    GL11.glLogicOp(a);
}

From source file:tk.wurst_client.alts.gui.GuiPasswordField.java

License:Open Source License

private void func_146188_c(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) {
    int var5;

    if (p_146188_1_ < p_146188_3_) {
        var5 = p_146188_1_;
        p_146188_1_ = p_146188_3_;//from w w  w . j  ava2s  .  c  o  m
        p_146188_3_ = var5;
    }

    if (p_146188_2_ < p_146188_4_) {
        var5 = p_146188_2_;
        p_146188_2_ = p_146188_4_;
        p_146188_4_ = var5;
    }

    if (p_146188_3_ > field_146209_f + field_146218_h)
        p_146188_3_ = field_146209_f + field_146218_h;

    if (p_146188_1_ > field_146209_f + field_146218_h)
        p_146188_1_ = field_146209_f + field_146218_h;

    WorldRenderer var6 = Tessellator.getInstance().getWorldRenderer();
    GL11.glColor4f(0.0F, 0.0F, 255.0F, 255.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glLogicOp(GL11.GL_OR_REVERSE);
    var6.startDrawingQuads();
    var6.addVertex(p_146188_1_, p_146188_4_, 0.0D);
    var6.addVertex(p_146188_3_, p_146188_4_, 0.0D);
    var6.addVertex(p_146188_3_, p_146188_2_, 0.0D);
    var6.addVertex(p_146188_1_, p_146188_2_, 0.0D);
    var6.draw();
    GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}

From source file:uk.co.hexeption.darkforge.gui.alt.GuiPasswordField.java

License:Open Source License

private void func_146188_c(int p_146188_1_, int p_146188_2_, int p_146188_3_, int p_146188_4_) {

    if (p_146188_1_ < p_146188_3_) {
        int var5 = p_146188_1_;
        p_146188_1_ = p_146188_3_;/* ww  w .  j  av  a  2 s  .  co m*/
        p_146188_3_ = var5;
    }

    if (p_146188_2_ < p_146188_4_) {
        int var5 = p_146188_2_;
        p_146188_2_ = p_146188_4_;
        p_146188_4_ = var5;
    }

    if (p_146188_3_ > this.field_146209_f + this.field_146218_h) {
        p_146188_3_ = this.field_146209_f + this.field_146218_h;
    }

    if (p_146188_1_ > this.field_146209_f + this.field_146218_h) {
        p_146188_1_ = this.field_146209_f + this.field_146218_h;
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    GL11.glColor4f(50.0F, 50.0F, 150.0F, 255.0F);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glLogicOp(GL11.GL_OR_REVERSE);
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(p_146188_1_, p_146188_4_, 0.0D);
    vertexbuffer.pos(p_146188_3_, p_146188_4_, 0.0D);
    vertexbuffer.pos(p_146188_3_, p_146188_2_, 0.0D);
    vertexbuffer.pos(p_146188_1_, p_146188_2_, 0.0D);
    tessellator.draw();
    GL11.glDisable(GL11.GL_COLOR_LOGIC_OP);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}