Skip to main content

StencilBufferNumberPool

A static class in Root.Township, the global namespace.

Hands out unique stencil buffer values (1 to 250) so effects don't share a stencil number.

Fields​

2 private and internal fields
MemberWhat it is
private static int lastUsedIndex the next search starts from.
private static bool[] usedWhich stencil slots are taken.

Methods​

MemberWhat it is
static int GetStencilBufferNumber()Returns a free stencil number and marks it used. Returns 1 if all are taken.
static void ReleaseStencilBufferNumber(int stencilNumber)Marks a stencil number as free again.