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