diff options
author | Kevin Rushforth <[email protected]> | 2007-03-26 22:58:59 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2007-03-26 22:58:59 +0000 |
commit | d319a907da13b127971aec547022a7dce8cb9c05 (patch) | |
tree | 02fb5b94e0493d4e21bf24b9afc3b64d019fe34b /src/classes/jogl/javax/media | |
parent | e9005593c05ad268256398f2901febdc14d95b26 (diff) |
Issue 239: Stencil buffer should be cleared at the start of each frame
This partial fix adds a new "j3d.stencilClear" boolean property that specifies
whether the stencil buffer is cleared every frame by default.
Note that this is the first part of the partial fix. We still need to finish
the D3D code, and we need to verify whether the stencil mask needs to be
saved/forced to all 1s/restored
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@802 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/jogl/javax/media')
-rw-r--r-- | src/classes/jogl/javax/media/j3d/JoglPipeline.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglPipeline.java b/src/classes/jogl/javax/media/j3d/JoglPipeline.java index 6fdbb9b..4ba4868 100644 --- a/src/classes/jogl/javax/media/j3d/JoglPipeline.java +++ b/src/classes/jogl/javax/media/j3d/JoglPipeline.java @@ -7631,7 +7631,7 @@ class JoglPipeline extends Pipeline { return true; } - void clear(Context ctx, float r, float g, float b) { + void clear(Context ctx, float r, float g, float b, boolean clearStencil) { if (VERBOSE) System.err.println("JoglPipeline.clear()"); JoglContext jctx = (JoglContext) ctx; @@ -7645,7 +7645,15 @@ class JoglPipeline extends Pipeline { gl.glDepthMask(true); gl.glClear(GL.GL_DEPTH_BUFFER_BIT); gl.glPopAttrib(); - + + // Issue 239 - clear stencil if specified + // TODO KCR : Issue 239 - should we also set stencil mask? If so, we + // may need to save/restore like we do for depth mask + if (clearStencil) { + gl.glClearStencil(0); + gl.glClear(GL.GL_STENCIL_BUFFER_BIT); + } + } void textureFillBackground(Context ctx, float texMinU, float texMaxU, float texMinV, float texMaxV, |