예제 #1
0
        public static Boolean TryUpdate(UInt32 face, ref CachedStencilOp current, CachedStencilOp desired)
        {
            if (current.sfail == desired.sfail && current.dpfail == desired.dpfail && current.dppass == desired.dppass)
            {
                return(false);
            }

            current = desired;
            gl.StencilOpSeparate(face, desired.sfail, desired.dpfail, desired.dppass);
            gl.ThrowIfError();

            return(true);
        }
예제 #2
0
        public static Boolean TryUpdateCombined(ref CachedStencilOp front, ref CachedStencilOp back, CachedStencilOp desired)
        {
            if (front.sfail == back.sfail && back.sfail == desired.sfail &&
                front.dpfail == back.dpfail && back.dpfail == desired.dpfail &&
                front.dppass == back.dppass && back.dppass == desired.dppass)
            {
                return(false);
            }

            front = desired;
            back  = desired;
            gl.StencilOp(desired.sfail, desired.dpfail, desired.dppass);
            gl.ThrowIfError();

            return(true);
        }