Example usage for com.badlogic.gdx.graphics GL10 GL_ZERO

List of usage examples for com.badlogic.gdx.graphics GL10 GL_ZERO

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL10 GL_ZERO.

Prototype

int GL_ZERO

To view the source code for com.badlogic.gdx.graphics GL10 GL_ZERO.

Click Source Link

Usage

From source file:org.illarion.engine.backend.gdx.GdxGraphics.java

License:Open Source License

private void activateShapeRenderer() {
    if (shapeRenderer.getCurrentType() != null) {
        return;/*  w w w. ja v  a 2  s  .c  om*/
    }
    if (spriteBatchActive) {
        spriteBatch.end();
        spriteBatchActive = false;
    }

    gdxGraphics.getGLCommon().glEnable(GL10.GL_BLEND);
    switch (lastBlendingMode) {
    case AlphaBlend:
        gdxGraphics.getGLCommon().glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
        break;
    case Multiply:
        gdxGraphics.getGLCommon().glBlendFunc(GL10.GL_DST_COLOR, GL10.GL_ZERO);
        break;
    }
    shapeRenderer.begin(ShapeRenderer.ShapeType.FilledRectangle);
}

From source file:org.illarion.engine.backend.gdx.GdxGraphics.java

License:Open Source License

@Override
public void setBlendingMode(@Nonnull final BlendingMode mode) {
    if (lastBlendingMode == mode) {
        return;/*from  w  ww.ja va  2s.com*/
    }
    switch (mode) {
    case AlphaBlend:
        spriteBatch.setBlendFunction(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
        break;
    case Multiply:
        spriteBatch.setBlendFunction(GL10.GL_DST_COLOR, GL10.GL_ZERO);
        break;
    }
    spriteBatch.enableBlending();
    lastBlendingMode = mode;
}