protected override void SetRenderState(RenderStateBool renderStateBool, bool value) { switch (renderStateBool) { case RenderStateBool.WaitForVerticalBlank: mVSync = value; OnVSyncChanged(); break; case RenderStateBool.ZBufferTest: mDevice.Device.SetRenderState(RenderState.ZEnable, value); return; case RenderStateBool.StencilBufferTest: mDevice.Device.SetRenderState(RenderState.StencilEnable, value); return; case RenderStateBool.AlphaBlend: mDevice.AlphaBlend = value; break; case RenderStateBool.ZBufferWrite: mDevice.Device.SetRenderState(RenderState.ZWriteEnable, value); break; default: throw new NotSupportedException(string.Format( "The specified render state, {0}, is not supported by this driver.")); } }
protected override bool GetRenderState(RenderStateBool renderStateBool) { switch (renderStateBool) { // vsync is not supported, but shouldn't throw an error. case RenderStateBool.WaitForVerticalBlank: return(false); case RenderStateBool.AlphaBlend: return(mEnableAlphaBlend); default: throw new NotSupportedException(string.Format( "The specified render state, {0}, is not supported by this driver.")); } }
protected override bool GetRenderState(RenderStateBool renderStateBool) { switch (renderStateBool) { case RenderStateBool.WaitForVerticalBlank: return(mVSync); case RenderStateBool.ZBufferTest: return(mDevice.Device.GetRenderState <bool>(RenderState.ZEnable)); case RenderStateBool.StencilBufferTest: return(mDevice.Device.GetRenderState <bool>(RenderState.StencilEnable)); case RenderStateBool.AlphaBlend: return(mDevice.AlphaBlend); case RenderStateBool.ZBufferWrite: return(mDevice.Device.GetRenderState <bool>(RenderState.ZWriteEnable)); default: throw new NotSupportedException(string.Format( "The specified render state, {0}, is not supported by this driver.", renderStateBool)); } }
protected override void SetRenderState(RenderStateBool renderStateBool, bool value) { switch (renderStateBool) { case RenderStateBool.WaitForVerticalBlank: // vsync is not supported, but shouldn't throw an error. break; case RenderStateBool.AlphaBlend: mEnableAlphaBlend = value; SetAlphaBlend(); break; default: throw new NotSupportedException(string.Format( "The specified render state, {0}, is not supported by this driver.")); } }