Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glBeginQuery"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2005</year> | |
9 | <holder>Sams Publishing</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glBeginQuery</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glBeginQuery</refname> | |
17 | <refpurpose>delimit the boundaries of a query object</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glBeginQuery</function></funcdef> | |
23 | <paramdef>GLenum <parameter>target</parameter></paramdef> | |
24 | <paramdef>GLuint <parameter>id</parameter></paramdef> | |
25 | </funcprototype> | |
26 | </funcsynopsis> | |
27 | </refsynopsisdiv> | |
28 | <!-- eqn: ignoring delim $$ --> | |
29 | <refsect1 id="parameters"><title>Parameters</title> | |
30 | <variablelist> | |
31 | <varlistentry> | |
32 | <term><parameter>target</parameter></term> | |
33 | <listitem> | |
34 | <para> | |
35 | Specifies the target type of query object established between | |
36 | <function>glBeginQuery</function> and the subsequent <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>. | |
37 | The symbolic constant must be <constant>GL_SAMPLES_PASSED</constant>. | |
38 | </para> | |
39 | </listitem> | |
40 | </varlistentry> | |
41 | <varlistentry> | |
42 | <term><parameter>id</parameter></term> | |
43 | <listitem> | |
44 | <para> | |
45 | Specifies the name of a query object. | |
46 | </para> | |
47 | </listitem> | |
48 | </varlistentry> | |
49 | </variablelist> | |
50 | </refsect1> | |
51 | <refsynopsisdiv><title>C Specification</title> | |
52 | <funcsynopsis> | |
53 | <funcprototype> | |
54 | <funcdef>void <function>glEndQuery</function></funcdef> | |
55 | <paramdef>GLenum <parameter>target</parameter></paramdef> | |
56 | </funcprototype> | |
57 | </funcsynopsis> | |
58 | </refsynopsisdiv> | |
59 | <!-- eqn: ignoring delim $$ --> | |
60 | <refsect1 id="parameters2"><title>Parameters</title> | |
61 | <variablelist> | |
62 | <varlistentry> | |
63 | <term><parameter>target</parameter></term> | |
64 | <listitem> | |
65 | <para> | |
66 | Specifies the target type of query object to be concluded. | |
67 | The symbolic constant must be <constant>GL_SAMPLES_PASSED</constant>. | |
68 | </para> | |
69 | </listitem> | |
70 | </varlistentry> | |
71 | </variablelist> | |
72 | </refsect1> | |
73 | <refsect1 id="description"><title>Description</title> | |
74 | <para> | |
75 | <function>glBeginQuery</function> and <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> delimit the | |
76 | boundaries of a query object. If a query object with name <parameter>id</parameter> does not yet exist it is created. | |
77 | </para> | |
78 | <para> | |
79 | When <function>glBeginQuery</function> is executed, the query object's samples-passed counter is reset to 0. Subsequent | |
80 | rendering will increment the counter once for every sample that passes the depth test. When <function>glEndQuery</function> | |
81 | is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by | |
82 | calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter> | |
83 | <constant>GL_QUERY_RESULT</constant>. | |
84 | </para> | |
85 | <para> | |
86 | Querying the <constant>GL_QUERY_RESULT</constant> implicitly flushes the GL pipeline until the rendering delimited by the | |
87 | query object has completed and the result is available. <constant>GL_QUERY_RESULT_AVAILABLE</constant> can be queried to | |
88 | determine if the result is immediately available or if the rendering is not yet complete. | |
89 | </para> | |
90 | </refsect1> | |
91 | <refsect1 id="notes"><title>Notes</title> | |
92 | <para> | |
93 | If the samples-passed count exceeds the maximum value representable in the number of available bits, as reported by | |
94 | <citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry> with <parameter>pname</parameter> | |
95 | <constant>GL_QUERY_COUNTER_BITS</constant>, the count becomes undefined. | |
96 | </para> | |
97 | <para> | |
98 | An implementation may support 0 bits in its samples-passed counter, in which case query results are always undefined | |
99 | and essentially useless. | |
100 | </para> | |
101 | <para> | |
102 | When <constant>GL_SAMPLE_BUFFERS</constant> is 0, the samples-passed counter will increment once for each fragment that passes | |
103 | the depth test. When <constant>GL_SAMPLE_BUFFERS</constant> is 1, an implementation may either increment the samples-passed | |
104 | counter individually for each sample of a fragment that passes the depth test, or it may choose to increment the counter for | |
105 | all samples of a fragment if any one of them passes the depth test. | |
106 | </para> | |
107 | <para> | |
108 | <function>glBeginQuery</function> and <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> | |
109 | are available only if the GL version is 1.5 or greater. | |
110 | </para> | |
111 | </refsect1> | |
112 | <refsect1 id="errors"><title>Errors</title> | |
113 | <para> | |
114 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_SAMPLES_PASSED</constant>. | |
115 | </para> | |
116 | <para> | |
117 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginQuery</function> is executed while | |
118 | a query object of the same <parameter>target</parameter> is already active. | |
119 | </para> | |
120 | <para> | |
121 | <constant>GL_INVALID_OPERATION</constant> is generated if <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> | |
122 | is executed when a query object of the same <parameter>target</parameter> is not active. | |
123 | </para> | |
124 | <para> | |
125 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is 0. | |
126 | </para> | |
127 | <para> | |
128 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name of an already active query object. | |
129 | </para> | |
130 | <para> | |
131 | <constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginQuery</function> or | |
132 | <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> is executed between the execution of | |
133 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of | |
134 | <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>. | |
135 | </para> | |
136 | </refsect1> | |
137 | <refsect1 id="seealso"><title>See Also</title> | |
138 | <para> | |
139 | <citerefentry><refentrytitle>glDeleteQueries</refentrytitle></citerefentry>, | |
140 | <citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>, | |
141 | <citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry>, | |
142 | <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry>, | |
143 | <citerefentry><refentrytitle>glIsQuery</refentrytitle></citerefentry> | |
144 | </para> | |
145 | </refsect1> | |
146 | <refsect1 id="Copyright"><title>Copyright</title> | |
147 | <para> | |
148 | Copyright <trademark class="copyright"></trademark> 2005 Addison-Wesley. | |
149 | This material may be distributed subject to the terms and conditions set forth in | |
150 | the Open Publication License, v 1.0, 8 June 1999. | |
151 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
152 | </para> | |
153 | </refsect1> | |
154 | </refentry> |