Add DebugProc to ES11
authorFraser Waters <frassle@gmail.com>
Tue, 26 Dec 2017 21:19:36 +0000 (21:19 +0000)
committerFraser Waters <frassle@gmail.com>
Tue, 26 Dec 2017 21:19:36 +0000 (21:19 +0000)
src/OpenTK/Graphics/ES11/Helper.cs

index 748d4d5..a1ed83d 100644 (file)
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.InteropServices;
 
 namespace OpenTK.Graphics.ES11
 {
@@ -38,4 +39,38 @@ namespace OpenTK.Graphics.ES11
         }
 
     }
+
+    /// <summary>
+    /// Defines the signature of a debug callback for
+    /// <see cref="GL.DebugMessageCallback"/>.
+    /// </summary>
+    /// <param name="source">The <see cref="DebugSource"/> for this debug message.</param>
+    /// <param name="type">The <see cref="DebugType"/> for this debug message.</param>
+    /// <param name="id">The id of this debug message.</param>
+    /// <param name="severity">The <see cref="DebugSeverity"/> for this debug message.</param>
+    /// <param name="length">The length of this debug message.</param>
+    /// <param name="message">A pointer to a null-terminated ASCII C string, representing the content of this debug message.</param>
+    /// <param name="userParam">A pointer to a user-specified parameter.</param>
+    [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+    public delegate void DebugProc(
+        DebugSource source, DebugType type, int id,
+        DebugSeverity severity, int length, IntPtr message,
+        IntPtr userParam);
+
+    /// <summary>
+    /// Defines the signature of a debug callback for
+    /// <see cref="GL.Khr.DebugMessageCallback"/>.
+    /// </summary>
+    /// <param name="source">The <see cref="DebugSource"/> for this debug message.</param>
+    /// <param name="type">The <see cref="DebugType"/> for this debug message.</param>
+    /// <param name="id">The id of this debug message.</param>
+    /// <param name="severity">The <see cref="DebugSeverity"/> for this debug message.</param>
+    /// <param name="length">The length of this debug message.</param>
+    /// <param name="message">A pointer to a null-terminated ASCII C string, representing the content of this debug message.</param>
+    /// <param name="userParam">A pointer to a user-specified parameter.</param>
+    [UnmanagedFunctionPointer(CallingConvention.Winapi)]
+    public delegate void DebugProcKhr(
+        DebugSource source, DebugType type, int id,
+        DebugSeverity severity, int length, IntPtr message,
+        IntPtr userParam);
 }