次の方法で共有


PresentParameters.AutoDepthStencilFormat

AutoDepthStencilFormat プロパティ

使用例

  • 深度ステンシルのオン

デバイスが作成する自動深度ステンシル サーフェイスのフォーマットを取得または設定する。EnableAutoDepthStenciltrue 以外の場合は無視される。

定義

Visual Basic Public Property AutoDepthStencilFormat As DepthFormat
C# public DepthFormat AutoDepthStencilFormat { get; set; }
Managed C++ public: __property DepthFormat get_AutoDepthStencilFormat();
public: __property void set_AutoDepthStencilFormat(DepthFormat);
JScript public function get AutoDepthStencilFormat() : DepthFormat
public function set AutoDepthStencilFormat(DepthFormat);

プロパティ値

Microsoft.DirectX.Direct3D.DepthFormat.

これは読み取り/書き込み可能プロパティである。 

使用例

深度ステンシルのオン

この例では、深度ステンシル サーフェイスをオンにして、ステンシル フォーマットを設定する方法を示す。

  1. Microsoft® Direct3D® オブジェクトの PresentParameters.EnableAutoDepthStencil プロパティが TRUE の場合、Direct3D がアプリケーションの深度バッファを管理する。
  2. PresentParametersPresentParameters. ステンシル フォーマットは、Format 列挙型の D16 定数を受け取ることで、16 ビットの z バッファ ビット深度に設定される。
using Microsoft.DirectX.Direct3D;

public class Lights : Form
{
    // Global variables for this project
    Device device = null; // Rendering device
    PresentParameters presentParams = new PresentParameters();
    .
    .
    .
    public bool InitializeGraphics()
    {
        // 1. Turn on a depth stencil
        presentParams.EnableAutoDepthStencil = true;
        
        // 2. And the stencil format
        presentParams.AutoDepthStencilFormat = Format.D16;
    }
}

対象

PresentParameters

© 2002 Microsoft Corporation. All rights reserved. Terms of use.