Example usage for org.lwjgl.opengl GL11 glStencilOp

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

Introduction

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

Prototype

public static void glStencilOp(@NativeType("GLenum") int sfail, @NativeType("GLenum") int dpfail,
        @NativeType("GLenum") int dppass) 

Source Link

Document

Indicates what happens to the stored stencil value if this or certain subsequent tests fail or pass.

Usage

From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java

License:Open Source License

protected void prepareStencilBuffer() {
    GL11.glDrawBuffer(GL11.GL_BACK);/* ww w .  j  a v  a  2s  .  com*/
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    GL11.glStencilMask(0xff);
    GL11.glClearStencil(0);
    GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT
    // | GL11.GL_DEPTH_BUFFER_BIT);

    GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE);
    // to avoid interaction with stencil content
    GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01);
}