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 Function OpenGL Function Meaning
stensize ChoosePixelFormat
stencil(TRUE, ...) glEnable(GL_STENCIL_TEST) Enable stencil tests.
stencil glStencilOp Set stencil test actions.
stencil(... func, ...) glStencilFunc Set function and reference value for stencil testing.
swritemask glStencilMask Specify which stencil bits can be written.
glClearStencil Specify 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.