PresentParameters.EnableAutoDepthStencil
EnableAutoDepthStencil プロパティ
使用例
- 深度ステンシルのオン
デバイスによる深度ステンシル バッファの作成を可能にする値を取得または設定する。true の場合は、Direct3D がアプリケーションのために深度バッファを管理する。
定義
Visual Basic | Public Property EnableAutoDepthStencil As Boolean |
C# | public bool EnableAutoDepthStencil { get; set; } |
Managed C++ | public: __property bool get_EnableAutoDepthStencil(); public: __property void set_EnableAutoDepthStencil(bool); |
JScript | public function get EnableAutoDepthStencil() : boolean public function set EnableAutoDepthStencil(boolean); |
プロパティ値
System.Boolean.
これは読み取り/書き込み可能プロパティである。
注意
深度ステンシル バッファは、デバイスのレンダリング ターゲットとして自動的に設定される。デバイスがリセットされると、深度ステンシル バッファは自動的に破棄され、新しいサイズで再作成される。
true の場合、AutoDepthStencilFormat は有効な深度ステンシル フォーマットでなければならない。
使用例
深度ステンシルのオン
この例では、深度ステンシル サーフェイスをオンにして、ステンシル フォーマットを設定する方法を示す。
- Microsoft® Direct3D® オブジェクトの PresentParameters.EnableAutoDepthStencil プロパティが TRUE の場合、Direct3D がアプリケーションの深度バッファを管理する。
- PresentParameters.AutoDepthStencilFormat ステンシル フォーマットは、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;
}
}
対象
© 2002 Microsoft Corporation. All rights reserved. Terms of use.