| 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="glQueryCounter"> |
| 5 | <refmeta> |
| 6 | <refmetainfo> |
| 7 | <copyright> |
| 8 | <year>2010</year> |
| 9 | <holder>Khronos Group</holder> |
| 10 | </copyright> |
| 11 | </refmetainfo> |
| 12 | <refentrytitle>glQueryCounter</refentrytitle> |
| 13 | <manvolnum>3G</manvolnum> |
| 14 | </refmeta> |
| 15 | <refnamediv> |
| 16 | <refname>glQueryCounter</refname> |
| 17 | <refpurpose>record the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed.</refpurpose> |
| 18 | </refnamediv> |
| 19 | <refsynopsisdiv><title>C Specification</title> |
| 20 | <funcsynopsis> |
| 21 | <funcprototype> |
| 22 | <funcdef>void <function>glQueryCounter</function></funcdef> |
| 23 | <paramdef>GLuint <parameter>id</parameter></paramdef> |
| 24 | <paramdef>GLenum <parameter>target</parameter></paramdef> |
| 25 | </funcprototype> |
| 26 | </funcsynopsis> |
| 27 | </refsynopsisdiv> |
| 28 | <refsect1 id="parameters"><title>Parameters</title> |
| 29 | <variablelist> |
| 30 | <varlistentry> |
| 31 | <term><parameter>id</parameter></term> |
| 32 | <listitem> |
| 33 | <para> |
| 34 | Specify the name of a query object into which to record the GL time. |
| 35 | </para> |
| 36 | </listitem> |
| 37 | </varlistentry> |
| 38 | <varlistentry> |
| 39 | <term><parameter>target</parameter></term> |
| 40 | <listitem> |
| 41 | <para> |
| 42 | Specify the counter to query. <parameter>target</parameter> must be <constant>GL_TIMESTAMP</constant>. |
| 43 | </para> |
| 44 | </listitem> |
| 45 | </varlistentry> |
| 46 | </variablelist> |
| 47 | </refsect1> |
| 48 | <refsect1 id="description"><title>Description</title> |
| 49 | <para> |
| 50 | <function>glQueryCounter</function> causes the GL to record the current time into the query object named <parameter>id</parameter>. |
| 51 | <parameter>target</parameter> must be <constant>GL_TIMESTAMP</constant>. The time is recorded after all previous commands on the |
| 52 | GL client and server state and the framebuffer have been fully realized. When the time is recorded, the query result for that object |
| 53 | is marked available. <function>glQueryCounter</function> timer queries can be used within a <citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry> / |
| 54 | <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> block where the target is <constant>GL_TIME_ELAPSED</constant> and it does |
| 55 | not affect the result of that query object. |
| 56 | </para> |
| 57 | </refsect1> |
| 58 | <refsect1 id="notes"><title>Notes</title> |
| 59 | <para> |
| 60 | <function>glQueryCounter</function> is available only if the GL version is 3.3 or higher. |
| 61 | </para> |
| 62 | </refsect1> |
| 63 | <refsect1 id="errors"><title>Errors</title> |
| 64 | <para> |
| 65 | <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name |
| 66 | of a query object that is already in use within a <citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry> / |
| 67 | <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> block. |
| 68 | </para> |
| 69 | <para> |
| 70 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>id</parameter> is not the name of a query object returned |
| 71 | from a previous call to <citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>. |
| 72 | </para> |
| 73 | <para> |
| 74 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TIMESTAMP</constant>. |
| 75 | </para> |
| 76 | </refsect1> |
| 77 | <refsect1 id="seealso"><title>See Also</title> |
| 78 | <para> |
| 79 | <citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>, |
| 80 | <citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry>, |
| 81 | <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>, |
| 82 | <citerefentry><refentrytitle>glDeleteQueries</refentrytitle></citerefentry>, |
| 83 | <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry>, |
| 84 | <citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry>, |
| 85 | <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> |
| 86 | </para> |
| 87 | </refsect1> |
| 88 | <refsect1 id="Copyright"><title>Copyright</title> |
| 89 | <para> |
| 90 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. |
| 91 | This material may be distributed subject to the terms and conditions set forth in |
| 92 | the Open Publication License, v 1.0, 8 June 1999. |
| 93 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. |
| 94 | </para> |
| 95 | </refsect1> |
| 96 | </refentry> |