List of usage examples for org.lwjgl.opengl EXTBlendEquationSeparate glBlendEquationSeparateEXT
public static native void glBlendEquationSeparateEXT(@NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha);
From source file:com.ardor3d.scene.state.lwjgl.LwjglBlendStateUtil.java
License:Open Source License
protected static void applyBlendEquations(final boolean enabled, final BlendState state, final BlendStateRecord record, final ContextCapabilities caps) { if (record.isValid()) { if (enabled) { if (!record.blendEnabled) { GL11.glEnable(GL11.GL_BLEND); record.blendEnabled = true; }// w w w . j av a 2s .c o m final int blendEqRGB = getGLEquationValue(state.getBlendEquationRGB(), caps); if (caps.isSeparateBlendEquationsSupported()) { final int blendEqAlpha = getGLEquationValue(state.getBlendEquationAlpha(), caps); if (record.blendEqRGB != blendEqRGB || record.blendEqAlpha != blendEqAlpha) { EXTBlendEquationSeparate.glBlendEquationSeparateEXT(blendEqRGB, blendEqAlpha); record.blendEqRGB = blendEqRGB; record.blendEqAlpha = blendEqAlpha; } } else if (caps.isBlendEquationSupported()) { if (record.blendEqRGB != blendEqRGB) { ARBImaging.glBlendEquation(blendEqRGB); record.blendEqRGB = blendEqRGB; } } } else if (record.blendEnabled) { GL11.glDisable(GL11.GL_BLEND); record.blendEnabled = false; } } else { if (enabled) { GL11.glEnable(GL11.GL_BLEND); record.blendEnabled = true; final int blendEqRGB = getGLEquationValue(state.getBlendEquationRGB(), caps); if (caps.isSeparateBlendEquationsSupported()) { final int blendEqAlpha = getGLEquationValue(state.getBlendEquationAlpha(), caps); EXTBlendEquationSeparate.glBlendEquationSeparateEXT(blendEqRGB, blendEqAlpha); record.blendEqRGB = blendEqRGB; record.blendEqAlpha = blendEqAlpha; } else if (caps.isBlendEquationSupported()) { ARBImaging.glBlendEquation(blendEqRGB); record.blendEqRGB = blendEqRGB; } } else { GL11.glDisable(GL11.GL_BLEND); record.blendEnabled = false; } } }