本文整理汇总了C#中FeralTic.DX11.DX11RenderContext.CleanUpPS方法的典型用法代码示例。如果您正苦于以下问题:C# DX11RenderContext.CleanUpPS方法的具体用法?C# DX11RenderContext.CleanUpPS怎么用?C# DX11RenderContext.CleanUpPS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FeralTic.DX11.DX11RenderContext
的用法示例。
在下文中一共展示了DX11RenderContext.CleanUpPS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public void Render(DX11RenderContext context)
{
if (this.lasthandle != this.Handle)
{
if (this.swapchain != null)
{
if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); }
}
this.lasthandle = this.Handle;
}
if (!this.swapchain.Contains(context))
{
this.swapchain[context] = new DX11SwapChain(context, this.Handle,
SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0),60,1);
}
if (this.resized)
{
this.swapchain[context].Resize();
}
if (this.FEnabled[0])
{
context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0));
}
if (this.FIn.IsConnected && this.spreadMax > 0 && this.FEnabled[0])
{
int id = this.FIndex[0];
if (this.FIn[id].Contains(context) && this.FIn[id][context] != null)
{
context.RenderTargetStack.Push(this.swapchain[context]);
var rs = new DX11RenderState();
if (FAlpha[0])
{
rs.Blend = DX11BlendStates.Instance.GetState("Blend");
context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color);
}
context.RenderStateStack.Push(rs);
context.CleanShaderStages();
context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV);
EffectSamplerVariable samplervariable = context.Primitives.FullTriVS.GetVariableByName("linSamp").AsSampler();
SamplerState state = null;
if (this.FInSamplerState.IsConnected)
{
state = SamplerState.FromDescription(context.Device, this.FInSamplerState[0]);
samplervariable.SetSamplerState(0, state);
}
else
{
samplervariable.UndoSetSamplerState(0);
}
context.Primitives.FullScreenTriangle.Bind(null);
context.Primitives.ApplyFullTri();
context.Primitives.FullScreenTriangle.Draw();
context.RenderStateStack.Pop();
context.RenderTargetStack.Pop();
context.CleanUpPS();
samplervariable.UndoSetSamplerState(0); //undo as can be used in other places
if (state != null)
{
state.Dispose();
}
}
}
}
示例2: Render
public void Render(DX11RenderContext context)
{
if (this.lasthandle != this.Handle)
{
if (this.swapchain != null)
{
if (this.swapchain.Contains(context)) { this.swapchain.Dispose(context); }
}
this.lasthandle = this.Handle;
}
if (!this.swapchain.Contains(context))
{
this.swapchain[context] = new DX11SwapChain(context, this.Handle, SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0));
}
if (this.resized)
{
this.swapchain[context].Resize();
}
if (this.FEnabled[0])
{
context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0));
}
if (this.FIn.PluginIO.IsConnected && this.FEnabled[0])
{
int id = this.FIndex[0];
if (this.FIn[id].Contains(context))
{
context.RenderTargetStack.Push(this.swapchain[context]);
var rs = new DX11RenderState();
if (FAlpha[0])
{
rs.Blend = DX11BlendStates.Instance.GetState("Blend");
context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV, FInBgColor[0].Color);
}
context.RenderStateStack.Push(rs);
context.CleanShaderStages();
context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV);
context.Primitives.FullScreenTriangle.Bind(null);
context.Primitives.ApplyFullTri();
context.Primitives.FullScreenTriangle.Draw();
context.RenderStateStack.Pop();
context.RenderTargetStack.Pop();
context.CleanUpPS();
}
}
}
示例3: Render
public void Render(DX11RenderContext context)
{
if (!this.swapchain.Contains(context))
{
this.swapchain[context] = new DX11SwapChain(context, this.Handle, SlimDX.DXGI.Format.R8G8B8A8_UNorm, new SampleDescription(1, 0));
}
if (this.resized)
{
this.swapchain[context].Resize();
}
if (this.FEnabled[0])
{
context.CurrentDeviceContext.ClearRenderTargetView(this.swapchain[context].RTV,new SlimDX.Color4(0,0,0,0));
}
if (this.FIn.PluginIO.IsConnected && this.FEnabled[0])
{
int id = this.FIndex[0];
if (this.FIn[id].Contains(context))
{
context.RenderTargetStack.Push(this.swapchain[context]);
context.RenderStateStack.Push(new DX11RenderState());
context.Primitives.FullTriVS.GetVariableBySemantic("TEXTURE").AsResource().SetResource(this.FIn[id][context].SRV);
context.Primitives.FullScreenTriangle.Bind(null);
context.Primitives.ApplyFullTri();
context.Primitives.FullScreenTriangle.Draw();
context.RenderStateStack.Pop();
context.RenderTargetStack.Pop();
context.CleanUpPS();
}
}
}