public static void ResetState() { GL.CullFace(CullFaceMode.Back); stateCache.CullFaceMode = CullFaceMode.Back; GL.FrontFace(FrontFaceDirection.Ccw); stateCache.FrontFaceDirection = FrontFaceDirection.Ccw; GL.Disable(EnableCap.CullFace); stateCache.Enabled = false; last = null; }
public override void Execute() { #if !DISABLE_CACHE if (last == this) { return; } #endif if (Enabled) { #if !DISABLE_CACHE if (stateCache.Enabled == false) #endif { GL.Enable(EnableCap.CullFace); stateCache.Enabled = true; } #if !DISABLE_CACHE if (stateCache.CullFaceMode != CullFaceMode) #endif { GL.CullFace(CullFaceMode); stateCache.CullFaceMode = CullFaceMode; } #if !DISABLE_CACHE if (stateCache.FrontFaceDirection != FrontFaceDirection) #endif { GL.FrontFace(FrontFaceDirection); stateCache.FrontFaceDirection = FrontFaceDirection; } } else { #if !DISABLE_CACHE if (stateCache.Enabled == true) #endif { GL.Disable(EnableCap.CullFace); stateCache.Enabled = false; } } last = this; }