public override void Execute() { #if !DISABLE_CACHE if (last == this) { return; } if ( (stateCache.Red != Red) || (stateCache.Green != Green) || (stateCache.Blue != Blue) || (stateCache.Alpha != Alpha) ) #endif { GL.ColorMask(Red, Green, Blue, Alpha); stateCache.Red = Red; stateCache.Green = Green; stateCache.Blue = Blue; stateCache.Alpha = Alpha; } #if !DISABLE_CACHE if (stateCache.Depth != Depth) #endif { GL.DepthMask(Depth); stateCache.Depth = Depth; } last = this; }
public static void ResetState() { GL.ColorMask(true, true, true, true); stateCache.Red = true; stateCache.Green = true; stateCache.Blue = true; stateCache.Alpha = true; last = null; }