From a62e0fb6a62293df10b16da5434bd5974f9e881c Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 25 Jan 2008 13:38:39 +0000 Subject: [PATCH] Can't use Marshal.PtrToStructure(IntPtr, object) with boxed value types. Reverting to object Marshal.PtrToStructure(IntPtr, Type). --- Source/OpenTK/Platform/X11/API.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/X11/API.cs b/Source/OpenTK/Platform/X11/API.cs index eab07de4..40030c64 100644 --- a/Source/OpenTK/Platform/X11/API.cs +++ b/Source/OpenTK/Platform/X11/API.cs @@ -1349,7 +1349,7 @@ XF86VidModeGetGammaRampSize( for (int i = 0; i < nsizes; i++) { array[i] = new XRRScreenSize(); - Marshal.PtrToStructure((IntPtr)data, array[i]); + array[i] = (XRRScreenSize)Marshal.PtrToStructure((IntPtr)data, typeof(XRRScreenSize)); data += Marshal.SizeOf(typeof(XRRScreenSize)); } XFree(ptr);