| 1 | <?xml version="1.0" encoding="UTF-8"?>\r |
| 2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"\r |
| 3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">\r |
| 4 | <refentry id="glDebugMessageCallback">\r |
| 5 | <refmeta>\r |
| 6 | <refmetainfo>\r |
| 7 | <copyright>\r |
| 8 | <year>2012</year>\r |
| 9 | <holder>Khronos Group</holder>\r |
| 10 | </copyright>\r |
| 11 | </refmetainfo>\r |
| 12 | <refentrytitle>glDebugMessageCallback</refentrytitle>\r |
| 13 | <manvolnum>3G</manvolnum>\r |
| 14 | </refmeta>\r |
| 15 | <refnamediv>\r |
| 16 | <refname>glDebugMessageCallback</refname>\r |
| 17 | <refpurpose>specify a callback to receive debugging messages from the GL</refpurpose>\r |
| 18 | </refnamediv>\r |
| 19 | <refsynopsisdiv><title>C Specification</title>\r |
| 20 | <funcsynopsis>\r |
| 21 | <funcprototype>\r |
| 22 | <funcdef>void <function>glDebugMessageCallback</function></funcdef>\r |
| 23 | <paramdef>DEBUGPROC <parameter>callback</parameter></paramdef>\r |
| 24 | <paramdef>void * <parameter>userParam</parameter></paramdef>\r |
| 25 | </funcprototype>\r |
| 26 | </funcsynopsis>\r |
| 27 | </refsynopsisdiv>\r |
| 28 | <refsect1 id="parameters"><title>Parameters</title>\r |
| 29 | <variablelist>\r |
| 30 | <varlistentry>\r |
| 31 | <term><parameter>callback</parameter></term>\r |
| 32 | <listitem>\r |
| 33 | <para>\r |
| 34 | The address of a callback function that will be called when a debug message is generated.\r |
| 35 | </para>\r |
| 36 | </listitem>\r |
| 37 | </varlistentry>\r |
| 38 | <varlistentry>\r |
| 39 | <term><parameter>userParam</parameter></term>\r |
| 40 | <listitem>\r |
| 41 | <para>\r |
| 42 | A user supplied pointer that will be passed on each invocation of <parameter>callback</parameter>.\r |
| 43 | </para>\r |
| 44 | </listitem>\r |
| 45 | </varlistentry>\r |
| 46 | </variablelist>\r |
| 47 | </refsect1>\r |
| 48 | <refsect1 id="description"><title>Description</title>\r |
| 49 | <para>\r |
| 50 | <function>glDebugMessageInsert</function> sets the current debug output callback function to\r |
| 51 | the function whose address is given in <parameter>callback</parameter>. The callback function\r |
| 52 | should have the following prototype (in C), or be otherwise compatible with such a prototype:\r |
| 53 | </para>\r |
| 54 | <programlisting><![CDATA[ typedef void (APIENTRY *DEBUGPROC)(GLenum source,\r |
| 55 | GLenum type,\r |
| 56 | GLuint id,\r |
| 57 | GLenum severity,\r |
| 58 | GLsizei length,\r |
| 59 | const GLchar* message,\r |
| 60 | void* userParam);]]></programlisting>\r |
| 61 | <para>\r |
| 62 | This function is defined to have the same calling convention as the GL API functions. In\r |
| 63 | most cases this is defined as <code>APIENTRY</code>, although it will vary depending\r |
| 64 | on platform, language and compiler.\r |
| 65 | </para>\r |
| 66 | <para>\r |
| 67 | Each time a debug message is generated the debug callback function will be invoked\r |
| 68 | with <parameter>source</parameter>, <parameter>type</parameter>, <parameter>id</parameter>, and\r |
| 69 | <parameter>severity</parameter> associated with the message, and <parameter>length</parameter> set to\r |
| 70 | the length of debug message whose character string is in the array pointed to by <parameter>message</parameter>\r |
| 71 | <parameter>userParam</parameter> will be set to the value passed in the\r |
| 72 | <parameter>userParam</parameter> parameter to the most recent call to <function>glDebugMessageInsert</function>.\r |
| 73 | </para>\r |
| 74 | </refsect1>\r |
| 75 | <refsect1 id="notes"><title>Notes</title>\r |
| 76 | <para>\r |
| 77 | When the GL is in use remotely, the server may not be able to call functions in the client's address space.\r |
| 78 | In such cases, the callback function may not be invoked and the user should retrieve debug messages from\r |
| 79 | the context's debug message log by calling <citerefentry><refentrytitle>glGetDebugMessageLog</refentrytitle></citerefentry>.\r |
| 80 | </para>\r |
| 81 | </refsect1>\r |
| 82 | <refsect1 id="seealso"><title>See Also</title>\r |
| 83 | <para>\r |
| 84 | <citerefentry><refentrytitle>glDebugMessageControl</refentrytitle></citerefentry>,\r |
| 85 | <citerefentry><refentrytitle>glDebugMessageInsert</refentrytitle></citerefentry>,\r |
| 86 | <citerefentry><refentrytitle>glGetDebugMessageLog</refentrytitle></citerefentry>.\r |
| 87 | </para>\r |
| 88 | </refsect1>\r |
| 89 | <refsect1 id="Copyright"><title>Copyright</title>\r |
| 90 | <para>\r |
| 91 | Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. \r |
| 92 | This material may be distributed subject to the terms and conditions set forth in \r |
| 93 | the Open Publication License, v 1.0, 8 June 1999.\r |
| 94 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r |
| 95 | </para>\r |
| 96 | </refsect1>\r |
| 97 | </refentry>\r |