public static Boolean TryUpdate(UInt32 face, ref CachedStencilFunc current, CachedStencilFunc desired) { if (current.func == desired.func && current.reference == desired.reference && current.mask == desired.mask) { return(false); } current = desired; gl.StencilFuncSeparate(face, desired.func, desired.reference, (UInt32)desired.mask); gl.ThrowIfError(); return(true); }
public static Boolean TryUpdateCombined(ref CachedStencilFunc front, ref CachedStencilFunc back, CachedStencilFunc desired) { if (front.func == back.func && back.func == desired.func && front.reference == back.reference && back.reference == desired.reference && front.mask == back.mask && back.mask == desired.mask) { return(false); } front = desired; back = desired; gl.StencilFunc(desired.func, desired.reference, (UInt32)desired.mask); gl.ThrowIfError(); return(true); }