aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/webglrenderingcontext/clearstencil/index.html
blob: 3e08e2256eddcea33b60716d80dad01a69989e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: WebGLRenderingContext.clearStencil()
slug: Web/API/WebGLRenderingContext/clearStencil
translation_of: Web/API/WebGLRenderingContext/clearStencil
---
<div>{{APIRef("WebGL")}}</div>

<p><a href="/ja/docs/Web/API/WebGL_API">WebGL API</a> の <strong><code>WebGLRenderingContext.clearStencil()</code></strong> メソッドは、ステンシルバッファーを消去する値を指定します。</p>

<p>この指定は、{{domxref("WebGLRenderingContext.clear", "clear()")}} メソッドを呼ぶときに使用されるステンシルの値です。</p>

<h2 id="構文">構文</h2>

<pre class="syntaxbox">void <var>gl</var>.clearStencil(<var>s</var>);
</pre>

<h3 id="引数">引数</h3>

<dl>
 <dt><code>s</code></dt>
 <dd>インデックスを指定する {{domxref("GLint")}} で、ステンシルバッファーの消去に使用される値です。既定値は 0 です。</dd>
</dl>

<h3 id="返り値">返り値</h3>

<p>ありません。</p>

<h2 id="例"></h2>

<pre class="brush: js">gl.clearStencil(1);
</pre>

<p>現在のステンシルを消去する値を取得するには、<code>STENCIL_CLEAR_VALUE</code> 定数で問い合わせます。</p>

<pre class="brush: js">gl.getParameter(gl.STENCIL_CLEAR_VALUE);
// 1</pre>

<h2 id="仕様策定状況">仕様策定状況</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">仕様策定状況</th>
   <th scope="col">策定状況</th>
   <th scope="col">コメント</th>
  </tr>
  <tr>
   <td>{{SpecName('WebGL', "#5.14.3", "clearStencil")}}</td>
   <td>{{Spec2('WebGL')}}</td>
   <td>初回定義。</td>
  </tr>
  <tr>
   <td>{{SpecName('OpenGL ES 2.0', "glClearStencil.xml", "glClearStencil")}}</td>
   <td>{{Spec2('OpenGL ES 2.0')}}</td>
   <td>OpenGL API のマニュアルページ。</td>
  </tr>
 </tbody>
</table>

<h2 id="ブラウザーの対応">ブラウザーの対応</h2>

<p>{{Compat("api.WebGLRenderingContext.clearStencil")}}</p>

<h2 id="関連項目">関連項目</h2>

<ul>
 <li>{{domxref("WebGLRenderingContext.clear()")}}</li>
 <li>{{domxref("WebGLRenderingContext.clearColor()")}}</li>
 <li>{{domxref("WebGLRenderingContext.clearDepth()")}}</li>
</ul>