/// <summary>
        ///     レンダーターゲットをリセットします.
        /// </summary>
        private void ResetTargets()
        {
            // ターゲットを破棄
            if (RenderTargetView != null && !RenderTargetView.Disposed)
            {
                RenderTargetView.Dispose();
            }
            if (RenderTarget != null && !RenderTarget.Disposed)
            {
                RenderTarget.Dispose();
            }
            if (DepthTargetView != null && !DepthTargetView.Disposed)
            {
                DepthTargetView.Dispose();
            }
            if (DepthTarget != null && !DepthTarget.Disposed)
            {
                DepthTarget.Dispose();
            }

            Device device = Context.DeviceManager.Device;

            //深度ステンシルバッファの初期化
            //レンダーターゲットの初期化
            renderTarget     = new Texture2D(device, getRenderTargetTexture2DDescription());
            renderTargetView = new RenderTargetView(device, RenderTarget);
            //深度ステンシルバッファの初期化
            depthTarget     = new Texture2D(device, getDepthBufferTexture2DDescription());
            depthTargetView = new DepthStencilView(device, DepthTarget);

            SetViewport();
        }
Beispiel #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
             DepthTarget.Dispose();
             foreach (var ct in ColorTargets)
             {
                 ct.Dispose();
             }
             RenderTarget.Dispose();
         }
         disposed = true;
     }
 }