protected override void SwitchOn() { this.enableCapacityWhenSwitchOn = this.EnableCapacity; this.originalEnableCapacity = OpenGL.IsEnabled(this.Capacity) != 0; if (this.enableCapacityWhenSwitchOn) { if (!this.originalEnableCapacity) { OpenGL.Enable(Capacity); } } else { if (this.originalEnableCapacity) { OpenGL.Disable(Capacity); } } }
/// <summary> /// GL.Enable(capacity); or GL.Disable(capacity); /// </summary> /// <param name="capacity"></param> /// <param name="enableCapacity">Enable() or Disable() this capacity?</param> public EnableSwitch(uint capacity, bool enableCapacity) { byte original = OpenGL.IsEnabled(capacity); this.Init(capacity, enableCapacity); }