From 63dd4597c7a14b87278a78be663fa35055a1d7f6 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Thu, 6 Feb 2014 15:01:05 +0100 Subject: [PATCH] [GL][ES] Mark DebugProc* delegates as unmanaged function pointers Calling convention is platform-dependent: stdcall on Windows, cdecl elsewhere. This maps to CallingConvention.Winapi in .Net parlance. --- Source/OpenTK/Graphics/ES20/Helper.cs | 3 +++ Source/OpenTK/Graphics/ES30/Helper.cs | 3 +++ Source/OpenTK/Graphics/OpenGL/GLHelper.cs | 4 ++++ Source/OpenTK/Graphics/OpenGL4/Helper.cs | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/Source/OpenTK/Graphics/ES20/Helper.cs b/Source/OpenTK/Graphics/ES20/Helper.cs index 99076893..267a3334 100644 --- a/Source/OpenTK/Graphics/ES20/Helper.cs +++ b/Source/OpenTK/Graphics/ES20/Helper.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; #if !MINIMAL using System.Drawing; #endif +using System.Runtime.InteropServices; using System.Text; namespace OpenTK.Graphics.ES20 @@ -455,11 +456,13 @@ namespace OpenTK.Graphics.ES20 #endregion } + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, diff --git a/Source/OpenTK/Graphics/ES30/Helper.cs b/Source/OpenTK/Graphics/ES30/Helper.cs index 2d2e977f..5c2cf853 100644 --- a/Source/OpenTK/Graphics/ES30/Helper.cs +++ b/Source/OpenTK/Graphics/ES30/Helper.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; #if !MINIMAL using System.Drawing; #endif +using System.Runtime.InteropServices; using System.Text; namespace OpenTK.Graphics.ES30 @@ -446,11 +447,13 @@ namespace OpenTK.Graphics.ES30 #endregion } + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, diff --git a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs index e188f40b..0cc1ac60 100644 --- a/Source/OpenTK/Graphics/OpenGL/GLHelper.cs +++ b/Source/OpenTK/Graphics/OpenGL/GLHelper.cs @@ -1267,20 +1267,24 @@ namespace OpenTK.Graphics.OpenGL #endregion } + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcAmd(int id, AmdDebugOutput category, AmdDebugOutput severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcArb( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, diff --git a/Source/OpenTK/Graphics/OpenGL4/Helper.cs b/Source/OpenTK/Graphics/OpenGL4/Helper.cs index e4a7ee5c..fd2c64cc 100644 --- a/Source/OpenTK/Graphics/OpenGL4/Helper.cs +++ b/Source/OpenTK/Graphics/OpenGL4/Helper.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; #if !MINIMAL using System.Drawing; #endif +using System.Runtime.InteropServices; using System.Text; namespace OpenTK.Graphics.OpenGL4 @@ -455,16 +456,19 @@ namespace OpenTK.Graphics.OpenGL4 #endregion } + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProc( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcArb( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message, IntPtr userParam); + [UnmanagedFunctionPointer(CallingConvention.Winapi)] public delegate void DebugProcKhr( DebugSource source, DebugType type, int id, DebugSeverity severity, int length, IntPtr message,