Skip to content

Instantly share code, notes, and snippets.

@pbatard
Created August 17, 2014 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbatard/5cb2f4c0ec5f9983fd32 to your computer and use it in GitHub Desktop.
Save pbatard/5cb2f4c0ec5f9983fd32 to your computer and use it in GitHub Desktop.
From 4fe257a4aeae6a30563c4b904c29a31ec8452152 Mon Sep 17 00:00:00 2001
From: Pete Batard <pete@akeo.ie>
Date: Sun, 17 Aug 2014 19:00:35 +0100
Subject: [PATCH] Fix the use of DirectInput with (broken) Unity
---
Source/SharpDX/Utilities.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Source/SharpDX/Utilities.cs b/Source/SharpDX/Utilities.cs
index 0126c86..edadcbf 100644
--- a/Source/SharpDX/Utilities.cs
+++ b/Source/SharpDX/Utilities.cs
@@ -163,7 +163,7 @@ namespace SharpDX
/// <returns>Size of this struct.</returns>
public static int SizeOf<T>() where T : struct
{
- return Interop.SizeOf<T>();
+ return Marshal.SizeOf(typeof(T));
}
/// <summary>
@@ -174,7 +174,7 @@ namespace SharpDX
/// <returns>Size in bytes of this array of struct.</returns>
public static int SizeOf<T>(T[] array) where T : struct
{
- return array == null ? 0 : array.Length * Interop.SizeOf<T>();
+ return array == null ? 0 : array.Length * Marshal.SizeOf(typeof(T));
}
/// <summary>
--
1.8.5.2.msysgit.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment