PDA

View Full Version : Stencil buffer problem



Loicus
08-13-2012, 01:23 AM
Dear all,

I am trying to use the stencil buffer for the first time,
and my test is not really succesfull so far...

Here is the code I've been added in my "init" function. I am working in Java with JOGL, but I don't think that this is the issue.
After this code, I would expect that nothing can be drawn on my screen..., since:
1) I clear the buffer with "1"
2) I use the glStencilFunc with GL_NEVER.


gl.glEnable(GL2GL_STENCIL_TEST);

gl.glClearStencil(0x1);

gl.glClear(GL2.
GL_STENCIL_BUFFER_BIT);

gl.glStencilFunc(GL2.
GL_NEVER, 0x1, 0x1);

gl.glStencilOp(GL2.
GL_KEEP, GL2.GL_KEEP, GL2.GL_KEEP);



Unfortunately, I can change whatever I want to the stencil function,
I always have all my objects being displaied on screen.
What am I missing ?

Thanks for help,
Loic

Loicus
08-13-2012, 02:09 AM
never mind,
it seems that the problem is due to the fact that I can not create a canvas with simultaniously the Stencil buffer and the Stereo (Quard) Buffers
If I disable the Stereo flag, it works fine