本文整理汇总了C#中System.Windows.Interop.D3DImage.IsFrontBufferAvailable属性的典型用法代码示例。如果您正苦于以下问题:C# D3DImage.IsFrontBufferAvailable属性的具体用法?C# D3DImage.IsFrontBufferAvailable怎么用?C# D3DImage.IsFrontBufferAvailable使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了D3DImage.IsFrontBufferAvailable属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompositionTarget_Rendering
void CompositionTarget_Rendering(object sender, EventArgs e)
{
RenderingEventArgs args = (RenderingEventArgs)e;
// It's possible for Rendering to call back twice in the same frame
// so only render when we haven't already rendered in this frame.
if (d3dimg.IsFrontBufferAvailable && _lastRender != args.RenderingTime)
{
IntPtr pSurface = IntPtr.Zero;
HRESULT.Check(GetBackBufferNoRef(out pSurface));
if (pSurface != IntPtr.Zero)
{
d3dimg.Lock();
// Repeatedly calling SetBackBuffer with the same IntPtr is
// a no-op. There is no performance penalty.
d3dimg.SetBackBuffer(D3DResourceType.IDirect3DSurface9, pSurface);
HRESULT.Check(Render());
d3dimg.AddDirtyRect(new Int32Rect(0, 0, d3dimg.PixelWidth, d3dimg.PixelHeight));
d3dimg.Unlock();
_lastRender = args.RenderingTime;
}
}
}