Exemplo n.º 1
0
  public void setBlendMode(int mode) {
    oldBlendMode = blendMode;
    blendMode = mode;

    GL14.glBlendEquation(GL14.GL_FUNC_ADD);
    if (mode < 100) {
      g.setDrawMode(mode);
      return;
    }

    try {
      Reflection.invokePrivateMethod(mPredraw, g);
    } catch (Exception e) {
      App.getApp().handle(e);
    }
    gl.glEnable(SGL.GL_BLEND);
    gl.glColorMask(true, true, true, true);

    if (mode == BM_ADD || mode == BM_SUBTRACT) {
      gl.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE);
      if (mode == BM_SUBTRACT) {
        GL14.glBlendEquation(GL14.GL_FUNC_SUBTRACT);
        GL14.glBlendEquation(GL14.GL_FUNC_REVERSE_SUBTRACT);
      }
    }

    try {
      Reflection.invokePrivateMethod(mPostdraw, g);
    } catch (Exception e) {
      App.getApp().handle(e);
    }
  }
Exemplo n.º 2
0
  private void renderCursor(float x, float y, Context c) {
    if (blinkTime < blinkPeriod / 2) {
      GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
      GL14.glBlendFuncSeparate(
          GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_ZERO);
      GL20.glBlendEquationSeparate(GL14.GL_FUNC_ADD, GL14.GL_FUNC_ADD);

      c.resetColor();
      c.pushTransform();
      c.appendTransform(Matrix.translation(x, y, 0));
      font.getSprite(getCursorChar()).render(c);
      c.popTransform();

      GL11.glPopAttrib();
    }
  }
Exemplo n.º 3
0
 /*  44:    */
 /*  45:    */ public void a() /*  46:    */ {
   /*  47: 46 */ if (equals(a)) {
     /*  48: 47 */ return;
     /*  49:    */ }
   /*  50: 50 */ if ((a == null) || (this.h != a.b()))
   /*  51:    */ {
     /*  52: 51 */ a = this;
     /*  53: 52 */ if (this.h)
     /*  54:    */ {
       /*  55: 53 */ cjm.k();
       /*  56: 54 */ return;
       /*  57:    */ }
     /*  58: 56 */ cjm.l();
     /*  59:    */ }
   /*  60: 59 */ GL14.glBlendEquation(this.f);
   /*  61: 61 */ if (this.g) {
     /*  62: 62 */ cjm.a(this.b, this.d, this.c, this.e);
     /*  63:    */ } else {
     /*  64: 64 */ cjm.b(this.b, this.d);
     /*  65:    */ }
   /*  66:    */ }
Exemplo n.º 4
0
 public void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
   GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
 }
Exemplo n.º 5
0
 public void glBlendEquation(int mode) {
   GL14.glBlendEquation(mode);
 }
Exemplo n.º 6
0
 public void glBlendColor(float red, float green, float blue, float alpha) {
   GL14.glBlendColor(red, green, blue, alpha);
 }