次の方法で共有


Device.Clear(ClearFlags,Int32,Single,Int32,Rectangle)

Clear メソッド

使用例

  • バック バッファのクリア

ビューポートまたはビューポート内の矩形セットを指定した RGBA 色にクリアし、深度バッファをクリアし、ステンシル バッファを削除する。

定義

Visual Basic Public Sub Clear( _
    ByVal flags As ClearFlags, _
    ByVal color As Integer, _
    ByVal zdepth As Single, _
    ByVal stencil As Integer, _
    ByVal regions() As Rectangle _
)
C# public void Clear(
    ClearFlags flags,
    int color,
    float zdepth,
    int stencil,
    Rectangle[] regions
);
Managed C++ public: void Clear(
    ClearFlags flags,
    int color,
    float zdepth,
    int stencil,
    Rectangle regions __gc[]
);
JScript public function Clear(
    flags : ClearFlags,
    color : int,
    zdepth : float,
    stencil : int,
    regions : Rectangle[]
) : void;

パラメータ

flags Microsoft.DirectX.Direct3D.ClearFlags.
color System.Int32.
zdepth System.Single.
stencil System.Int32.
regions System.Drawing.Rectangle[].

使用例

バック バッファのクリア

この例では、バック バッファを青の単色でクリアする方法を示す。

ClearFlags 列挙の Target 定数は、Clear(ClearFlags,Int32,Single,Int32) メソッドの第 1 引数として使う。この場合、z バッファの深度は 1.0 に設定され、各ステンシル バッファ エントリに 0 が格納される。

using Microsoft.DirectX.Direct3D;

Device device = null;  // Create rendering device

// Clear the back buffer to a blue color
device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0f, 0); 

対象

Device

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