Example usage for org.lwjgl.opengl GL14 glBlendFuncSeparate

List of usage examples for org.lwjgl.opengl GL14 glBlendFuncSeparate

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL14 glBlendFuncSeparate.

Prototype

public static void glBlendFuncSeparate(@NativeType("GLenum") int sfactorRGB,
        @NativeType("GLenum") int dfactorRGB, @NativeType("GLenum") int sfactorAlpha,
        @NativeType("GLenum") int dfactorAlpha) 

Source Link

Document

Specifies pixel arithmetic for RGB and alpha components separately.

Usage

From source file:com.badlogic.gdx.backends.jglfw.JglfwGL20.java

License:Apache License

public void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
    GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}

From source file:com.dinasgames.engine.graphics.GL.java

public static void blendFactor(int colorSrcFactor, int colorDstFactor, int alphaSrcFactor, int alphaDstFactor) {

    // OpenGL 1.4
    if (version >= 14) {
        GL14.glBlendFuncSeparate(colorSrcFactor, colorDstFactor, alphaSrcFactor, alphaDstFactor);
        return;//from  ww w.  j a va 2 s . c  om
    }

    // OpenGL 1.1
    if (version >= 11) {
        GL11.glBlendFunc(colorSrcFactor, colorDstFactor);
        return;
    }

}

From source file:fr.ign.cogit.geoxygene.appli.render.LwjglLayerRenderer.java

License:Open Source License

/**
 * Initialize layer FBO to receive GL primitives from a set of identical
 * symbolizers/*from   w ww  .  ja  v a 2  s.com*/
 * 
 * @param primitive
 * @param opacity
 * @param currentSymbolizer
 * @throws GLException
 */
private void clearFBOLayer() throws GLException {
    GLTools.glCheckError("preparing next FBO Layer");
    GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, this.getLayerViewPanel().getGLCanvas().getFboId());
    GL11.glDrawBuffer(GL30.GL_COLOR_ATTACHMENT0);

    GLTools.glCheckError("bind frame buffer");

    // Blending mode in FBO drawing.
    GLTools.glCheckError("finalizing FBO initialization");
    GL11.glClearColor(0f, 0f, 0f, 0f);
    GLTools.glCheckError("finalizing FBO initialization");
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

    GLTools.glCheckError("finalizing FBO initialization");
    glEnable(GL11.GL_BLEND);
    GLTools.glCheckError("finalizing FBO initialization");
    GL20.glBlendEquationSeparate(GL14.GL_FUNC_ADD, GL14.GL_MAX);
    GLTools.glCheckError("finalizing FBO initialization");
    GL14.glBlendFuncSeparate(GL11.GL_ONE, GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_ZERO);
    GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0);
    GLTools.glCheckError("finalizing FBO initialization");
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
    GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}

From source file:net.neilcsmith.praxis.video.opengl.internal.GLRenderer.java

License:Apache License

private void renderMesh() {

    if (idx == 0) {
        return;/*from w w w . j a  v  a  2 s  . co m*/
    }

    int spritesInBatch = idx / 20;

    if (tex0 == null) {
        LOGGER.log(Level.WARNING, "Texture is null - returning : idx = {0}", idx);
        return;
    }

    tex0.bind();
    mesh.setVertices(vertices, 0, idx);

    if (blendingDisabled) {
        GL11.glDisable(GL11.GL_BLEND);
    } else {
        GL11.glEnable(GL11.GL_BLEND);
        if (blendSrcFunc == blendSrcAlphaFunc && blendDstFunc == blendDstAlphaFunc) {
            GL11.glBlendFunc(blendSrcFunc, blendDstFunc);
        } else {
            GL14.glBlendFuncSeparate(blendSrcFunc, blendDstFunc, blendSrcAlphaFunc, blendDstAlphaFunc);
        }
    }

    if (customShader != null) {
        LOGGER.finest("Rendering with custom shader");
        mesh.render(customShader, GL11.GL_TRIANGLES, 0, spritesInBatch * 6);
    } else {
        LOGGER.finest("Rendering with default shader");
        mesh.render(shader, GL11.GL_TRIANGLES, 0, spritesInBatch * 6);
    }

    idx = 0;
    currBufferIdx++;
    if (currBufferIdx == buffers.length) {
        currBufferIdx = 0;
    }
    mesh = buffers[currBufferIdx];
}

From source file:org.oscim.gdx.LwjglGL20.java

License:Apache License

public void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
    GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
    GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void blendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha) {
    GL14.glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
}

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

License:Open Source License

public static void glBlendFuncSeparate(int a, int b, int c, int d) {
    GL14.glBlendFuncSeparate(a, b, c, d);
}