replaced fully qualified types in XML comments by common type name

--- ExtraLINQ/EnumerableExtensions.cs
+++ ExtraLINQ/EnumerableExtensions.cs
@@ -13,12 +13,12 @@
         /// Determines whether the specified collection contains exactly the specified number of items.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> to count.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> to count.</param>
         /// <param name="expectedItemCount">The number of items the specified collection is expected to contain.</param>
         /// <returns>
         ///   <c>true</c> if <paramref name="source"/> contains exactly <paramref name="expectedItemCount"/> items; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
         public static bool CountsExactly<TSource>(this IEnumerable<TSource> source, int expectedItemCount)
         {
             if (source == null)
@@ -38,7 +38,7 @@
         /// Determines whether the specified collection contains exactly the specified number of items satisfying the specified condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> to count satisfying items.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> to count satisfying items.</param>
         /// <param name="expectedItemCount">The number of satisfying items the specified collection is expected to contain.</param>
         /// <param name="predicate">A function to test each element for a condition.</param>
         /// <returns>
@@ -74,13 +74,13 @@
         /// Determines whether the specified collection's item count is equal to or lower than <paramref name="expectedMaxItemCount"/>.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> whose items to count.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> whose items to count.</param>
         /// <param name="expectedMaxItemCount">The maximum number of items the specified collection is expected to contain.</param>
         /// <returns>
         ///   <c>true</c> if the item count of <paramref name="source"/> is equal to or lower than <paramref name="expectedMaxItemCount"/>; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentException">Thrown when <paramref name="expectedMaxItemCount"/> is negative.</exception>
-        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentException">Thrown when <paramref name="expectedMaxItemCount"/> is negative.</exception>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
         public static bool CountsMax<TSource>(this IEnumerable<TSource> source, int expectedMaxItemCount)
         {
             if (source == null)
@@ -100,13 +100,13 @@
         /// Determines whether the specified collection contains exactly <paramref name="expectedMaxItemCount"/> or less items satisfying a condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> whose items to count.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> whose items to count.</param>
         /// <param name="expectedMaxItemCount">The maximum number of items satisfying the specified condition the specified collection is expected to contain.</param>
         /// <param name="predicate">A function to test each element for a condition.</param>
         /// <returns>
         ///   <c>true</c> if the item count of satisfying items is equal to or less than <paramref name="expectedMaxItemCount"/>; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">
+        /// <exception cref="ArgumentNullException">
         ///   <para><paramref name="source"/> is null.</para>
         ///   <para>- or - </para>
         ///   <para><paramref name="predicate"/> is null.</para>
@@ -130,12 +130,12 @@
         /// Determines whether the specified collection's item count is equal to or greater than <paramref name="expectedMinItemCount"/>.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> whose items to count.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> whose items to count.</param>
         /// <param name="expectedMinItemCount">The minimum number of items the specified collection is expected to contain.</param>
         /// <returns>
         ///   <c>true</c> if the item count of <paramref name="source"/> is equal to or greater than <paramref name="expectedMinItemCount"/>; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
         /// <remarks>
         /// No exception is thrown in case a negative <paramref name="expectedMinItemCount"/> is passed.
         /// </remarks>
@@ -153,13 +153,13 @@
         /// Determines whether the specified collection contains exactly <paramref name="expectedMinItemCount"/> or more items satisfying a condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> whose items to count.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> whose items to count.</param>
         /// <param name="expectedMinItemCount">The minimum number of items satisfying the specified condition the specified collection is expected to contain.</param>
         /// <param name="predicate">A function to test each element for a condition.</param>
         /// <returns>
         ///   <c>true</c> if the item count of satisfying items is equal to or greater than <paramref name="expectedMinItemCount"/>; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">
+        /// <exception cref="ArgumentNullException">
         ///   <para><paramref name="source"/> is null.</para>
         ///   <para>- or - </para>
         ///   <para><paramref name="predicate"/> is null.</para>
@@ -186,12 +186,12 @@
         /// Returns the item at a specified index in a specified collection using a specified indexing strategy.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/>containing the item.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/>containing the item.</param>
         /// <param name="index">The item's index.</param>
         /// <param name="indexingStrategy">The <see cref="IndexingStrategy"/> to use.</param>
         /// <returns>The item at the specified index.</returns>
-        /// <exception cref="System.ArgumentException">Thrown when <paramref name="source"/> is empty.</exception>
-        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentException">Thrown when <paramref name="source"/> is empty.</exception>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
         public static TSource ElementAt<TSource>(this IEnumerable<TSource> source, int index, IndexingStrategy indexingStrategy)
         {
             if (source == null)
@@ -230,11 +230,11 @@
         /// Determines whether the specified collection is empty.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> to check for emptiness.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> to check for emptiness.</param>
         /// <returns>
         ///   <c>true</c> if <paramref name="source"/> is empty; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentNullException">Thrown when <paramref name="source"/> is null.</exception>
         public static bool IsEmpty<TSource>(this IEnumerable<TSource> source)
         {
             if (source == null)
@@ -249,7 +249,7 @@
         /// Determines whether the specified collection is null or empty.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of <paramref name="source"/>.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> to check for null or emptiness.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> to check for null or emptiness.</param>
         /// <returns>
         ///   <c>true</c> if <paramref name="source"/> is null or empty; otherwise, <c>false</c>.
         /// </returns>
@@ -267,12 +267,12 @@
         /// Determines whether none of the elements of a collection satisfy a condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements of source.</typeparam>
-        /// <param name="source">The <see cref="System.Collections.Generic.IEnumerable{TSource}"/> to check for matches.</param>
+        /// <param name="source">The <see cref="IEnumerable{TSource}"/> to check for matches.</param>
         /// <param name="predicate">A function to test each element for a condition.</param>
         /// <returns>
         ///   <c>true</c> if no element satisfies the specified condition; otherwise, <c>false</c>.
         /// </returns>
-        /// <exception cref="System.ArgumentNullException">
+        /// <exception cref="ArgumentNullException">
         ///   <para><paramref name="source"/> is null.</para>
         ///   <para>- or - </para>
         ///   <para><paramref name="predicate"/> is null.</para>


Added IntPtr version of DecompressVoice

Added IntPtr version of DecompressVoice

--- Facepunch.Steamworks/SteamUser.cs
+++ Facepunch.Steamworks/SteamUser.cs
@@ -261,6 +261,9 @@
 			return (int)szWritten;
 		}

+		/// <summary>
+		/// Lazy version
+		/// </summary>
 		public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output )
 		{
 			var to = Helpers.TakeBuffer( 1024 * 64 );
@@ -281,6 +284,22 @@
 			// Copy to output buffer
 			//
 			output.Write( to, 0, (int)szWritten );
+			return (int)szWritten;
+		}
+
+		/// <summary>
+		/// Advanced and potentially fastest version - incase you know what you're doing
+		/// </summary>
+		public static unsafe int DecompressVoice( IntPtr from, int length, IntPtr to, int bufferSize )
+		{
+			if ( length <= 0 ) throw new ArgumentException( $"length should be > 0 " );
+			if ( bufferSize <= 0 ) throw new ArgumentException( $"bufferSize should be > 0 " );
+
+			uint szWritten = 0;
+
+			if ( Internal.DecompressVoice( from, (uint) length, to, (uint)bufferSize, ref szWritten, SampleRate ) != VoiceResult.OK )
+				return 0;
+
 			return (int)szWritten;
 		}


Wrong test commented out Need to figure out how to generate company name and slogan

--- Faker/Faker.Tests/CompanyTests.cs
+++ Faker/Faker.Tests/CompanyTests.cs
@@ -12,17 +12,17 @@
     [TestClass]
     public class CompanyTests
     {
+        //[TestMethod]
+        //public void CompanyName()
+        //{
+        //    //Assert.IsNotNull(Company.Name());
+        //}
+
         [TestMethod]
-        public void CompanyName()
+        public void CompanyIndustry()
         {
-            //Assert.IsNotNull(Company.Name());
+            Assert.IsNotNull(Company.Industry());
         }
-
-        //[TestMethod]
-        //public void CompanyIndustry()
-        //{
-        //    Assert.IsNotNull(Company.Industry());
-        //}

         [TestMethod]
         public void CompanySector()


Overview: Changed board creation and drawing.

--- FlameWars/FlameWars/Core/Board.cs
+++ FlameWars/FlameWars/Core/Board.cs
@@ -51,13 +51,18 @@
 		// ============================================================================

 		// Constructor
-		public Board()
+		public Board(Texture2D image)
 		{
 			track       = new Path[34];
 			tints       = new Color[3];
 			// 200, 200 are just starter values, this must be determined some other time
 			boardPos	= new Rectangle(200, 200, BOARD_WIDTH, BOARD_HEIGHT);
 			rng         = new Random();
+
+			// Load the texture for all path objects
+			this.image = image;
+
+			// Generate the board
 			CreateBoard();
 		}

@@ -70,15 +75,18 @@
 		// This method draws all of the path objects to the screen
 		public void Draw(SpriteBatch spriteBatch)
 		{
-			//spriteBatch.Draw(image);
-
+			// Iterate through all path objects
+			for (int i = 0; i < track.Length; i++)
+			{
+				spriteBatch.Draw(image, track[i].Bounds, track[i].DrawColor);
+			}
 		}

 		// This method generates Path objects to fill the Track Array
 		public void CreateBoard()
 		{
 			// Fill the entire track array
-			for (int i = 1; i <= track.Length; i++)
+			for (int i = 0; i < track.Length; i++)
 			{
 				// Create position
 				// If intervals set to handle each side of board
@@ -93,25 +101,25 @@
 				Vector2 vec = new Vector2();

 				// Bottom of the board
-				if(i > 0 && i <= 12)
+				if(i >= 0 && i < 12)
 				{
 					vec = new Vector2(i * SQUARE_WIDTH,
 									 (BOARD_HEIGHT - (BOARD_HEIGHT / vertLength)));
 				}
 				// Right column of the board
-				if(i > 12 && i <= 17)
+				if(i >= 12 && i < 17)
 				{
 					vec = new Vector2((BOARD_WIDTH - (BOARD_WIDTH / horiLength)),
 									 (BOARD_HEIGHT - (i * SQUARE_HEIGHT) + SQUARE_HEIGHT));
 				}
 				// Top row of the board
-				if(i > 17 && i <= 29)
+				if(i >= 17 && i < 29)
 				{
 					vec = new Vector2(((12 * SQUARE_WIDTH) - (i-17)*SQUARE_WIDTH),
 									 (BOARD_HEIGHT / vertLength));
 				}
 				// Left column of the board
-				if(i > 29 && i <= 34)
+				if(i >= 29 && i < 34)
 				{
 					vec = new Vector2((BOARD_WIDTH / horiLength),
 									   i * SQUARE_HEIGHT + SQUARE_HEIGHT);


Begin major reworking of class. Implemented more bindings.

svn path=/trunk/tao/; revision=33589

--- Framework/Projects/Tao.Sdl/Sdl.cs
+++ Framework/Projects/Tao.Sdl/Sdl.cs
@@ -42,6 +42,20 @@
 	public sealed class Sdl {
 		// --- Fields ---
 		#region Private Constants
+		#region string SDL_NATIVE_LIBRARY
+		///
+		///     Specifies SDL's native library archive.
+		///
+		/// <remarks>
+		///     Specifies SDL.dll for Windows and libSDL.so for Linux.
+		/// </remarks>
+#if WIN32
+        private const string SDL_NATIVE_LIBRARY = "SDL.dll";
+#elif LINUX
+		private const string SDL_NATIVE_LIBRARY = "libSDL.so";
+#endif
+		#endregion string SDL_NATIVE_LIBRARY
+
 		#region CallingConvention CALLING_CONVENTION
 		///
 		///     Specifies the calling convention.
@@ -56,7 +70,7 @@
 		#endregion Private Constants

 		#region Public Constants
-		// SDL
+		#region SDL.h
 		#region SDL_INIT_TIMER
 		///
 		///     The timer subsystem.
@@ -123,18 +137,57 @@
 		// #define SDL_INIT_EVERYTHING 0x0000FFFF
 		public const int SDL_INIT_EVERYTHING = 0x0000FFFF;
 		#endregion SDL_INIT_EVERYTHING
-
-		// SDL_main -- none
-
-		// SDL_types -- none
-
-		// SDL_getenv -- none
-
-		// SDL_error -- none
+		#endregion SDL.h
+
+		#region SDL_active.h
+		///
+		/// The app has mouse coverage
+		///
+		/// <remarks>
+		/// The available application states
+		/// </remarks>
+		public const Byte SDL_APPMOUSEFOCUS = 0x01;
+
+		///
+		/// The app has input focus
+		///
+		/// <remarks>
+		/// The available application states
+		/// </remarks>
+		public const Byte SDL_APPINPUTFOCUS = 0x02;
+
+		///
+		/// The application is active
+		///
+		/// <remarks>
+		/// The available application states
+		/// </remarks>
+		public const Byte SDL_APPACTIVE = 0x04;
+		#endregion SDL_active.h
+
+		#region SDL_byteorder.h
+		///
+		///
+		///
+		public const int SDL_LIL_ENDIAN = 1234;
+
+		///
+		///
+		///
+		public const int SDL_BIG_ENDIAN = 4321;
+		#endregion SDL_byteorder.h
+
+		// SDL_copying.h -- none
+		// SDL_cpuinfo.h -- none
+		// SDL_error.h -- none
+		// SDL_getenv.h -- none
+		// SDL_main.h -- none
+		// SDL_name.h -- none
+		// SDL_quit.h -- none

 		// TODO: SDL_rwops -- skipped for now, might be useful.

-		// SDL_timer
+		#region SDL_timer.h
 		#region SDL_TIMESLICE
 		///
 		///     The OS scheduler timeslice, in milliseconds.
@@ -151,6 +204,11 @@
 		/// </remarks>
 		public const int TIMER_RESOLUTION = 10;
 		#endregion TIMER_RESOLUTION
+		#endregion SDL_timer.h
+
+		// SDL_types -- none
+
+		#region NOT_DONE

 		///
 		/// Surface is in system memory
@@ -197,30 +255,6 @@
 		/// Blit uses source alpha blending
 		///
 		public const int SDL_SRCALPHA = 0x00010000;
-
-		///
-		/// The app has mouse coverage
-		///
-		/// <remarks>
-		/// The available application states
-		/// </remarks>
-		public const Byte SDL_APPMOUSEFOCUS = 0x01;
-
-		///
-		/// The app has input focus
-		///
-		/// <remarks>
-		/// The available application states
-		/// </remarks>
-		public const Byte SDL_APPINPUTFOCUS = 0x02;
-
-		///
-		/// The application is active
-		///
-		/// <remarks>
-		/// The available application states
-		/// </remarks>
-		public const Byte SDL_APPACTIVE = 0x04;

 		///
 		/// Unsigned 8-bit samples
@@ -593,16 +627,6 @@
 		public const int SDL_ENABLE = 1;

 		///
-		///
-		///
-		public const int SDL_LIL_ENDIAN = 1234;
-
-		///
-		///
-		///
-		public const int SDL_BIG_ENDIAN = 4321;
-
-		///
 		/// Full audio volume
 		///
 		public const int SDL_MIX_MAXVOLUME = 128;
@@ -719,14 +743,48 @@
 		/// It is the number of bits in the event mask datatype -- Uint32
 		///
 		public const int SDL_NUMEVENTS = 32;
+		#endregion NOT_DONE

 		#endregion Public Constants

 		#region Public Enums
+		// SDL.h -- none
+		// SDL_active.h -- none
+		// SDL_byteorder.h -- none
+		// SDL_copying.h -- none
+		// SDL_cpuinfo.h -- none
+		// SDL_error.h -- none
+		// SDL_getenv.h -- none
+		// SDL_main.h -- none
+		// SDL_name.h -- none
+		// SDL_quit.h -- none
+		// SDL_timer.h -- none
+
+		#region SDL_types.h
+		#region SDL_bool
+		///
+		///
+		///
+		public enum SDL_bool
+		{
+			///
+			///
+			///
+			SDL_FALSE = 0,
+			///
+			///
+			///
+			SDL_TRUE  = 1
+		}
+		#endregion SDL_bool
+		#endregion SDL_types.h
+
+		#region NOT_DONE
 		///
 		/// The possible states which a CD-ROM drive can be in.
 		///
-		public enum CDStatus {
+		public enum CDStatus
+		{
 			///
 			/// The CD tray is empty.
 			///
@@ -1907,14 +1965,47 @@
 			///
 			SDL_GETEVENT
 		}
-
+		#endregion NOT_DONE
 		#endregion Public Enums

 		#region Public Structs
-		// structs
-		///
-		///
-		///
+		// SDL.h -- none
+		// SDL_active.h -- none
+		// SDL_byteorder.h -- none
+		// SDL_copying.h -- none
+		// SDL_cpuinfo.h -- none
+		// SDL_error.h -- none
+		// SDL_getenv.h -- none
+		// SDL_main.h -- none
+		// SDL_name.h -- none
+		// SDL_quit.h -- none
+
+		#region SDL_timer.h
+		#region SDL_TimerID
+		//typedef struct _SDL_TimerID *SDL_TimerID;
+		//TODO: write test
+		///
+		///
+		///
+		[StructLayout(LayoutKind.Sequential, Pack=4)]
+			public struct SDL_TimerID
+		{
+		}
+		#endregion SDL_TimerID
+		#endregion SDL_timer.h
+
+		#region SDL_video.h
+		///
+		/// Format independent color description
+		///
+		/// <remarks>
+		/// SDL_Color describes a color in a format independent way.
+		/// You can convert a SDL_Color to a pixel value for a certain
+		/// pixel format using <see cref="SDL_MapRGB"/>.
+		/// </remarks>
+		/// <seealso cref="SDL_PixelFormat" />
+		/// <seealso cref="SDL_SetColors" />
+		/// <seealso cref="SDL_Palette" />
 		[StructLayout(LayoutKind.Sequential, Pack=4)]
 			public struct SDL_Color {
 			///
@@ -1970,7 +2061,7 @@
 			///
 			///
 			///
-			public SDL_Color colors;
+			public SDL_Color[] colors;
 		}
 		///
 		///
@@ -2109,6 +2200,9 @@
 			///
 			public int refcount;
 		}
+		#endregion SDL_video.h
+
+		#region NOT_DONE
 		///
 		/// - The scancode is hardware dependent,
 		/// and should not be used by general
@@ -2246,7 +2340,8 @@
 			///
 			public Byte state;
 		}
-
+
+
 		///
 		/// Keyboard event structure
 		///
@@ -2608,6 +2703,8 @@
 			///
 			public IntPtr msg;
 		}
+
+		#region SDL_version.h
 		///
 		/// Structure to hold version number of the SDL library
 		///
@@ -2627,6 +2724,7 @@
 			public Byte patch;

 		}
+		#endregion SDL_version.h

 		///
 		/// Useful for determining the video hardware capabilities
@@ -2832,6 +2930,7 @@
 			///
 			public int filter_index;
 		}
+		#endregion NOT_DONE
 		#endregion Public Structs

 		#region Private Static Fields
@@ -2855,21 +2954,11 @@
 		private Sdl()
 		{
 		}
-
-		///
-		/// Static Sdl constructor. All the functionality of
-		/// the SDL library is available through this class
-		/// and its properties.
-		/// Explicit static constructor tells the C# compiler
-		/// not to mark type as beforefieldinit.
-		///
-		static Sdl()
-		{
-		}
 		#endregion Sdl()

 		// --- Public Delegates ---
-		// SDL_timer
+		#region Public Delegates
+		#region SDL_timer.h
 		#region int SDL_TimerCallback(int interval)
 		///
 		///     Prototype for the timer callback.
@@ -2880,19 +2969,51 @@
 		/// <returns>
 		///     The next timer interval.
 		/// </returns>
+		/// <remarks>
+		///

+		///     Binds to C callback in SDL_timer.h:
+		///     typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval, void *param)
+		///

+		/// </remarks>
 		/// <seealso cref="SDL_SetTimer" />
-		// typedef Uint32 (SDLCALL *SDL_TimerCallback)(Uint32 interval);
 		public delegate int SDL_TimerCallback(int interval);
 		#endregion int SDL_TimerCallback(int interval)

+		#region int SDL_NewTimerCallback(int interval)
 		// TODO: Goddamn void* double whammy since it's a delegate
 		///
-		///
-		///
+		///     Prototype for the new timer callback.
+		///
+		/// <param name="interval">
+		///     The current timer interval.
+		/// </param>
+		/// <returns>
+		///     The next timer interval.
+		/// </returns>
+		/// <remarks>
+		/// <para>
+		/// The callback function is passed the current timer interval
+		/// and returns the next timer interval.  If the returned
+		/// value is the same as the one passed in, the periodic alarm
+		///  continues, otherwise a new alarm is scheduled.
+		///  If the callback returns 0, the periodic alarm is cancelled.
+		/// </para>
+		///

+		///     Binds to C callback in SDL_timer.h:
+		///     typedef Uint32 (SDLCALL *SDL_NewTimerCallback)(Uint32 interval, void *param)
+		///

+		/// </remarks>
+		/// <seealso cref="SDL_AddTimer" />
+		/// <seealso cref="SDL_RemoveTimer" />
 		public delegate int SDL_NewTimerCallback(int interval);
+		#endregion int SDL_NewTimerCallback(int interval)
+		#endregion SDL_timer.h
+		#endregion Public Delegates

 		// --- Public Externs ---
-		// SDL
+		#region Sdl Methods
+
+		#region SDL.h
 		#region int SDL_Init(int flags)
 		///
 		///     Initializes SDL and the specified subsystems.
@@ -2951,11 +3072,14 @@
 		///         cleanup signal handlers for some commonly ignored fatal signals (like
 		///         SIGSEGV).
 		///     </para>
+		///

+		///			Binds to C-function call in SDL.h:
+		///     extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_InitSubSystem" />
 		/// <seealso cref="SDL_Quit" />
-		// extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_Init(int flags);
 		#endregion int SDL_Init(int flags)

@@ -3014,12 +3138,16 @@
 		/// <remarks>
 		///     After SDL has been initialized with <see cref="SDL_Init" /> you may initialize
 		///     any uninitialized subsystems with SDL_InitSubSystem.
+		///

+		///     Binds to C-function call in SDL.h:
+		///     extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_Init" />
 		/// <seealso cref="SDL_Quit" />
 		/// <seealso cref="SDL_QuitSubSystem" />
-		// extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		///
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_InitSubSystem(int flags);
 		#endregion int SDL_InitSubSystem(int flags)

@@ -3076,12 +3204,15 @@
 		///     SDL_QuitSubSystem allows you to shut down a subsystem that has been
 		///     previously initialized by <see cref="SDL_Init" /> or
 		///     <see cref="SDL_InitSubSystem" />.
+		///

+		///     Binds to C-function call in SDL.h:
+		///     extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_Init" />
 		/// <seealso cref="SDL_InitSubSystem" />
 		/// <seealso cref="SDL_Quit" />
-		// extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_QuitSubSystem(int flags);
 		#endregion SDL_QuitSubSystem(int flags)

@@ -3139,11 +3270,14 @@
 		/// </returns>
 		/// <remarks>
 		///     SDL_WasInit allows you to see which SDL subsytems have been initialized.
+		///

+		///     Binds to C-function call in SDL.h:
+		///     extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_Init" />
 		/// <seealso cref="SDL_InitSubSystem" />
-		// extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_WasInit(int flags);
 		#endregion int SDL_WasInit(int flags)

@@ -3154,19 +3288,211 @@
 		/// <remarks>
 		///     SDL_Quit shuts down all SDL subsystems and frees the resources allocated
 		///     to them.  This should always be called before you exit.
+		///

+		///     Binds to C-function call in SDL.h:
+		///     extern DECLSPEC void SDLCALL SDL_Quit(void)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_Init" />
 		/// <seealso cref="SDL_QuitSubSystem" />
-		// extern DECLSPEC void SDLCALL SDL_Quit(void);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_Quit();
 		#endregion SDL_Quit()
-
-		// SDL_main -- none
-
-		// SDL_types -- none
-
-		// SDL_getenv
+		#endregion SDL.h
+
+		#region SDL_active.h
+		#region byte SDL_GetAppState
+		///
+		/// This function returns the current state of the application,
+		/// which is a bitwise combination of SDL_APPMOUSEFOCUS,
+		/// SDL_APPINPUTFOCUS, and SDL_APPACTIVE.
+		///
+		/// <remarks>
+		/// If SDL_APPACTIVE is set, then the user is able to see
+		/// your application,
+		/// otherwise it has been iconified or disabled.
+		/// </remarks>
+		/// <returns></returns>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
+		SuppressUnmanagedCodeSecurity]
+		public static extern byte SDL_GetAppState();
+		#endregion byte SDL_GetAppState
+		#endregion SDL_active.h
+
+		// SDL_audio.h -- Reorg
+
+		#region SDL_byteorder.h
+		#region int SDL_BYTEORDER
+		///
+		/// Returns the endianness of the host system.
+		///
+		public static int SDL_BYTEORDER
+		{
+			get
+			{
+				if (BitConverter.IsLittleEndian)
+				{
+					return SDL_LIL_ENDIAN;
+				}
+				else
+				{
+					return SDL_BIG_ENDIAN;
+				}
+			}
+		}
+		#endregion int SDL_BYTEORDER
+		#endregion SDL_byteorder.h
+
+		// SDL_cdrom.h -- reorg
+
+		// SDL_copying.h -- none
+
+		#region SDL_cpuinfo.h
+		#region SDL_bool SDL_HasRDTSC()
+		///
+		///     This function returns true if the CPU has the RDTSC instruction.
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasRDTSC();
+		#endregion SDL_bool SDL_HasRDTSC()
+
+		#region SDL_bool SDL_HasMMX()
+		///
+		///     This function returns true if the CPU has MMX features.
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasMMX();
+		#endregion SDL_bool SDL_HasMMX()
+
+		#region SDL_bool SDL_HasMMXExt()
+		///
+		///     This function returns true if the CPU has MMX Ext. features.
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasMMXExt();
+		#endregion SDL_bool SDL_HasMMXExt()
+
+		#region SDL_bool SDL_Has3DNow()
+		///
+		///     This function returns true if the CPU has 3DNow features
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_SDL_Has3DNow()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_Has3DNow();
+		#endregion SDL_bool SDL_Has3DNow()
+
+		#region SDL_bool SDL_HasSSE()
+		///
+		///     This function returns true if the CPU has SSE features
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_SDL_HasSSE()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasSSE();
+		#endregion SDL_bool SDL_HasSSE()
+
+		#region SDL_bool SDL_HasSSE2()
+		///
+		///     This function returns true if the CPU has SSE2 features
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_SDL_HasSSE2()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasSSE2();
+		#endregion SDL_bool SDL_HasSSE2()
+
+		#region SDL_bool SDL_HasAltiVec()
+		///
+		///     This function returns true if the CPU has AltiVec features
+		///
+		/// <remarks>
+		///
Binds to C-function call in SDL_cpuinfo.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_SDL_HasAltiVec()
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_bool SDL_HasAltiVec();
+		#endregion SDL_bool SDL_HasAltiVec()
+
+		#endregion SDL_cpuinfo.h
+
+		// SDL_endian.h -- skipped for now, might be useful after SDL_rwops has
+		// been implemented.
+
+		#region SDL_error.h
+		#region SDL_SetError(string message)
+		///
+		///     Sets an SDL error string.
+		///
+		/// <param name="message">
+		///     The error message to set.
+		/// </param>
+		/// <remarks>
+		///
Binds to C-function call in SDL_error.h:
+		///     extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...)
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern void SDL_SetError(string message);
+		#endregion SDL_SetError(string message)
+
+		#region string SDL_GetError()
+		///
+		///     Gets an SDL error string.
+		///
+		/// <returns>
+		///     A string containing information about the last internal SDL error.
+		/// </returns>
+		/// <remarks>
+		///
Binds to C-function call in SDL_error.h:
+		///     extern DECLSPEC char * SDLCALL SDL_GetError(void)
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern string SDL_GetError();
+		#endregion string SDL_GetError()
+
+		#region SDL_ClearError()
+		///
+		///     Clears the SDL error.
+		///
+		/// <remarks>
+		///

+		/// Binds to C-function call in SDL_error.h:
+		/// extern DECLSPEC void SDLCALL SDL_ClearError(void)
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern void SDL_ClearError();
+		#endregion SDL_ClearError()
+		#endregion SDL_error.h
+
+		#region SDL_getenv.h
 		#region int SDL_putenv(string variable)
 		///
 		///     Puts a variable of the form "name=value" into the environment.
@@ -3178,11 +3504,14 @@
 		///     Returns -1 on an error or 0 on success.
 		/// </returns>
 		/// <remarks>
-		///     Not all environments have a working putenv()
+		///     Not all environments have a working putenv(). SDL_putenv() is not available on Windows.
+		///

+		///     Binds to C-function call in SDL_getenv.h:
+		///     extern DECLSPEC int SDLCALL SDL_putenv(const char *variable)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_getenv" />
-		// extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_putenv(string variable);
 		#endregion int SDL_putenv(string variable)

@@ -3197,51 +3526,24 @@
 		///     The value of the specified environmental variable.
 		/// </returns>
 		/// <remarks>
-		///     Not all environments have a working getenv()
+		///     Not all environments have a working getenv(). SDL_getenv() is not available on Windows.
+		///
Binds to C-function call in SDL_getenv.h:
+		///     extern DECLSPEC char * SDLCALL SDL_getenv(const char *name)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_putenv" />
-		// extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern string SDL_getenv(string name);
 		#endregion string SDL_getenv(string name)
-
-		// SDL_error
-		#region SDL_SetError(string message)
-		///
-		///     Sets an SDL error string.
-		///
-		/// <param name="message">
-		///     The error message to set.
-		/// </param>
-		// extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
-		public static extern void SDL_SetError(string message);
-		#endregion SDL_SetError(string message)
-
-		#region string SDL_GetError()
-		///
-		///     Gets an SDL error string.
-		///
-		/// <returns>
-		///     A string containing information about the last internal SDL error.
-		/// </returns>
-		// extern DECLSPEC char * SDLCALL SDL_GetError(void);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
-		public static extern string SDL_GetError();
-		#endregion string SDL_GetError()
-
-		#region SDL_ClearError()
-		///
-		///     Clears the SDL error.
-		///
-		// extern DECLSPEC void SDLCALL SDL_ClearError(void);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
-		public static extern void SDL_ClearError();
-		#endregion SDL_ClearError()
+		#endregion SDL_getenv.h
+
+		// SDL_main.h -- none
+		// SDL_name.h -- none
+		// SDL_quit.h -- none

 		// TODO: SDL_rwops -- skipped for now, might be useful

-		// SDL_timer
+		#region SDL_timer.h
 		#region int SDL_GetTicks()
 		///
 		///     Get the number of milliseconds since the SDL library initialization.
@@ -3251,10 +3553,13 @@
 		/// </returns>
 		/// <remarks>
 		///     Note that this value wraps if the program runs for more than ~49 days.
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_Delay" />
-		// extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_GetTicks();
 		#endregion int SDL_GetTicks()

@@ -3268,11 +3573,14 @@
 		/// <remarks>
 		///     SDL_Delay will wait at least the specified time, but possible longer due
 		///     to OS scheduling.  Count on a delay granularity of at least 10 ms.  Some
-		///     platforms have shorter clock ticks but this is the most common
+		///     platforms have shorter clock ticks but this is the most common.
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_AddTimer" />
-		// extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_Delay(int ms);
 		#endregion SDL_Delay(int ms)

@@ -3317,32 +3625,77 @@
 		///         timer functions <see cref="SDL_AddTimer" /> and
 		///         <see cref="SDL_RemoveTimer" /> which support multiple timers.
 		///     </para>
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval,
+		///     SDL_TimerCallback callback)
+		///

 		/// </remarks>
 		/// <seealso cref="SDL_AddTimer" />
 		/// <seealso cref="SDL_TimerCallback" />
-		// extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_TimerCallback callback);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetTimer(int interval, SDL_TimerCallback callback);
 		#endregion int SDL_SetTimer(int interval, SDL_TimerCallback callback)
-		///
-		///
-		///
-		public struct SDL_TimerID {
-		}
+
+		#region SDL_TimerID SDL_AddTimer(int interval, SDL_NewTimerCallback callback)
 		// TODO: Goddamn void* double whammy since it's a delegate
+		// TODO write test
 		// extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param);
 		///
-		///
-		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
-		public static extern SDL_TimerID SDL_AddTimer(int interval, SDL_NewTimerCallback callback, IntPtr param);
-
-		///
-		///
-		///
-		public struct SDL_bool {
-		}
+		///     Add a timer which will call a callback after the
+		///     specified number of milliseconds has elapsed.
+		///
+		/// <param name="callback">
+		/// The callback to run.
+		/// </param>
+		/// <param name="interval">
+		/// The timer interval.
+		/// </param>
+		/// <returns>
+		/// Returns an ID value for the added timer or NULL if
+		/// there was an error.
+		/// </returns>
+		/// <remarks>
+		/// <para>
+		/// Adds a callback function to be run after the specified number of
+		/// milliseconds has elapsed. The callback function is passed the current
+		/// timer interval and the user supplied parameter from the SDL_AddTimer
+		/// call and returns the next timer interval. If the returned value from
+		/// the callback is the same as the one passed in, the periodic alarm
+		/// continues, otherwise a new alarm is scheduled.
+		/// </para>
+		/// <para>
+		/// To cancel a currently running timer call <see cref="SDL_RemoveTimer" />
+		/// with the timer ID returned from SDL_AddTimer.
+		/// </para>
+		/// <para>
+		/// The timer callback function may run in a different thread than your main
+		/// program, and so shouldn't call any functions from within itself.
+		/// You may always call SDL_PushEvent, however.
+		/// </para>
+		/// <para>
+		/// The granularity of the timer is platform-dependent,
+		/// but you should count on it being at least 10 ms as this is the
+		/// most common number. This means that if you request a 16 ms timer,
+		///  your callback will run approximately 20 ms later on an unloaded
+		///  system. If you wanted to set a flag signaling a frame update at
+		///  30 frames per second (every 33 ms), you might set a timer for
+		///  30 ms (see example below). If you use this function, you need
+		///  to pass <see cref="SDL_INIT_TIMER" /> to <see cref="SDL_Init" />.
+		/// </para>
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC SDL_TimerID SDLCALL
+		///     SDL_AddTimer(Uint32 interval,
+		///     SDL_NewTimerCallback callback, void *param)
+		///

+		/// </remarks>
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		public static extern SDL_TimerID SDL_AddTimer(int interval, SDL_NewTimerCallback callback);
+		#endregion SDL_TimerID SDL_AddTimer(int interval, SDL_NewTimerCallback callback)
+
 		#region SDL_bool SDL_RemoveTimer(SDL_TimerID t)
+		//TODO Write Test
 		///
 		///     Remove a timer which was added with <see cref="SDL_AddTimer" />.
 		///
@@ -3352,14 +3705,24 @@
 		/// <returns>
 		///     A boolean value indicating success.
 		/// </returns>
+		/// <remarks>
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t)
+		///

+		/// </remarks>
 		/// <seealso cref="SDL_AddTimer" />
-		// extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
+		//
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, ExactSpelling=true), SuppressUnmanagedCodeSecurity]
 		public static extern SDL_bool SDL_RemoveTimer(SDL_TimerID t);
 		#endregion SDL_bool SDL_RemoveTimer(SDL_TimerID t)
-
+		#endregion SDL_timer.h
+
+		// SDL_types -- none
+
+		#region SDL_video.h
 		// extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION,
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION,
 			 EntryPoint="SDL_ListModes"), SuppressUnmanagedCodeSecurity]
 		private static extern IntPtr SDL_ListModesInternal(
 			IntPtr format, int flags);
@@ -3401,21 +3764,6 @@
 		}

 		///
-		/// This function returns the current state of the application,
-		/// which is a bitwise combination of SDL_APPMOUSEFOCUS,
-		/// SDL_APPINPUTFOCUS, and SDL_APPACTIVE.
-		///
-		/// <remarks>
-		/// If SDL_APPACTIVE is set, then the user is able to see
-		/// your application,
-		/// otherwise it has been iconified or disabled.
-		/// </remarks>
-		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
-		SuppressUnmanagedCodeSecurity]
-		public static extern Byte SDL_GetAppState();
-
-		///
 		/// This function fills the given character buffer with the name of the
 		/// video driver, and returns a pointer to it if the video driver has
 		/// been initialized.
@@ -3424,7 +3772,7 @@
 		/// It returns NULL if no driver has been initialized.
 		/// </remarks>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern String SDL_VideoDriverName(String namebuf,
 			int maxlen);
@@ -3440,9 +3788,74 @@
 		/// "best" video mode.
 		/// </remarks>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern SDL_VideoInfo SDL_GetVideoInfo();
+		#endregion SDL_video.h
+
+		#region SDL_version.h
+		//     extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void)
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, EntryPoint="SDL_Linked_Version"), SuppressUnmanagedCodeSecurity]
+		private static extern IntPtr SDL_Linked_VersionInternal();
+
+		///
+		///     This function gets the version of the dynamically linked SDL library.
+		///
+		/// <returns>
+		///     SDL_version struct
+		/// </returns>
+		/// <remarks>
+		///

+		///     Binds to C-function call in SDL_timer.h:
+		///     extern DECLSPEC const SDL_version * SDLCALL SDL_Linked_Version(void)
+		///

+		/// </remarks>
+		public static SDL_version SDL_Linked_Version()
+		{
+			return (Sdl.SDL_version)Marshal.PtrToStructure(
+				Sdl.SDL_Linked_VersionInternal(),
+				typeof(Sdl.SDL_version));
+		}
+
+		// This method turns the version numbers into a numeric value: (1,2,3) -> (1203)
+		// This assumes that there will never be more than 100 patchlevels
+		private static int SDL_VERSIONNUM( byte major, byte minor, byte patch )
+		{
+			return (int)(major*1000 + minor*100 + patch);
+		}
+
+		///
+		/// This returns the current SDL version
+		///
+		/// <returns>
+		/// Returns the version number as a numeric value: (1.2.7 -> 1207)
+		/// </returns>
+		public static int SDL_COMPILEDVERSION
+		{
+			get
+			{
+				SDL_version version = Sdl.SDL_Linked_Version();
+				return Sdl.SDL_VERSIONNUM(version.major, version.minor, version.patch);
+			}
+		}
+
+		///
+		/// Will evaluate to true if SDL version is at least X.Y.Z
+		///
+		/// <param name="major">Major version number</param>
+		/// <param name="minor">Minor version number</param>
+		/// <param name="patch">Patch version number</param>
+		/// <returns></returns>
+		public static bool SDL_VERSION_ATLEAST( byte major, byte minor, byte patch )
+		{
+			return (Sdl.SDL_COMPILEDVERSION >= Sdl.SDL_VERSIONNUM(
+				major,
+				minor,
+				patch));
+		}
+		#endregion SDL_version.h
+
+		#region NOT_DONE

 		//Keyboard
 		///
@@ -3454,7 +3867,7 @@
 		/// <param name="rate"></param>
 		/// <param name="delay"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_EnableKeyRepeat(int rate,
 			int delay);
@@ -3469,7 +3882,7 @@
 		///	if ( keystate[SDLK_RETURN] ) ...  _RETURN_ is pressed.
 		/// </remarks>
 		/// <param name="numkeys"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION, EntryPoint="SDL_GetKeyState"),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION, EntryPoint="SDL_GetKeyState"),
 		SuppressUnmanagedCodeSecurity]
 		private static extern IntPtr SDL_GetKeyStateInternal(out int numkeys);

@@ -3497,7 +3910,7 @@
 		///
 		/// <remarks>
 		/// </remarks>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern SDLMod SDL_GetModState();

@@ -3509,7 +3922,7 @@
 		///  flags.
 		/// </remarks>
 		/// <param name="modstate"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_SetModState(SDLMod modstate);

@@ -3518,7 +3931,7 @@
 		///
 		/// <remarks>
 		/// </remarks>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern String SDL_GetKeyName(SDLKey key);

@@ -3534,7 +3947,7 @@
 		/// </remarks>
 		/// <param name="enable"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_EnableUNICODE(int enable);

@@ -3627,7 +4040,7 @@
 		/// <param name="bpp"></param>
 		/// <param name="flags"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_SetVideoMode(int width, int height,
 			int bpp, int flags);
@@ -3655,7 +4068,7 @@
 		/// <param name="bpp"></param>
 		/// <param name="flags"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_VideoModeOK(int width,
 			int height, int bpp, int flags);
@@ -3674,7 +4087,7 @@
 		/// <param name="numrects"></param>
 		/// <param name="rects"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_UpdateRects(IntPtr screen,
 			int numrects, IntPtr rects);
@@ -3695,7 +4108,7 @@
 		/// <param name="x"></param>
 		/// <param name="y"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_UpdateRect(IntPtr screen, int x,
 			int y, int w, int h);
@@ -3704,7 +4117,7 @@
 		///
 		///
 		/// <param name="surface"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_FreeSurface(IntPtr surface);

@@ -3727,7 +4140,7 @@
 		///
 		/// <param name="screen"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_Flip(IntPtr screen);

@@ -3744,7 +4157,7 @@
 		/// <param name="green"></param>
 		/// <param name="red"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetGamma(float red, float green,
 			float blue);
@@ -3765,7 +4178,7 @@
 		/// hardware does not support gamma translation, or otherwise fails,
 		/// this function will return -1.
 		/// </remarks>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetGammaRamp(IntPtr red, IntPtr green,
 			IntPtr blue);
@@ -3780,7 +4193,7 @@
 		/// hardware does not support gamma translation, or otherwise fails,
 		/// this function will return -1.
 		/// </remarks>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_GetGammaRamp(IntPtr red, IntPtr green,
 			IntPtr blue);
@@ -3799,7 +4212,7 @@
 		/// <param name="rect"></param>
 		/// <param name="color"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_FillRect(IntPtr surface, IntPtr rect,
 			int color);
@@ -3816,7 +4229,7 @@
 		/// <param name="g"></param>
 		/// <param name="b"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_MapRGB(IntPtr format, Byte r, Byte g,
 			Byte b);
@@ -3833,7 +4246,7 @@
 		/// <param name="b"></param>
 		/// <param name="a"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_MapRGBA(IntPtr format, Byte r, Byte g,
 			Byte b, Byte a);
@@ -3847,7 +4260,7 @@
 		/// <param name="r"></param>
 		/// <param name="g"></param>
 		/// <param name="b"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_GetRGB(int pixel, IntPtr fmt,
 			out Byte r, out Byte g, out Byte b);
@@ -3862,7 +4275,7 @@
 		/// <param name="g"></param>
 		/// <param name="b"></param>
 		/// <param name="a"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_GetRGBA(int pixel, IntPtr fmt,
 			out Byte r, out Byte g, out Byte b, out Byte a);
@@ -3879,7 +4292,7 @@
 		/// <param name="x"></param>
 		/// <param name="y"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern Byte SDL_GetMouseState(out int x, out int y);

@@ -3894,7 +4307,7 @@
 		/// <param name="x"></param>
 		/// <param name="y"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern Byte SDL_GetRelativeMouseState(out int x, out int y);

@@ -3921,7 +4334,7 @@
 		/// <param name="mask"></param>
 		/// <param name="w"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CreateCursor(IntPtr data, IntPtr mask,
 			int w, int h, int hot_x, int hot_y);
@@ -3935,7 +4348,7 @@
 		/// </remarks>
 		/// <param name="cursor"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_SetCursor(IntPtr cursor);

@@ -3945,7 +4358,7 @@
 		/// <remarks>
 		/// </remarks>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_GetCursor();

@@ -3956,7 +4369,7 @@
 		/// </remarks>
 		/// <param name="cursor"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_FreeCursor(IntPtr cursor);

@@ -3971,7 +4384,7 @@
 		/// </remarks>
 		/// <param name="toggle"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_ShowCursor(int toggle);

@@ -3981,7 +4394,7 @@
 		///
 		/// <param name="x"></param>
 		/// <param name="y"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_WarpMouse(short x, short y);

@@ -4050,7 +4463,7 @@
 		/// <param name="Bmask"></param>
 		/// <param name="Amask"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_CreateRGBSurface(int flags,
 			int width, int height, int depth,
@@ -4122,7 +4535,7 @@
 		/// <param name="Bmask"></param>
 		/// <param name="Amask"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_CreateRGBSurfaceFrom(IntPtr pixels,
 			int width, int height, int depth, int pitch, int Rmask,
@@ -4209,7 +4622,7 @@
 		/// <param name="dst"></param>
 		/// <param name="dstrect"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION,
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION,
 			 EntryPoint="SDL_UpperBlit"), SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_BlitSurface(IntPtr src, IntPtr srcrect,
 			IntPtr dst, IntPtr dstrect);
@@ -4223,7 +4636,7 @@
 		/// surface.
 		/// </remarks>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_GetVideoSurface();

@@ -4257,7 +4670,7 @@
 		/// </remarks>
 		/// <param name="surface"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_LockSurface(IntPtr surface);

@@ -4288,7 +4701,7 @@
 		///
 		/// <param name="surface"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_UnlockSurface(IntPtr surface);

@@ -4304,7 +4717,7 @@
 		/// <param name="src"></param>
 		/// <param name="freesrc"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_LoadBMP_RW(IntPtr src, int freesrc);

@@ -4318,7 +4731,7 @@
 		/// <param name="dst"></param>
 		/// <param name="freedst"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SaveBMP_RW(IntPtr surface, IntPtr dst,
 			int freedst);
@@ -4348,7 +4761,7 @@
 		/// <param name="firstcolor"></param>
 		/// <param name="ncolors"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetColors(IntPtr surface,
 			int firstcolor, int ncolors);
@@ -4380,7 +4793,7 @@
 		/// <param name="flags"></param>
 		/// <param name="ncolors"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetPalette(IntPtr surface, int flags,
 			IntPtr colors, int firstcolor, int ncolors);
@@ -4400,7 +4813,7 @@
 		/// <param name="flag"></param>
 		/// <param name="key"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetColorKey(IntPtr surface, int flag,
 			int key);
@@ -4424,7 +4837,7 @@
 		/// </remarks>
 		/// <param name="surface"></param>
 		/// <param name="rect"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_SetClipRect(IntPtr surface, IntPtr rect);

@@ -4435,7 +4848,7 @@
 		///
 		/// <param name="surface"></param>
 		/// <param name="rect"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_GetClipRect(IntPtr surface, IntPtr rect);

@@ -4452,7 +4865,7 @@
 		///
 		/// <param name="surface"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_DisplayFormat(IntPtr surface);

@@ -4470,7 +4883,7 @@
 		///
 		/// <param name="surface"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_DisplayFormatAlpha(IntPtr surface);

@@ -4495,7 +4908,7 @@
 		/// <param name="fmt"></param>
 		/// <param name="flags"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_ConvertSurface(IntPtr src, IntPtr fmt,
 			int flags);
@@ -4528,7 +4941,7 @@
 		/// <param name="flag"></param>
 		/// <param name="alpha"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_SetAlpha(IntPtr surface, int flag,
 			Byte alpha);
@@ -4540,7 +4953,7 @@
 		/// <param name="file"></param>
 		/// <param name="mode"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_RWFromFile(String file, String mode);

@@ -4550,7 +4963,7 @@
 		/// <param name="mem"></param>
 		/// <param name="size"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_RWFromMem(Byte[] mem, int size);

@@ -4570,7 +4983,7 @@
 		/// <param name="action"></param>
 		/// <param name="mask"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_PeepEvents([Out]SDL_Event[] events, int numEvents, SDL_eventaction action, int mask);

@@ -4583,7 +4996,7 @@
 		///
 		/// <param name="sdlEvent"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_PollEvent(out SDL_Event sdlEvent);

@@ -4601,7 +5014,7 @@
 		/// <param name="type"></param>
 		/// <param name="state"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_EventState(Byte type, int state);

@@ -4614,7 +5027,7 @@
 		///
 		/// <param name="evt"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_WaitEvent(out SDL_Event evt);

@@ -4622,7 +5035,7 @@
 		/// Pumps the event loop, gathering events from the input devices.
 		///
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_PumpEvents();

@@ -4633,7 +5046,7 @@
 		///
 		/// <param name="evt"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_PushEvent(out SDL_Event evt);

@@ -4643,7 +5056,7 @@
 		///
 		/// <param name="title"></param>
 		/// <param name="icon"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_WM_SetCaption(string title, string icon);

@@ -4652,7 +5065,7 @@
 		///
 		/// <param name="title"></param>
 		/// <param name="icon"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_WM_GetCaption(out string title,
 			out string icon);
@@ -4667,7 +5080,7 @@
 		///
 		/// <param name="icon"></param>
 		/// <param name="mask"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_WM_SetIcon(IntPtr icon, IntPtr mask);

@@ -4677,7 +5090,7 @@
 		/// This function is a noop and returns 0 in non-windowed environments.
 		///
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_WM_IconifyWindow();

@@ -4690,7 +5103,7 @@
 		///
 		/// <param name="mode"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_WM_GrabInput(SDL_GrabMode mode);

@@ -4712,7 +5125,7 @@
 		///
 		/// <param name="surface"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_WM_ToggleFullScreen(IntPtr surface);

@@ -4721,7 +5134,7 @@
 		/// Count the number of joysticks attached to the system.
 		///
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_NumJoysticks();

@@ -4732,7 +5145,7 @@
 		///
 		/// <param name="device_index"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern string SDL_JoystickName(int device_index);

@@ -4748,7 +5161,7 @@
 		/// </remarks>
 		/// <param name="device_index"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_JoystickOpen(int device_index);

@@ -4760,7 +5173,7 @@
 		/// </remarks>
 		/// <param name="device_index"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickOpened(int device_index);

@@ -4769,7 +5182,7 @@
 		///
 		/// <param name="joystick"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickIndex(IntPtr joystick);

@@ -4778,7 +5191,7 @@
 		///
 		/// <param name="joystick"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickNumAxes(IntPtr joystick);

@@ -4791,7 +5204,7 @@
 		/// </remarks>
 		/// <param name="joystick"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickNumBalls(IntPtr joystick);

@@ -4800,7 +5213,7 @@
 		///
 		/// <param name="joystick"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickNumHats(IntPtr joystick);

@@ -4809,7 +5222,7 @@
 		///
 		/// <param name="joystick"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_JoystickNumButtons(IntPtr joystick);

@@ -4822,7 +5235,7 @@
 		/// </remarks>
 		/// <param name="joystick"></param>
 		/// <param name="axis"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_JoystickGetAxis(IntPtr joystick,
 			int axis);
@@ -4835,7 +5248,7 @@
 		/// </remarks>
 		/// <param name="joystick"></param>
 		/// <param name="hat"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_JoystickGetHat(IntPtr joystick,
 			int hat);
@@ -4851,7 +5264,7 @@
 		/// <param name="ball"></param>
 		/// <param name="dx"></param>
 		/// <param name="dy"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_JoystickGetBall(IntPtr joystick,
 			int ball, IntPtr dx, IntPtr dy);
@@ -4864,7 +5277,7 @@
 		/// </remarks>
 		/// <param name="joystick"></param>
 		/// <param name="button"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_JoystickGetButton(IntPtr joystick,
 			int button);
@@ -4873,7 +5286,7 @@
 		/// Close a joystick previously opened with SDL_JoystickOpen().
 		///
 		/// <param name="joystick"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_JoystickClose(IntPtr joystick);

@@ -4881,7 +5294,7 @@
 		///
 		/// Swap the OpenGL buffers, if double-buffering is supported.
 		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_GL_SwapBuffers();

@@ -4891,7 +5304,7 @@
 		/// <param name="attr"></param>
 		/// <param name="value"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_GL_SetAttribute(SDL_GLattr attr,
 			int value);
@@ -4909,7 +5322,7 @@
 		/// <param name="attr"></param>
 		/// <param name="val"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_GL_GetAttribute(SDL_GLattr attr,
 			out int val);
@@ -4919,7 +5332,7 @@
 		///
 		/// <param name="extension"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_GL_GetProcAddress(string extension);

@@ -4934,7 +5347,7 @@
 		/// flag.
 		/// </remarks>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDNumDrives();

@@ -4952,7 +5365,7 @@
 		/// </remarks>
 		/// <param name="drive"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern string SDL_CDName(int drive);

@@ -4974,7 +5387,7 @@
 		/// </remarks>
 		/// <param name="drive"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_CDOpen(int drive);

@@ -4988,7 +5401,7 @@
 		/// </remarks>
 		/// <param name="cdrom"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDStatus(IntPtr cdrom);

@@ -5002,7 +5415,7 @@
 		/// <param name="start"></param>
 		/// <param name="length"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDPlay(IntPtr cdrom, int start,
 			int length);
@@ -5038,7 +5451,7 @@
 		/// <param name="ntracks"></param>
 		/// <param name="nframes"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDPlayTracks(IntPtr cdrom,
 			int start_track, int start_frame, int ntracks,
@@ -5052,7 +5465,7 @@
 		/// </remarks>
 		/// <param name="cdrom"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDPause(IntPtr cdrom);

@@ -5064,7 +5477,7 @@
 		/// </remarks>
 		/// <param name="cdrom"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDResume(IntPtr cdrom);

@@ -5076,7 +5489,7 @@
 		/// </remarks>
 		/// <param name="cdrom"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDStop(IntPtr cdrom);

@@ -5088,7 +5501,7 @@
 		/// </remarks>
 		/// <param name="cdrom"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_CDEject(IntPtr cdrom);

@@ -5096,28 +5509,15 @@
 		/// Closes the handle for the CD-ROM drive
 		///
 		/// <param name="cdrom"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_CDClose(IntPtr cdrom);

 		///
-		///
-		///
-		public static int SDL_BYTEORDER {
-			get {
-				if (BitConverter.IsLittleEndian) {
-					return SDL_LIL_ENDIAN;
-				}
-				else {
-					return SDL_BIG_ENDIAN;
-				}
-			}
-		}
-
-		///
 		/// Native audio byte ordering
 		///
-		public static int AUDIO_U16SYS {
+		public static int AUDIO_U16SYS
+		{
 			get {
 				if (SDL_BYTEORDER == SDL_LIL_ENDIAN) {
 					return AUDIO_U16LSB;
@@ -5150,7 +5550,7 @@
 		///
 		/// <param name="driver_name">
 		/// </param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_AudioInit(String driver_name);

@@ -5160,7 +5560,7 @@
 		/// have a specific need to specify the audio driver you want to use.
 		/// You should normally use SDL_Init() or SDL_InitSubSystem().
 		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_AudioQuit();

@@ -5172,7 +5572,7 @@
 		///
 		/// <param name="buf"></param>
 		/// <param name="maxlen"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern String SDL_AudioDriverName(
 			String buf, int maxlen);
@@ -5237,7 +5637,7 @@
 		///
 		/// <param name="desired"></param>
 		/// <param name="obtained"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_OpenAudio(
 			IntPtr desired, IntPtr obtained);
@@ -5246,7 +5646,7 @@
 		/// Get the current audio state
 		///
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern SDL_audiostatus SDL_GetAudioStatus();

@@ -5259,7 +5659,7 @@
 		/// Silence will be written to the audio device during the pause.
 		///
 		/// <param name="pause_on"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_PauseAudio(int pause_on);

@@ -5288,7 +5688,7 @@
 		/// <param name="spec"></param>
 		/// <param name="src"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern IntPtr SDL_LoadWAV_RW(
 			IntPtr src, int freesrc, IntPtr spec,
@@ -5304,7 +5704,7 @@
 		///
 		/// <param name="audio_buf"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_FreeWAV(IntPtr audio_buf);

@@ -5326,7 +5726,7 @@
 		/// <param name="dst_channels"></param>
 		/// <param name="dst_rate"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_BuildAudioCVT(IntPtr cvt,
 			short src_format, Byte src_channels, int src_rate,
@@ -5349,7 +5749,7 @@
 		///
 		/// <param name="cvt"></param>
 		/// <returns></returns>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern int SDL_ConvertAudio(IntPtr cvt);

@@ -5367,7 +5767,7 @@
 		/// <param name="src"></param>
 		/// <param name="len"></param>
 		/// <param name="volume"></param>
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_MixAudio(
 			IntPtr dst, IntPtr src, int len, int volume);
@@ -5381,7 +5781,7 @@
 		/// Do not call these from the callback
 		/// function or you will cause deadlock.
 		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_LockAudio();

@@ -5393,7 +5793,7 @@
 		///  Do not call these from the callback
 		/// function or you will cause deadlock.
 		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_UnlockAudio();

@@ -5401,8 +5801,10 @@
 		/// This function shuts down audio processing and
 		/// closes the audio device.
 		///
-		[DllImport("SDL.dll", CallingConvention=CALLING_CONVENTION),
+		[DllImport(SDL_NATIVE_LIBRARY, CallingConvention=CALLING_CONVENTION),
 		SuppressUnmanagedCodeSecurity]
 		public static extern void SDL_CloseAudio();
+		#endregion NOT_DONE
+		#endregion Sdl Methods
 	}
 }


Load error model when entity references an unknown model

--- GUI/Types/Renderer/WorldLoader.cs
+++ GUI/Types/Renderer/WorldLoader.cs
@@ -205,6 +205,22 @@

                 if (newEntity == null)
                 {
+                    var errorModelResource = guiContext.LoadFileByAnyMeansNecessary("models/dev/error.vmdl_c");
+
+                    if (errorModelResource != null)
+                    {
+                        var errorModel = new ModelSceneNode(scene, new Model(errorModelResource), skin, false)
+                        {
+                            Transform = transformationMatrix,
+                            LayerName = layerName,
+                        };
+                        scene.Add(errorModel, false);
+                    }
+                    else
+                    {
+                        Console.WriteLine("Unable to load error.vmdl_c. Did you add \"core/pak_001.dir\" to your game paths?");
+                    }
+
                     continue;
                 }


add support for body prop in entity being an integer

--- GUI/Types/Renderer/WorldLoader.cs
+++ GUI/Types/Renderer/WorldLoader.cs
@@ -6,6 +6,7 @@
 using System.Threading.Tasks;
 using GUI.Utils;
 using ValveResourceFormat.ResourceTypes;
+using ValveResourceFormat.Utils;

 namespace GUI.Types.Renderer
 {
@@ -112,7 +113,6 @@
                 var position = entity.GetProperty<string>("origin");
                 var angles = entity.GetProperty<string>("angles");
                 var model = entity.GetProperty<string>("model");
-                var body = entity.GetProperty<string>("body");
                 var skin = entity.GetProperty<string>("skin");
                 var colour = entity.GetProperty<byte[]>("rendercolor");
                 var particle = entity.GetProperty<string>("effect_name");
@@ -223,9 +223,22 @@
                     modelNode.SetAnimation(animation);
                 }

-                if (body != default && int.TryParse(body, out var bodyGroup))
+                var bodyHash = EntityLumpKeyLookup.Get("body");
+                if (entity.Properties.ContainsKey(bodyHash))
                 {
                     var groups = modelNode.GetMeshGroups();
+                    var body = entity.Properties[bodyHash].Data;
+                    int bodyGroup = -1;
+
+                    if (body is ulong bodyGroupLong)
+                    {
+                        bodyGroup = (int)bodyGroupLong;
+                    }
+                    else if (body is string bodyGroupString)
+                    {
+                        int.TryParse(bodyGroupString, out bodyGroup);
+                    }
+
                     modelNode.SetActiveMeshGroups(groups.Skip(bodyGroup).Take(1));
                 }


Can serialize/deserialize dice cup

Can serialize/deserialize dice cup

--- silverneedle/lib/Dice/Cup.cs
+++ silverneedle/lib/Dice/Cup.cs
@@ -44,15 +44,27 @@
              this.ParseDice(configuration.GetString("dice"));
         }

+        [ObjectStoreOptional("name")]
         public string Name { get; private set; }

-        //TODO: Should be IEnumerable?
         public List<Die> Dice { get; private set; }

         public int Modifier { get; set; }
+
+        [ObjectStoreOptional("maximize-amount")]
         public bool MaximizeAmount { get; set; }

         public int Count { get { return Dice.Count; } }
+
+        [ObjectStore("dice-value")]
+        public string DiceString
+        {
+            get { return this.ToString(); }
+            set
+            {
+                this.ParseDice(value);
+            }
+        }

         public void AddDie(Die die)
         {


updates email address

updates email address

--- ImgBot.Function/CompressImages.cs
+++ ImgBot.Function/CompressImages.cs
@@ -36,7 +36,7 @@
             }

             // commit
-            var signature = new LibGit2Sharp.Signature("imgbot", "imgbot@gmail.com", DateTimeOffset.Now);
+            var signature = new LibGit2Sharp.Signature("imgbot", "imgbothelp@gmail.com", DateTimeOffset.Now);
             repo.Commit("[ImgBot] optimizes images", signature, signature);

             // push to GitHub


Mark per-repo config locations obsolete

Mark per-repo config locations obsolete

--- LibGit2Sharp/RepositoryOptions.cs
+++ LibGit2Sharp/RepositoryOptions.cs
@@ -1,4 +1,6 @@
-namespace LibGit2Sharp
+using System;
+
+namespace LibGit2Sharp
 {
     /// <summary>
     /// Provides optional additional information to the Repository to be opened.
@@ -34,6 +36,7 @@
         /// </para>
         /// <seealso cref="GlobalSettings.SetConfigSearchPaths"/>.
         /// </summary>
+        [Obsolete("This option is deprecated. Use GlobalConfiguration.SetConfigSearchPaths()")]
         public string GlobalConfigurationLocation { get; set; }

         /// <summary>
@@ -44,6 +47,7 @@
         /// </para>
         /// <seealso cref="GlobalSettings.SetConfigSearchPaths"/>.
         /// </summary>
+        [Obsolete("This option is deprecated. Use GlobalConfiguration.SetConfigSearchPaths()")]
         public string XdgConfigurationLocation { get; set; }

         /// <summary>
@@ -54,6 +58,7 @@
         /// </para>
         /// <seealso cref="GlobalSettings.SetConfigSearchPaths"/>.
         /// </summary>
+        [Obsolete("This option is deprecated. Use GlobalConfiguration.SetConfigSearchPaths()")]
         public string SystemConfigurationLocation { get; set; }

         /// <summary>


fix autoresize.

fix autoresize.

--- LiteNetLib/Utils/NetDataWriter.cs
+++ LiteNetLib/Utils/NetDataWriter.cs
@@ -39,7 +39,7 @@
                 {
                     _maxLength *= 2;
                 }
-                _data = new byte[_maxLength];
+                Array.Resize(ref _data, _maxLength);
             }
         }

@@ -172,7 +172,7 @@
             //put bytes count
             int bytesCount = Encoding.UTF8.GetByteCount(value);
             if (_autoResize)
-                ResizeIfNeed(_position + bytesCount);
+                ResizeIfNeed(_position + bytesCount + 4);
             Put(bytesCount);

             //put string


Adding 'OpenStreetMap' name in samples

Adding 'OpenStreetMap' name in samples

--- Mapsui/Utilities/OpenStreetMap.cs
+++ Mapsui/Utilities/OpenStreetMap.cs
@@ -11,10 +11,15 @@

         public static TileLayer CreateTileLayer()
         {
-            return new TileLayer(new HttpTileSource(new GlobalSphericalMercator(0, 18),
-                        "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
-                        new[] { "a", "b", "c" }, name: "OpenStreetMap",
-                        attribution: OpenStreetMapAttribution));
+            return new TileLayer(CreateTileSource()) { Name = "OpenStreetMap" };
+        }
+
+        private static HttpTileSource CreateTileSource()
+        {
+            return new HttpTileSource(new GlobalSphericalMercator(0, 18),
+                "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
+                new[] { "a", "b", "c" }, name: "OpenStreetMap",
+                attribution: OpenStreetMapAttribution);
         }
     }
 }


Added MidiChordDefPalette : Palette<MidiChordDef> class

--- Moritz.Palettes/GenericPalette.cs
+++ Moritz.Palettes/GenericPalette.cs
@@ -83,4 +83,22 @@
 			return envelope;
 		}
 	}
+
+	public class MidiChordDefPalette : Palette<MidiChordDef>
+	{
+		public MidiChordDefPalette(List<MidiChordDef> midiChordDefs)
+		{
+			SetValues(midiChordDefs);
+		}
+
+		/// <summary>
+		/// Returns a clone of the envelope at index.
+		/// </summary>
+		public MidiChordDef GetEnvelope(int index)
+		{
+			MidiChordDef midiChordDef = GetClonedValueAt(index);
+
+			return midiChordDef;
+		}
+	}
 }


Needed backup parsing of the 4-day date.

--- MovieMiner/MineBoxOfficeReport.cs
+++ MovieMiner/MineBoxOfficeReport.cs
@@ -61,8 +61,14 @@

 					// Get the date of the article (hoping that the date is the ONLY thing in such a small font)

-					//node = doc.DocumentNode.SelectSingleNode("//body//h2[text()='4-Day Weekend Predictions']");
 					node = doc.DocumentNode.SelectSingleNode("//body//h2[text()='Weekend Predictions']");
+
+					if (node == null)
+					{
+						node = doc.DocumentNode.SelectSingleNode("//body//h2[text()='4-Day Weekend Predictions']");
+
+						Error = "4-day";
+					}

 					if (node != null)
 					{


Gracefully handle IO exceptions reading from Network Devices

--- MultiMiner.Win/Forms/MinerForm.cs
+++ MultiMiner.Win/Forms/MinerForm.cs
@@ -4138,14 +4138,15 @@

                 List<PoolInformation> poolInformationList = GetCachedPoolInfoFromAddress(networkDevice.IPAddress, networkDevice.Port);

-                Xgminer.Api.Data.VersionInformation versionInformation = new Xgminer.Api.ApiContext(networkDevice.Port, networkDevice.IPAddress).GetVersionInformation();
+                Xgminer.Api.Data.VersionInformation versionInformation = GetVersionInfoFromAddress(networkDevice.IPAddress, networkDevice.Port);

                 foreach (DeviceInformation deviceInformation in deviceInformationList)
                 {
                     MobileMiner.Data.MiningStatistics miningStatistics = new MobileMiner.Data.MiningStatistics()
                     {
                         MachineName = String.Format("{0}:{1}", networkDevice.IPAddress, networkDevice.Port),
-                        MinerName = versionInformation.Name,
+                        // versionInformation may be null if the read timed out
+                        MinerName = versionInformation == null ? String.Empty : versionInformation.Name,
                         CoinName = NetworkDeviceCoinName,
                         CoinSymbol = NetworkDeviceCoinSymbol,
                         Algorithm = "SHA-256"
@@ -4162,6 +4163,36 @@
                     statisticsList.Add(miningStatistics);
                 }
             }
+        }
+
+        private VersionInformation GetVersionInfoFromAddress(string ipAddress, int port)
+        {
+            Xgminer.Api.ApiContext apiContext = new Xgminer.Api.ApiContext(port, ipAddress);
+
+            //setup logging
+            apiContext.LogEvent -= LogApiEvent;
+            apiContext.LogEvent += LogApiEvent;
+
+            VersionInformation versionInformation = null;
+            try
+            {
+                try
+                {
+                    versionInformation = apiContext.GetVersionInformation();
+                }
+                catch (IOException ex)
+                {
+                    //don't fail and crash out due to any issues communicating via the API
+                    versionInformation = null;
+                }
+            }
+            catch (SocketException ex)
+            {
+                //won't be able to connect for the first 5s or so
+                versionInformation = null;
+            }
+
+            return versionInformation;
         }

         private void AddLocalMinerStatistics(List<MultiMiner.MobileMiner.Data.MiningStatistics> statisticsList)


fix length of New_Url bug too long

fix length of New_Url bug too long

--- NewsCollection.Core/Entity/New.cs
+++ NewsCollection.Core/Entity/New.cs
@@ -12,7 +12,7 @@
     [DataObject]
     [Description("新闻")]
     [BindIndex("PK_New_Id", true, "Id")]
-    [BindIndex("IX_NewUrl", true, "Url")]
+    [BindIndex("IX_New_Url", false, "Url")]
     [BindIndex("IX_New_AuthorId", false, "AuthorId")]
     [BindRelation("AuthorId", false, "Author", "Id")]
     [BindTable("New", Description = "新闻", ConnName = "DefaultConn", DbType = DatabaseType.SqlServer)]
@@ -59,7 +59,7 @@
         /// <summary></summary>
         [DisplayName("Content")]
         [Description("内容")]
-        [DataObjectField(false, false, false, 2147483647)]
+        [DataObjectField(false, false, false, 0)]
         [BindColumn(4, "Content", "内容", null, "text", 0, 0, false)]
         public virtual String Content
         {


Update version

Update version

--- NiL.JS/Properties/AssemblyInfo.cs
+++ NiL.JS/Properties/AssemblyInfo.cs
@@ -14,8 +14,8 @@
 [assembly: AssemblyCompany("NiLProject")]
 [assembly: AssemblyCopyright("Copyright © NiLProject 2015")]
 [assembly: AssemblyTrademark("NiL.JS")]
-[assembly: AssemblyVersion("2.2.900")]
-[assembly: AssemblyFileVersion("2.2.900")]
+[assembly: AssemblyVersion("2.2.903")]
+[assembly: AssemblyFileVersion("2.2.903")]
 [assembly: NeutralResourcesLanguage("en-US")]
 [assembly: ComVisible(false)]
 [assembly: CLSCompliant(true)]


Removed exception handling from GetContent to bubble detail up the chain

--- OpenIIoT.Core.Tests/Extensions.cs
+++ OpenIIoT.Core.Tests/Extensions.cs
@@ -79,14 +79,7 @@
         /// <returns>The typed Content, or default(T) if the Content can not be retrieved or cast.</returns>
         public static T GetContent<T>(this HttpResponseMessage response)
         {
-            try
-            {
-                return (T)((ObjectContent<T>)response.Content).Value;
-            }
-            catch (Exception)
-            {
-                return default(T);
-            }
+            return (T)((ObjectContent<T>)response.Content).Value;
         }

         /// <summary>