Porting Stencil Plane Calls

In OpenGL, you allocate stencil planes by requesting the appropriate pixel format with the OpenGL auxInitDisplayMode or ChoosePixelFormat. functions. The following table lists IRIS GL functions that affect the stencil planes and their equivalent OpenGL functions.

IRIS GL functionOpenGL functionMeaning
stencil( TRUE, ... ) glEnable ( GL_STENCIL_TEST )Enables stencil tests.
stencil glStencilOp Sets stencil test actions.
stencil(... func, ... ) glStencilFunc Sets function and reference value for stencil testing.
swritemask glStencilMask Specifies which stencil bits can be written.
glClearStencil Specifies the clear value for the stencil buffer.
sclear glClear ( GL_STENCIL_BUFFER_BIT )


Stencil-comparison functions and stencil pass/fail operations are nearly equivalent in OpenGL and IRIS GL. The IRIS GL stencil-function flags are prefaced with SF; the OpenGL flags with GL. IRIS GL pass/fail operation flags are prefaced with ST; the OpenGL flags with GL.