Example usage for org.lwjgl.opengl GL11 glClearStencil

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

Introduction

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

Prototype

public static void glClearStencil(@NativeType("GLint") int s) 

Source Link

Document

Sets the value to which to clear the stencil buffer.

Usage

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

License:Open Source License

protected void prepareStencilBuffer() {
    GL11.glDrawBuffer(GL11.GL_BACK);//from   w  ww  .j  a v a  2  s . c  o m
    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);
}