From 390a6c2cb3de0fc13d47e4d0b670687ca71f2fb8 Mon Sep 17 00:00:00 2001 From: Melker Narikka Date: Fri, 27 Sep 2013 12:39:57 +0000 Subject: [PATCH] Remember trailing whitespace? Me neither. Doesn't touch MiniTK. Went with a good ol' % git ls-files | grep -v MiniTK | xargs -d "\n" -r sed -i 's/[ \t]\+$//g' --- SDL2#.dll.config | 2 +- src/SDL2.cs | 1058 ++++++++++++++++++++++----------------------- src/SDL2_image.cs | 28 +- src/SDL2_mixer.cs | 176 ++++---- src/SDL2_ttf.cs | 104 ++--- 5 files changed, 684 insertions(+), 684 deletions(-) diff --git a/SDL2#.dll.config b/SDL2#.dll.config index 61d21e2..04628d7 100644 --- a/SDL2#.dll.config +++ b/SDL2#.dll.config @@ -3,7 +3,7 @@ - + diff --git a/src/SDL2.cs b/src/SDL2.cs index 5a90947..8977177 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -39,39 +39,39 @@ namespace SDL2 public static class SDL { #region SDL2# Variables - + /// /// Used by DllImport to load the native library. /// private const string nativeLibName = "SDL2.dll"; - + #endregion - + #region SDL_stdinc.h - + public static uint SDL_FOURCC(byte A, byte B, byte C, byte D) { return (uint) (A | (B << 8) | (C << 16) | (D << 24)); } - + public enum SDL_bool { SDL_FALSE = 0, SDL_TRUE = 1 } - + #endregion - + #region SDL_rwops.h - + /* Note about SDL2# and RWops: * These functions are currently not supported for public use. * They are only meant to be used internally in functions marked with * the phrase "THIS IS AN RWops FUNCTION!" */ - + /// - /// Use this function to create a new SDL_RWops structure for reading from and/or writing to a named file. + /// Use this function to create a new SDL_RWops structure for reading from and/or writing to a named file. /// /// a UTF-8 string representing the filename to open /// an ASCII string representing the mode to be used for opening the file; see Remarks for details @@ -83,7 +83,7 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string mode ); - + #endregion #region SDL_main.h @@ -95,9 +95,9 @@ namespace SDL2 public static extern void SDL_SetMainReady(); #endregion - + #region SDL.h - + public const uint SDL_INIT_TIMER = 0x00000001; public const uint SDL_INIT_AUDIO = 0x00000010; public const uint SDL_INIT_VIDEO = 0x00000020; @@ -110,75 +110,75 @@ namespace SDL2 SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER ); - + /// - /// Use this function to initialize the SDL library. - /// This must be called before using any other SDL function. + /// Use this function to initialize the SDL library. + /// This must be called before using any other SDL function. /// /// subsystem initialization flags; see Remarks for details - /// Returns 0 on success or a negative error code on failure. + /// Returns 0 on success or a negative error code on failure. /// Call for more information. - /// The Event Handling, File I/O, and Threading subsystems are initialized by default. + /// The Event Handling, File I/O, and Threading subsystems are initialized by default. /// You must specifically initialize other subsystems if you use them in your application. - /// Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup signal handlers + /// Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup signal handlers /// for some commonly ignored fatal signals (like SIGSEGV). [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_Init(uint flags); - + /// - /// Use this function to initialize specific SDL subsystems. + /// Use this function to initialize specific SDL subsystems. /// /// any of the flags used by SDL_Init(); see Remarks for details - /// Returns 0 on success or a negative error code on failure. + /// Returns 0 on success or a negative error code on failure. /// Call for more information. - /// After SDL has been initialized with you may initialize + /// After SDL has been initialized with you may initialize /// uninitialized subsystems with . - /// If you want to initialize subsystems separately you would call + /// If you want to initialize subsystems separately you would call /// followed by with the desired subsystem flag. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_InitSubSystem(uint flags); - + /// - /// Use this function to clean up all initialized subsystems. - /// You should call it upon all exit conditions. + /// Use this function to clean up all initialized subsystems. + /// You should call it upon all exit conditions. /// - /// You should call this function even if you have already shutdown each initialized + /// You should call this function even if you have already shutdown each initialized /// subsystem with . - /// If you start a subsystem using a call to that subsystem's init function (for example - /// ) instead of or , - /// then you must use that subsystem's quit function () to shut it down + /// If you start a subsystem using a call to that subsystem's init function (for example + /// ) instead of or , + /// then you must use that subsystem's quit function () to shut it down /// before calling . - /// You can use this function with atexit() to ensure that it is run when your application is + /// You can use this function with atexit() to ensure that it is run when your application is /// shutdown, but it is not wise to do this from a library or other dynamically loaded code. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_Quit(); - + /// - /// Use this function to shut down specific SDL subsystems. + /// Use this function to shut down specific SDL subsystems. /// /// any of the flags used by ; see Remarks for details - /// If you start a subsystem using a call to that subsystem's init function (for example - /// ) instead of or , - /// then you must use that subsystem's quit function () to shut it down + /// If you start a subsystem using a call to that subsystem's init function (for example + /// ) instead of or , + /// then you must use that subsystem's quit function () to shut it down /// before calling . /// You can use this function with atexit() to en /// You still need to call even if you close all open subsystems with SDL_QuitSubSystem(). [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_QuitSubSystem(uint flags); - + /// - /// Use this function to return a mask of the specified subsystems which have previously been initialized. + /// Use this function to return a mask of the specified subsystems which have previously been initialized. /// /// any of the flags used by ; see Remarks for details - /// If flags is 0 it returns a mask of all initialized subsystems, otherwise it returns the + /// If flags is 0 it returns a mask of all initialized subsystems, otherwise it returns the /// initialization status of the specified subsystems. The return value does not include SDL_INIT_NOPARACHUTE. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_WasInit(uint flags); - + #endregion - + #region SDL_hints.h - + public const string SDL_HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"; public const string SDL_HINT_RENDER_DRIVER = @@ -209,25 +209,25 @@ namespace SDL2 "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"; public const string SDL_HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"; - + public enum SDL_HintPriority { SDL_HINT_DEFAULT, SDL_HINT_NORMAL, SDL_HINT_OVERRIDE } - + /// - /// Use this function to clear all hints. + /// Use this function to clear all hints. /// /// This function is automatically called during . [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_ClearHints(); - + /// - /// Use this function to get the value of a hint. + /// Use this function to get the value of a hint. /// - /// the hint to query; see the list of hints on + /// the hint to query; see the list of hints on /// CategoryHints for details /// Returns the string value of a hint or NULL if the hint isn't set. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] @@ -238,14 +238,14 @@ namespace SDL2 ); /// - /// Use this function to set a hint with normal priority. + /// Use this function to set a hint with normal priority. /// - /// the hint to query; see the list of hints on + /// the hint to query; see the list of hints on /// CategoryHints for details /// the value of the hint variable /// Returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. - /// Hints will not be set if there is an existing override hint or environment - /// variable that takes precedence. You can use to set the hint with + /// Hints will not be set if there is an existing override hint or environment + /// variable that takes precedence. You can use to set the hint with /// override priority instead. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_SetHint( @@ -254,17 +254,17 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string value ); - + /// - /// Use this function to set a hint with a specific priority. + /// Use this function to set a hint with a specific priority. /// - /// the hint to query; see the list of hints on + /// the hint to query; see the list of hints on /// CategoryHints for details /// the value of the hint variable /// the level for the hint /// Returns SDL_TRUE if the hint was set, SDL_FALSE otherwise. - /// The priority controls the behavior when setting a hint that already has a value. - /// Hints will replace existing hints of their priority and lower. Environment variables are + /// The priority controls the behavior when setting a hint that already has a value. + /// Hints will replace existing hints of their priority and lower. Environment variables are /// considered to have override priority. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_SetHintWithPriority( @@ -274,25 +274,25 @@ namespace SDL2 string value, SDL_HintPriority priority ); - + #endregion - + #region SDL_error.h - + /// - /// Use this function to clear any previous error message. + /// Use this function to clear any previous error message. /// [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_ClearError(); - + /// - /// Use this function to retrieve a message about the last error that occurred. + /// Use this function to retrieve a message about the last error that occurred. /// - /// Returns a message with information about the specific error that occurred, + /// Returns a message with information about the specific error that occurred, /// or an empty string if there hasn't been an error since the last call to . - /// Without calling , the message is only applicable when an SDL function - /// has signaled an error. You must check the return values of SDL function calls to determine - /// when to appropriately call . + /// Without calling , the message is only applicable when an SDL function + /// has signaled an error. You must check the return values of SDL function calls to determine + /// when to appropriately call . /// This string is statically allocated and must not be freed by the application. /// It is possible for multiple errors to occur before calling SDL_GetError(). Only the last error is returned. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] @@ -300,7 +300,7 @@ namespace SDL2 public static extern string SDL_GetError(); /// - /// Use this function to set the SDL error string. + /// Use this function to set the SDL error string. /// /// a printf() style message format string /// additional parameters matching % tokens in the fmt string, if any @@ -311,11 +311,11 @@ namespace SDL2 string fmt, __arglist ); - + #endregion - + #region SDL_log.h - + /* Begin nameless enum SDL_LOG_CATEGORY */ public const int SDL_LOG_CATEGORY_APPLICATION = 0; public const int SDL_LOG_CATEGORY_ERROR = 1; @@ -326,7 +326,7 @@ namespace SDL2 public const int SDL_LOG_CATEGORY_RENDER = 6; public const int SDL_LOG_CATEGORY_INPUT = 7; public const int SDL_LOG_CATEGORY_TEST = 8; - + /* Reserved for future SDL library use */ public const int SDL_LOG_CATEGORY_RESERVED1 = 9; public const int SDL_LOG_CATEGORY_RESERVED2 = 10; @@ -338,7 +338,7 @@ namespace SDL2 public const int SDL_LOG_CATEGORY_RESERVED8 = 16; public const int SDL_LOG_CATEGORY_RESERVED9 = 17; public const int SDL_LOG_CATEGORY_RESERVED10 = 18; - + /* Beyond this point is reserved for application use, e.g. enum { LOG_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, @@ -349,9 +349,9 @@ namespace SDL2 */ public const int SDL_LOG_CATEGORY_CUSTOM = 19; /* End nameless enum SDL_LOG_CATEGORY */ - + /// - /// An enumeration of the predefined log priorities. + /// An enumeration of the predefined log priorities. /// public enum SDL_LogPriority { @@ -363,7 +363,7 @@ namespace SDL2 SDL_LOG_PRIORITY_CRITICAL, SDL_NUM_LOG_PRIORITIES } - + /// /// Used as a callback for and /// @@ -380,9 +380,9 @@ namespace SDL2 SDL_LogPriority priority, IntPtr message // const char* ); - + /// - /// Use this function to log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. + /// Use this function to log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO. /// /// a printf() style message format string /// additional parameters matching % tokens in the fmt string, if any @@ -392,9 +392,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_VERBOSE. + /// Use this function to log a message with SDL_LOG_PRIORITY_VERBOSE. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -407,9 +407,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_DEBUG. + /// Use this function to log a message with SDL_LOG_PRIORITY_DEBUG. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -422,9 +422,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_INFO. + /// Use this function to log a message with SDL_LOG_PRIORITY_INFO. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -437,9 +437,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_WARN. + /// Use this function to log a message with SDL_LOG_PRIORITY_WARN. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -452,9 +452,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_ERROR. + /// Use this function to log a message with SDL_LOG_PRIORITY_ERROR. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -467,9 +467,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with SDL_LOG_PRIORITY_CRITICAL. + /// Use this function to log a message with SDL_LOG_PRIORITY_CRITICAL. /// /// the category of the message; see Remarks for details /// a printf() style message format string @@ -482,9 +482,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with the specified category and priority. + /// Use this function to log a message with the specified category and priority. /// /// the category of the message; see Remarks for details /// the priority of the message; see Remarks for details @@ -500,10 +500,10 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to log a message with the specified category and priority. - /// This version of uses a stdarg variadic argument list. + /// Use this function to log a message with the specified category and priority. + /// This version of uses a stdarg variadic argument list. /// /// the category of the message; see Remarks for details /// the priority of the message; see Remarks for details @@ -517,9 +517,9 @@ namespace SDL2 string fmt, __arglist ); - + /// - /// Use this function to get the priority of a particular log category. + /// Use this function to get the priority of a particular log category. /// /// the category to query; see Remarks for details /// Returns the for the requested category; see Remarks for details. @@ -529,9 +529,9 @@ namespace SDL2 public static extern SDL_LogPriority SDL_LogGetPriority( int category ); - + /// - /// Use this function to set the priority of a particular log category. + /// Use this function to set the priority of a particular log category. /// /// the category to query; see Remarks for details /// the of the message; see Remarks for details @@ -542,9 +542,9 @@ namespace SDL2 int category, SDL_LogPriority priority ); - + /// - /// Use this function to set the priority of all log categories. + /// Use this function to set the priority of all log categories. /// /// the of the message; see Remarks for details /// The priority can be one of SDL_LOG_PRIORITY* @@ -552,16 +552,16 @@ namespace SDL2 public static extern void SDL_LogSetAllPriority( SDL_LogPriority priority ); - + /// - /// Use this function to reset all priorities to default. + /// Use this function to reset all priorities to default. /// /// This is called in . [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_LogResetPriorities(); - + /// - /// Use this function to get the current log output function. + /// Use this function to get the current log output function. /// /// a pointer filled in with the current log callback; see Remarks for details /// a pointer filled in with the pointer that is passed to callback (refers to void*) @@ -570,10 +570,10 @@ namespace SDL2 out SDL_LogOutputFunction callback, out IntPtr userdata ); - + /* userdata refers to a void* */ /// - /// Use this function to replace the default log output function with one of your own. + /// Use this function to replace the default log output function with one of your own. /// /// the function to call instead of the default; see Remarks for details /// a pointer that is passed to callback (refers to void*) @@ -582,9 +582,9 @@ namespace SDL2 SDL_LogOutputFunction callback, IntPtr userdata ); - + #endregion - + #region SDL_messagebox.h [Flags] @@ -666,7 +666,7 @@ namespace SDL2 } /// - /// + /// /// /// /// @@ -675,7 +675,7 @@ namespace SDL2 private static extern int INTERNAL_SDL_ShowMessageBox([In()] ref INTERNAL_SDL_MessageBoxData messageboxdata, out int buttonid); /// - /// + /// /// /// /// @@ -729,7 +729,7 @@ namespace SDL2 } /// - /// Use this function to display a simple message box. + /// Use this function to display a simple message box. /// /// An ; see Remarks for details; /// UTF-8 title text @@ -749,7 +749,7 @@ namespace SDL2 #endregion #region SDL_version.h, SDL_revision.h - + /* Similar to the headers, this is the version we're expecting to be * running with. You will likely want to check this somewhere in your * program! @@ -757,15 +757,15 @@ namespace SDL2 public const int SDL_MAJOR_VERSION = 2; public const int SDL_MINOR_VERSION = 0; public const int SDL_PATCHLEVEL = 0; - + public static readonly int SDL_COMPILEDVERSION = SDL_VERSIONNUM( SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL ); - + /// - /// A structure that contains information about the version of SDL in use. + /// A structure that contains information about the version of SDL in use. /// /// Represents the library's version as three levels: /// major revision (increments with massive changes, additions, and enhancements) @@ -779,9 +779,9 @@ namespace SDL2 public byte minor; public byte patch; } - + /// - /// Use this macro to determine the SDL version your program was compiled against. + /// Use this macro to determine the SDL version your program was compiled against. /// /// an structure to initialize public static void SDL_VERSION(out SDL_version x) @@ -790,9 +790,9 @@ namespace SDL2 x.minor = SDL_MINOR_VERSION; x.patch = SDL_PATCHLEVEL; } - + /// - /// Use this macro to convert separate version components into a single numeric value. + /// Use this macro to convert separate version components into a single numeric value. /// /// major version; reported in thousands place /// minor version; reported in hundreds place @@ -804,9 +804,9 @@ namespace SDL2 { return (X * 1000) + (Y * 100) + Z; } - + /// - /// Use this macro to determine whether the SDL version compiled against is at least as new as the specified version. + /// Use this macro to determine whether the SDL version compiled against is at least as new as the specified version. /// /// major version /// minor version @@ -816,44 +816,44 @@ namespace SDL2 { return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)); } - + /// - /// Use this function to get the version of SDL that is linked against your program. + /// Use this function to get the version of SDL that is linked against your program. /// /// the structure that contains the version information /// This function may be called safely at any time, even before SDL_Init(). [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] private static extern void SDL_GetVersion(out SDL_version ver); - + /// - /// Use this function to get the code revision of SDL that is linked against your program. + /// Use this function to get the code revision of SDL that is linked against your program. /// - /// Returns an arbitrary string, uniquely identifying the exact revision + /// Returns an arbitrary string, uniquely identifying the exact revision /// of the SDL library in use. - /// The revision is a string including sequential revision number that is + /// The revision is a string including sequential revision number that is /// incremented with each commit, and a hash of the last code change. /// Example: hg-5344:94189aa89b54 - /// This value is the revision of the code you are linked with and may be + /// This value is the revision of the code you are linked with and may be /// different from the code you are compiling with, which is found in the constant SDL_REVISION. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetRevision(); /// - /// Use this function to get the revision number of SDL that is linked against your program. + /// Use this function to get the revision number of SDL that is linked against your program. /// /// Returns a number uniquely identifying the exact revision of the SDL library in use. /// This is an incrementing number based on commits to hg.libsdl.org. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetRevisionNumber(); - + #endregion - + #region SDL_video.h - + /* Actually, this is from SDL_blendmode.h */ /// - /// An enumeration of blend modes used in SDL_RenderCopy() and drawing operations. + /// An enumeration of blend modes used in SDL_RenderCopy() and drawing operations. /// [Flags] public enum SDL_BlendMode @@ -863,9 +863,9 @@ namespace SDL2 SDL_BLENDMODE_ADD = 0x00000002, SDL_BLENDMODE_MOD = 0x00000004 } - + /// - /// An enumeration of OpenGL configuration attributes. + /// An enumeration of OpenGL configuration attributes. /// public enum SDL_GLattr { @@ -895,7 +895,7 @@ namespace SDL2 } /// - /// An enumeration of OpenGL profiles. + /// An enumeration of OpenGL profiles. /// [Flags] public enum SDL_GLprofile @@ -907,7 +907,7 @@ namespace SDL2 /// /// This enumeration is used in conjunction with SDL_GL_SetAttribute - /// and SDL_GL_CONTEXT_FLAGS. Multiple flags can be OR'd together. + /// and SDL_GL_CONTEXT_FLAGS. Multiple flags can be OR'd together. /// [Flags] public enum SDL_GLcontext @@ -919,7 +919,7 @@ namespace SDL2 } /// - /// An enumeration of window events. + /// An enumeration of window events. /// public enum SDL_WindowEventID : byte { @@ -939,9 +939,9 @@ namespace SDL2 SDL_WINDOWEVENT_FOCUS_LOST, SDL_WINDOWEVENT_CLOSE, } - + /// - /// An enumeration of window states. + /// An enumeration of window states. /// [Flags] public enum SDL_WindowFlags @@ -961,34 +961,34 @@ namespace SDL2 (SDL_WINDOW_FULLSCREEN | 0x00001000), SDL_WINDOW_FOREIGN = 0x00000800, } - + public const int SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000; public const int SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000; public const int SDL_WINDOWPOS_UNDEFINED = 0x1FFF0000; public const int SDL_WINDOWPOS_CENTERED = 0x2FFF0000; - + public static int SDL_WINDOWPOS_UNDEFINED_DISPLAY(int X) { return (SDL_WINDOWPOS_UNDEFINED_MASK | X); } - + public static bool SDL_WINDOWPOS_ISUNDEFINED(int X) { return (X & 0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK; } - + public static int SDL_WINDOWPOS_CENTERED_DISPLAY(int X) { return (SDL_WINDOWPOS_CENTERED_MASK | X); } - + public static bool SDL_WINDOWPOS_ISCENTERED(int X) { return (X & 0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK; } - + /// - /// A structure that describes a display mode. + /// A structure that describes a display mode. /// [StructLayout(LayoutKind.Sequential)] public struct SDL_DisplayMode @@ -999,18 +999,18 @@ namespace SDL2 public int refresh_rate; public IntPtr driverdata; // void* } - + /// - /// Use this function to create a window with the specified position, dimensions, and flags. + /// Use this function to create a window with the specified position, dimensions, and flags. /// /// the title of the window, in UTF-8 encoding /// the x position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED /// the y position of the window, SDL_WINDOWPOS_CENTERED, or SDL_WINDOWPOS_UNDEFINED /// the width of the window /// the height of the window - /// 0, or one or more OR'd together; + /// 0, or one or more OR'd together; /// see Remarks for details - /// Returns the window that was created or NULL on failure; call + /// Returns the window that was created or NULL on failure; call /// for more information. (refers to an ) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateWindow( @@ -1022,9 +1022,9 @@ namespace SDL2 int h, SDL_WindowFlags flags ); - + /// - /// Use this function to create a window and default renderer. + /// Use this function to create a window and default renderer. /// /// The width of the window /// The height of the window @@ -1040,51 +1040,51 @@ namespace SDL2 out IntPtr window, out IntPtr renderer ); - + /// - /// Use this function to create an SDL window from an existing native window. + /// Use this function to create an SDL window from an existing native window. /// /// a pointer to driver-dependent window creation data, typically your native window cast to a void* - /// Returns the window () that was created or NULL on failure; + /// Returns the window () that was created or NULL on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateWindowFrom(IntPtr data); - + /// - /// Use this function to destroy a window. + /// Use this function to destroy a window. /// /// the window to destroy () [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_DestroyWindow(IntPtr window); - + /// - /// Use this function to prevent the screen from being blanked by a screen saver. + /// Use this function to prevent the screen from being blanked by a screen saver. /// /// If you disable the screensaver, it is automatically re-enabled when SDL quits. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_DisableScreenSaver(); - + /// - /// Use this function to allow the screen to be blanked by a screen saver. + /// Use this function to allow the screen to be blanked by a screen saver. /// [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_EnableScreenSaver(); - + /* IntPtr refers to an SDL_DisplayMode. Just use closest. */ /// - /// Use this function to get the closest match to the requested display mode. + /// Use this function to get the closest match to the requested display mode. /// /// the index of the display to query /// an structure containing the desired display mode - /// an structure filled in with + /// an structure filled in with /// the closest match of the available display modes /// Returns the passed in value closest or NULL if no matching video mode was available; /// (refers to a ) /// call for more information. - /// The available display modes are scanned and closest is filled in with the closest mode - /// matching the requested mode and returned. The mode format and refresh rate default to the desktop - /// mode if they are set to 0. The modes are scanned with size being first priority, format being - /// second priority, and finally checking the refresh rate. If all the available modes are too small, + /// The available display modes are scanned and closest is filled in with the closest mode + /// matching the requested mode and returned. The mode format and refresh rate default to the desktop + /// mode if they are set to 0. The modes are scanned with size being first priority, format being + /// second priority, and finally checking the refresh rate. If all the available modes are too small, /// then NULL is returned. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GetClosestDisplayMode( @@ -1092,52 +1092,52 @@ namespace SDL2 ref SDL_DisplayMode mode, out SDL_DisplayMode closest ); - + /// - /// Use this function to get information about the current display mode. + /// Use this function to get information about the current display mode. /// /// the index of the display to query /// an structure filled in with the current display mode - /// Returns 0 on success or a negative error code on failure; + /// Returns 0 on success or a negative error code on failure; /// call for more information. - /// There's a difference between this function and when SDL - /// runs fullscreen and has changed the resolution. In that case this function will return the + /// There's a difference between this function and when SDL + /// runs fullscreen and has changed the resolution. In that case this function will return the /// current display mode, and not the previous native display mode. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetCurrentDisplayMode( int displayIndex, out SDL_DisplayMode mode ); - + /// - /// Use this function to return the name of the currently initialized video driver. + /// Use this function to return the name of the currently initialized video driver. /// /// Returns the name of the current video driver or NULL if no driver has been initialized. - /// There's a difference between this function and when SDL - /// runs fullscreen and has changed the resolution. In that case this function will return the + /// There's a difference between this function and when SDL + /// runs fullscreen and has changed the resolution. In that case this function will return the /// previous native display mode, and not the current display mode. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetCurrentVideoDriver(); /// - /// Use this function to get information about the desktop display mode. + /// Use this function to get information about the desktop display mode. /// /// the index of the display to query /// an structure filled in with the current display mode - /// Returns 0 on success or a negative error code on failure; + /// Returns 0 on success or a negative error code on failure; /// call for more information. - /// There's a difference between this function and when SDL - /// runs fullscreen and has changed the resolution. In that case this function will return the + /// There's a difference between this function and when SDL + /// runs fullscreen and has changed the resolution. In that case this function will return the /// previous native display mode, and not the current display mode. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetDesktopDisplayMode( int displayIndex, out SDL_DisplayMode mode ); - + /// - /// Use this function to get the desktop area represented by a display, with the primary display located at 0,0. + /// Use this function to get the desktop area represented by a display, with the primary display located at 0,0. /// /// the index of the display to query /// the structure filled in with the display bounds @@ -1148,14 +1148,14 @@ namespace SDL2 int displayIndex, out SDL_Rect rect ); - + /// - /// Use this function to get information about a specific display mode. + /// Use this function to get information about a specific display mode. /// /// the index of the display to query /// the index of the display mode to query /// an structure filled in with the mode at modeIndex - /// Returns 0 on success or a negative error code on failure; + /// Returns 0 on success or a negative error code on failure; /// call for more information. /// The display modes are sorted in this priority: /// bits per pixel -> more colors to fewer colors @@ -1168,36 +1168,36 @@ namespace SDL2 int modeIndex, out SDL_DisplayMode mode ); - + /// - /// Use this function to return the number of available display modes. + /// Use this function to return the number of available display modes. /// /// the index of the display to query - /// Returns a number >= 1 on success or a negative error code on failure; + /// Returns a number >= 1 on success or a negative error code on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumDisplayModes( int displayIndex ); - + /// - /// Use this function to return the number of available video displays. + /// Use this function to return the number of available video displays. /// /// Returns a number >= 1 or a negative error code on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumVideoDisplays(); - + /// - /// Use this function to get the number of video drivers compiled into SDL. + /// Use this function to get the number of video drivers compiled into SDL. /// /// Returns a number >= 1 on success or a negative error code on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumVideoDrivers(); - + /// - /// Use this function to get the name of a built in video driver. + /// Use this function to get the name of a built in video driver. /// /// the index of a video driver /// Returns the name of the video driver with the given index. @@ -1209,7 +1209,7 @@ namespace SDL2 ); /// - /// Use this function to get the brightness (gamma correction) for a window. + /// Use this function to get the brightness (gamma correction) for a window. /// /// the window to query () /// Returns the brightness for the window where 0.0 is completely dark and 1.0 is normal brightness. @@ -1217,9 +1217,9 @@ namespace SDL2 public static extern float SDL_GetWindowBrightness( IntPtr window ); - + /// - /// Use this function to retrieve the data pointer associated with a window. + /// Use this function to retrieve the data pointer associated with a window. /// /// the window to query () /// the name of the pointer @@ -1230,49 +1230,49 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string name ); - + /// - /// Use this function to get the index of the display associated with a window. + /// Use this function to get the index of the display associated with a window. /// /// the window to query () - /// Returns the index of the display containing the center of the window - /// on success or a negative error code on failure; + /// Returns the index of the display containing the center of the window + /// on success or a negative error code on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetWindowDisplayIndex( IntPtr window ); - + /// - /// Use this function to fill in information about the display mode to use when a window is visible at fullscreen. + /// Use this function to fill in information about the display mode to use when a window is visible at fullscreen. /// /// the window to query () /// an structure filled in with the fullscreen display mode - /// Returns 0 on success or a negative error code on failure; + /// Returns 0 on success or a negative error code on failure; /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetWindowDisplayMode( IntPtr window, out SDL_DisplayMode mode ); - + /// - /// Use this function to get the window flags. + /// Use this function to get the window flags. /// /// the window to query () /// Returns a mask of the associated with window; see Remarks for details. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_GetWindowFlags(IntPtr window); - + /// - /// Use this function to get a window from a stored ID. + /// Use this function to get a window from a stored ID. /// /// the ID of the window /// Returns the window associated with id or NULL if it doesn't exist (); /// call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GetWindowFromID(uint id); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetWindowGammaRamp( @@ -1284,21 +1284,21 @@ namespace SDL2 [Out()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)] ushort[] blue ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_GetWindowGrab(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_GetWindowID(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_GetWindowPixelFormat( IntPtr window ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GetWindowPosition( @@ -1306,7 +1306,7 @@ namespace SDL2 out int x, out int y ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GetWindowSize( @@ -1314,11 +1314,11 @@ namespace SDL2 out int w, out int h ); - + /* IntPtr refers to an SDL_Surface*, window to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GetWindowSurface(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -1333,91 +1333,91 @@ namespace SDL2 out float texw, out float texh ); - + /* IntPtr and window refer to an SDL_GLContext and SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GL_CreateContext(IntPtr window); - + /* context refers to an SDL_GLContext */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GL_DeleteContext(IntPtr context); - + /* IntPtr refers to a function pointer */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GL_GetProcAddress( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string proc ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_GL_ExtensionSupported( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string extension ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_GetAttribute( SDL_GLattr attr, out int value ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_GetSwapInterval(); - + /* window and context refer to an SDL_Window* and SDL_GLContext */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_MakeCurrent( IntPtr window, IntPtr context ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_SetAttribute( SDL_GLattr attr, int value ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_SetSwapInterval(int interval); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GL_SwapWindow(IntPtr window); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GL_UnbindTexture(IntPtr texture); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_HideWindow(IntPtr window); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_IsScreenSaverEnabled(); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_MaximizeWindow(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_MinimizeWindow(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_RaiseWindow(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_RestoreWindow(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetWindowBrightness( IntPtr window, float brightness ); - + /* IntPtr and userdata are void*, window is an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_SetWindowData( @@ -1426,21 +1426,21 @@ namespace SDL2 string name, IntPtr userdata ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetWindowDisplayMode( IntPtr window, ref SDL_DisplayMode mode ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetWindowFullscreen( IntPtr window, uint flags ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetWindowGammaRamp( @@ -1452,21 +1452,21 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)] ushort[] blue ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowGrab( IntPtr window, SDL_bool grabbed ); - + /* window refers to an SDL_Window*, icon to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowIcon( IntPtr window, IntPtr icon ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowPosition( @@ -1474,7 +1474,7 @@ namespace SDL2 int x, int y ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowSize( @@ -1482,14 +1482,14 @@ namespace SDL2 int w, int h ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowBordered( IntPtr window, SDL_bool bordered ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_SetWindowTitle( @@ -1497,15 +1497,15 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string title ); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_ShowWindow(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_UpdateWindowSurface(IntPtr window); - + /* window refers to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_UpdateWindowSurfaceRects( @@ -1514,20 +1514,20 @@ namespace SDL2 SDL_Rect[] rects, int numrects ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_VideoInit( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string driver_name ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_VideoQuit(); - + #endregion - + #region SDL_render.h - + [Flags] public enum SDL_RendererFlags { @@ -1536,7 +1536,7 @@ namespace SDL2 SDL_RENDERER_PRESENTVSYNC = 0x00000004, SDL_RENDERER_TARGETTEXTURE = 0x00000008 } - + [Flags] public enum SDL_RendererFlip { @@ -1544,14 +1544,14 @@ namespace SDL2 SDL_FLIP_HORIZONTAL = 0x00000001, SDL_FLIP_VERTICAL = 0x00000002 } - + public enum SDL_TextureAccess { SDL_TEXTUREACCESS_STATIC, SDL_TEXTUREACCESS_STREAMING, SDL_TEXTUREACCESS_TARGET } - + [Flags] public enum SDL_TextureModulate { @@ -1559,7 +1559,7 @@ namespace SDL2 SDL_TEXTUREMODULATE_HORIZONTAL = 0x00000001, SDL_TEXTUREMODULATE_VERTICAL = 0x00000002 } - + [StructLayout(LayoutKind.Sequential)] public unsafe struct SDL_RendererInfo { @@ -1570,7 +1570,7 @@ namespace SDL2 public int max_texture_width; public int max_texture_height; } - + /* IntPtr refers to an SDL_Renderer*, window to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateRenderer( @@ -1578,11 +1578,11 @@ namespace SDL2 int index, uint flags ); - + /* IntPtr refers to an SDL_Renderer*, surface to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateRenderer(IntPtr surface); - + /* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateTexture( @@ -1592,7 +1592,7 @@ namespace SDL2 int w, int h ); - + /* IntPtr refers to an SDL_Texture* * renderer refers to an SDL_Renderer* * surface refers to an SDL_Surface* @@ -1602,25 +1602,25 @@ namespace SDL2 IntPtr renderer, IntPtr surface ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_DestroyRenderer(IntPtr renderer); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_DestroyTexture(IntPtr texture); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumRenderDrivers(); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetRenderDrawBlendMode( IntPtr renderer, out SDL_BlendMode blendMode ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetRenderDrawColor( @@ -1630,38 +1630,38 @@ namespace SDL2 out byte b, out byte a ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetRenderDriverInfo( int index, out SDL_RendererInfo info ); - + /* IntPtr refers to an SDL_Renderer*, window to an SDL_Window* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GetRenderer(IntPtr window); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetRendererInfo( IntPtr renderer, out SDL_RendererInfo info ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetTextureAlphaMod( IntPtr texture, out byte alpha ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetTextureBlendMode( IntPtr texture, out SDL_BlendMode blendMode ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetTextureColorMod( @@ -1670,18 +1670,18 @@ namespace SDL2 out byte g, out byte b ); - + /// - /// Use this function to lock a portion of the texture for write-only pixel access. + /// Use this function to lock a portion of the texture for write-only pixel access. /// - /// the texture to lock for access, which was created with + /// the texture to lock for access, which was created with /// SDL_TEXTUREACCESS_STREAMING (refers to a SDL_Texture*) - /// an SDL_Rect structure representing the area to lock for access; + /// an SDL_Rect structure representing the area to lock for access; /// NULL to lock the entire texture - /// this is filled in with a pointer to the locked pixels, appropriately + /// this is filled in with a pointer to the locked pixels, appropriately /// offset by the locked area (refers to a void*) /// this is filled in with the pitch of the locked pixels - /// Returns 0 on success or a negative error code if the texture is not valid or + /// Returns 0 on success or a negative error code if the texture is not valid or /// was not created with SDL_TEXTUREACCESS_STREAMING; call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LockTexture( @@ -1695,14 +1695,14 @@ namespace SDL2 /// Use this function to lock a portion of the texture for write-only pixel access. This overload /// allows for passing an IntPtr.Zero (null) rect value to lock the entire texture. /// - /// the texture to lock for access, which was created with + /// the texture to lock for access, which was created with /// SDL_TEXTUREACCESS_STREAMING (refers to a SDL_Texture*) - /// an SDL_Rect structure representing the area to lock for access; + /// an SDL_Rect structure representing the area to lock for access; /// NULL to lock the entire texture - /// this is filled in with a pointer to the locked pixels, appropriately + /// this is filled in with a pointer to the locked pixels, appropriately /// offset by the locked area (refers to a void*) /// this is filled in with the pitch of the locked pixels - /// Returns 0 on success or a negative error code if the texture is not valid or + /// Returns 0 on success or a negative error code if the texture is not valid or /// was not created with SDL_TEXTUREACCESS_STREAMING; call for more information. [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LockTexture( @@ -1711,7 +1711,7 @@ namespace SDL2 out IntPtr pixels, out int pitch ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_QueryTexture( @@ -1721,7 +1721,7 @@ namespace SDL2 out int w, out int h ); - + /* texture refers to an SDL_Texture, pixels to a void* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_QueryTexturePixels( @@ -1729,11 +1729,11 @@ namespace SDL2 out IntPtr pixels, out int pitch ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderClear(IntPtr renderer); - + /* renderer refers to an SDL_Renderer*, texture to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderCopy( @@ -1793,7 +1793,7 @@ namespace SDL2 ref SDL_Point center, SDL_RendererFlip flip ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawLine( @@ -1803,7 +1803,7 @@ namespace SDL2 int x2, int y2 ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawLines( @@ -1812,7 +1812,7 @@ namespace SDL2 SDL_Point[] points, int count ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawPoint( @@ -1820,7 +1820,7 @@ namespace SDL2 int x, int y ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawPoints( @@ -1829,14 +1829,14 @@ namespace SDL2 SDL_Point[] points, int count ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawRect( IntPtr renderer, ref SDL_Rect rect ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawRects( @@ -1845,14 +1845,14 @@ namespace SDL2 SDL_Rect[] rects, int count ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderFillRect( IntPtr renderer, ref SDL_Rect rect ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderFillRects( @@ -1861,18 +1861,18 @@ namespace SDL2 SDL_Rect[] rects, int count ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderGetViewport( IntPtr renderer, out SDL_Rect rect ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_RenderPresent(IntPtr renderer); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderReadPixels( @@ -1882,21 +1882,21 @@ namespace SDL2 IntPtr pixels, int pitch ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderSetViewport( IntPtr renderer, ref SDL_Rect rect ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetRenderDrawBlendMode( IntPtr renderer, SDL_BlendMode blendMode ); - + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetRenderDrawColor( @@ -1906,28 +1906,28 @@ namespace SDL2 byte b, byte a ); - + /* renderer refers to an SDL_Renderer*, texture to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetRenderTarget( IntPtr renderer, IntPtr texture ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetTextureAlphaMod( IntPtr texture, byte alpha ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetTextureBlendMode( IntPtr texture, SDL_BlendMode blendMode ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetTextureColorMod( @@ -1936,11 +1936,11 @@ namespace SDL2 byte g, byte b ); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_UnlockTexture(IntPtr texture); - + /* texture refers to an SDL_Texture* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_UpdateTexture( @@ -1949,16 +1949,16 @@ namespace SDL2 IntPtr pixels, int pitch ); - + #endregion - + #region SDL_pixels.h - + public static uint SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D) { return SDL_FOURCC(A, B, C, D); } - + public static uint SDL_DEFINE_PIXELFORMAT( SDL_PIXELTYPE_ENUM type, SDL_PIXELORDER_ENUM order, @@ -1975,27 +1975,27 @@ namespace SDL2 (bytes) ); } - + public static byte SDL_PIXELFLAG(uint X) { return (byte) ((X >> 28) & 0x0F); } - + public static byte SDL_PIXELTYPE(uint X) { return (byte) ((X >> 24) & 0x0F); } - + public static byte SDL_PIXELORDER(uint X) { return (byte) ((X >> 20) & 0x0F); } - + public static byte SDL_BITSPERPIXEL(uint X) { return (byte) ((X << 16) & 0x0F); } - + public static byte SDL_BYTESPERPIXEL(uint X) { if (SDL_ISPIXELFORMAT_FOURCC(X)) @@ -2010,7 +2010,7 @@ namespace SDL2 } return (byte) (X & 0xFF); } - + public static bool SDL_ISPIXELFORMAT_INDEXED(uint format) { if (SDL_ISPIXELFORMAT_FOURCC(format)) @@ -2025,7 +2025,7 @@ namespace SDL2 pType == SDL_PIXELTYPE_ENUM.SDL_PIXELTYPE_INDEX8 ); } - + public static bool SDL_ISPIXELFORMAT_ALPHA(uint format) { if (SDL_ISPIXELFORMAT_FOURCC(format)) @@ -2041,12 +2041,12 @@ namespace SDL2 pOrder == SDL_PIXELORDER_ENUM.SDL_PACKEDORDER_BGRA ); } - + public static bool SDL_ISPIXELFORMAT_FOURCC(uint format) { return (format == 0) && (SDL_PIXELFLAG(format) != 1); } - + public enum SDL_PIXELTYPE_ENUM { SDL_PIXELTYPE_UNKNOWN, @@ -2062,7 +2062,7 @@ namespace SDL2 SDL_PIXELTYPE_ARRAYF16, SDL_PIXELTYPE_ARRAYF32 } - + public enum SDL_PIXELORDER_ENUM { /* BITMAPORDER */ @@ -2088,7 +2088,7 @@ namespace SDL2 SDL_ARRAYORDER_BGRA, SDL_ARRAYORDER_ABGR } - + public enum SDL_PACKEDLAYOUT_ENUM { SDL_PACKEDLAYOUT_NONE, @@ -2101,7 +2101,7 @@ namespace SDL2 SDL_PACKEDLAYOUT_2101010, SDL_PACKEDLAYOUT_1010102 } - + public static readonly uint SDL_PIXELFORMAT_UNKNOWN = 0; public static readonly uint SDL_PIXELFORMAT_INDEX1LSB = SDL_DEFINE_PIXELFORMAT( @@ -2333,7 +2333,7 @@ namespace SDL2 SDL_DEFINE_PIXELFOURCC( (byte) 'Y', (byte) 'V', (byte) 'Y', (byte) 'U' ); - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Color { @@ -2342,7 +2342,7 @@ namespace SDL2 public byte b; public byte a; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Palette { @@ -2351,7 +2351,7 @@ namespace SDL2 public int version; public int refcount; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_PixelFormat { @@ -2374,30 +2374,30 @@ namespace SDL2 public int refcount; public IntPtr next; // SDL_PixelFormat* } - + /* IntPtr refers to an SDL_PixelFormat* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_AllocFormat(uint pixel_format); - + /* IntPtr refers to an SDL_Palette* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_AllocPalette(int ncolors); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_CalculateGammaRamp( float gamma, [Out()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)] ushort[] ramp ); - + /* format refers to an SDL_PixelFormat* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_FreeFormat(IntPtr format); - + /* palette refers to an SDL_Palette* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_FreePalette(IntPtr palette); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetPixelFormatName( @@ -2413,7 +2413,7 @@ namespace SDL2 out byte g, out byte b ); - + /* format refers to an SDL_PixelFormat* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GetRGBA( @@ -2424,7 +2424,7 @@ namespace SDL2 out byte b, out byte a ); - + /* format refers to an SDL_PixelFormat* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_MapRGB( @@ -2433,7 +2433,7 @@ namespace SDL2 byte g, byte b ); - + /* format refers to an SDL_PixelFormat* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_MapRGBA( @@ -2443,7 +2443,7 @@ namespace SDL2 byte b, byte a ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_MasksToPixelFormatEnum( int bpp, @@ -2452,7 +2452,7 @@ namespace SDL2 uint Bmask, uint Amask ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_PixelFormatEnumToMasks( uint format, @@ -2462,7 +2462,7 @@ namespace SDL2 out uint Bmask, out uint Amask ); - + /* palette refers to an SDL_Palette* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetPaletteColors( @@ -2472,25 +2472,25 @@ namespace SDL2 int firstcolor, int ncolors ); - + /* format and palette refer to an SDL_PixelFormat* and SDL_Palette* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetPixelFormatPalette( IntPtr format, IntPtr palette ); - + #endregion - + #region SDL_rect.h - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Point { public int x; public int y; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Rect { @@ -2499,7 +2499,7 @@ namespace SDL2 public int w; public int h; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_EnclosePoints( [In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct, SizeParamIndex = 1)] @@ -2508,20 +2508,20 @@ namespace SDL2 ref SDL_Rect clip, out SDL_Rect result ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_HasIntersection( ref SDL_Rect A, ref SDL_Rect B ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_IntersectRect( ref SDL_Rect A, ref SDL_Rect B, out SDL_Rect result ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_IntersectRectAndLine( ref SDL_Rect rect, @@ -2530,32 +2530,32 @@ namespace SDL2 ref int X2, ref int Y2 ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_RectEmpty(ref SDL_Rect rect); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_RectEquals( ref SDL_Rect A, ref SDL_Rect B ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_UnionRect( ref SDL_Rect A, ref SDL_Rect B, out SDL_Rect result ); - + #endregion - + #region SDL_surface.h - + public const uint SDL_SWSURFACE = 0x00000000; public const uint SDL_PREALLOC = 0x00000001; public const uint SDL_RLEACCEL = 0x00000002; public const uint SDL_DONTFREE = 0x00000004; - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Surface { @@ -2572,7 +2572,7 @@ namespace SDL2 public IntPtr map; // SDL_BlitMap* public int refcount; } - + /* surface refers to an SDL_Surface* */ public static bool SDL_MUSTLOCK(IntPtr surface) { @@ -2583,7 +2583,7 @@ namespace SDL2 ); return (sur.flags & SDL_RLEACCEL) != 0; } - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_BlitSurface( @@ -2592,7 +2592,7 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + /* src and dst are void* pointers */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_ConvertPixels( @@ -2605,7 +2605,7 @@ namespace SDL2 IntPtr dst, int dst_pitch ); - + /* IntPtr refers to an SDL_Surface* * src refers to an SDL_Surface* * fmt refers to an SDL_PixelFormat* @@ -2616,7 +2616,7 @@ namespace SDL2 IntPtr fmt, uint flags ); - + /* IntPtr refers to an SDL_Surface*, src to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_ConvertSurfaceFormat( @@ -2624,7 +2624,7 @@ namespace SDL2 uint pixel_format, uint flags ); - + /* IntPtr refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateRGBSurface( @@ -2637,7 +2637,7 @@ namespace SDL2 uint Bmask, uint Amask ); - + /* IntPtr refers to an SDL_Surface*, pixels to a void* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_CreateRGBSurfaceFrom( @@ -2651,7 +2651,7 @@ namespace SDL2 uint Bmask, uint Amask ); - + /* dst refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_FillRect( @@ -2659,7 +2659,7 @@ namespace SDL2 ref SDL_Rect rect, uint color ); - + /* dst refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_FillRects( @@ -2669,39 +2669,39 @@ namespace SDL2 int count, uint color ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_FreeSurface(IntPtr surface); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GetClipRect( IntPtr surface, out SDL_Rect rect ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetColorKey( IntPtr surface, out uint key ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetSurfaceAlphaMod( IntPtr surface, out byte alpha ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetSurfaceBlendMode( IntPtr surface, out SDL_BlendMode blendMode ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetSurfaceColorMod( @@ -2724,11 +2724,11 @@ namespace SDL2 IntPtr rwops = INTERNAL_SDL_RWFromFile(file, "rb"); return INTERNAL_SDL_LoadBMP_RW(rwops, 1); } - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LockSurface(IntPtr surface); - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LowerBlit( @@ -2737,7 +2737,7 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LowerBlitScaled( @@ -2746,7 +2746,7 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + /* These are for SDL_SaveBMP, which is a macro in the SDL headers. */ /* IntPtr refers to an SDL_Surface* */ /* THIS IS AN RWops FUNCTION! */ @@ -2761,14 +2761,14 @@ namespace SDL2 IntPtr rwops = INTERNAL_SDL_RWFromFile(file, "wb"); return INTERNAL_SDL_SaveBMP_RW(surface, rwops, 1); } - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_SetClipRect( IntPtr surface, ref SDL_Rect rect ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetColorKey( @@ -2776,21 +2776,21 @@ namespace SDL2 int flag, uint key ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetSurfaceAlphaMod( IntPtr surface, byte alpha ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetSurfaceBlendMode( IntPtr surface, SDL_BlendMode blendMode ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetSurfaceColorMod( @@ -2799,21 +2799,21 @@ namespace SDL2 byte g, byte b ); - + /* surface refers to an SDL_Surface*, palette to an SDL_Palette* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetSurfacePalette( IntPtr surface, IntPtr palette ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SetSurfaceRLE( IntPtr surface, int flag ); - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_SoftStretch( @@ -2822,11 +2822,11 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + /* surface refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_UnlockSurface(IntPtr surface); - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_UpperBlit( @@ -2835,7 +2835,7 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + /* src and dst refer to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_UpperBlitScaled( @@ -2844,14 +2844,14 @@ namespace SDL2 IntPtr dst, ref SDL_Rect dstrect ); - + #endregion - + #region SDL_clipboard.h - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_HasClipboardText(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetClipboardText(); @@ -2861,7 +2861,7 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string text ); - + #endregion #region SDL_events.h @@ -2885,7 +2885,7 @@ namespace SDL2 /* Window events */ SDL_WINDOWEVENT = 0x200, SDL_SYSWMEVENT, - + /* Keyboard events */ SDL_KEYDOWN = 0x300, SDL_KEYUP, @@ -3370,7 +3370,7 @@ namespace SDL2 */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_WaitEventTimeout(out SDL_Event _event, int timeout); - + /* Add an event to the event queue */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_PushEvent(ref SDL_Event _event); @@ -3430,14 +3430,14 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern UInt32 SDL_RegisterEvents(int numevents); #endregion - + #region SDL_scancode.h /* Scancodes based off USB keyboard page (0x07) */ public enum SDL_Scancode { SDL_SCANCODE_UNKNOWN = 0, - + SDL_SCANCODE_A = 4, SDL_SCANCODE_B = 5, SDL_SCANCODE_C = 6, @@ -3668,8 +3668,8 @@ namespace SDL2 SDL_SCANCODE_RGUI = 231, SDL_SCANCODE_MODE = 257, - - /* These come from the USB consumer page (0x0C) */ + + /* These come from the USB consumer page (0x0C) */ SDL_SCANCODE_AUDIONEXT = 258, SDL_SCANCODE_AUDIOPREV = 259, SDL_SCANCODE_AUDIOSTOP = 260, @@ -3714,7 +3714,7 @@ namespace SDL2 { return (SDL_Keycode)((int)X | SDLK_SCANCODE_MASK); } - + /* So, in the C headers, SDL_Keycode is a typedef of Sint32 * and all of the names are in an anonymous enum. Yeah... * that's not going to cut it for C#. We'll just put them in an @@ -3760,7 +3760,7 @@ namespace SDL2 SDLK_GREATER = '>', SDLK_QUESTION = '?', SDLK_AT = '@', - /* + /* Skip uppercase letters */ SDLK_LEFTBRACKET = '[', @@ -4014,7 +4014,7 @@ namespace SDL2 #endregion #region SDL_keyboard.h - + [StructLayout(LayoutKind.Sequential)] public struct SDL_Keysym { @@ -4052,7 +4052,7 @@ namespace SDL2 /* Get the scancode for the given keycode */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GetScancodeFromKey(SDL_Keycode key); - + /* Wrapper for SDL_GetScancodeName */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -4063,7 +4063,7 @@ namespace SDL2 public static extern SDL_Scancode SDL_GetScancodeFromName( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string name ); - + /* Wrapper for SDL_GetKeyName */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -4074,7 +4074,7 @@ namespace SDL2 public static extern SDL_Keycode SDL_GetKeyFromName( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string name ); - + /* Start accepting Unicode text input events, show keyboard */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_StartTextInput(); @@ -4099,9 +4099,9 @@ namespace SDL2 /* window is an SDL_Window pointer */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_IsScreenKeyboardShown(IntPtr window); - + #endregion - + #region SDL_mouse.c /* Note: SDL_Cursor is a typedef normally. We'll treat it as @@ -4217,9 +4217,9 @@ namespace SDL2 public static readonly UInt32 SDL_BUTTON_X2MASK = SDL_BUTTON(SDL_BUTTON_X2); #endregion - + #region SDL_joystick.h - + public const byte SDL_HAT_CENTERED = 0x00; public const byte SDL_HAT_UP = 0x01; public const byte SDL_HAT_RIGHT = 0x02; @@ -4229,27 +4229,27 @@ namespace SDL2 public const byte SDL_HAT_RIGHTDOWN = SDL_HAT_RIGHT | SDL_HAT_DOWN; public const byte SDL_HAT_LEFTUP = SDL_HAT_LEFT | SDL_HAT_UP; public const byte SDL_HAT_LEFTDOWN = SDL_HAT_LEFT | SDL_HAT_DOWN; - + [StructLayout(LayoutKind.Sequential)] public unsafe struct SDL_JoystickGUID { public fixed byte data[16]; } - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_JoystickClose(IntPtr joystick); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickEventState(int state); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern short SDL_JoystickGetAxis( IntPtr joystick, int axis ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickGetBall( @@ -4258,25 +4258,25 @@ namespace SDL2 out int dx, out int dy ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte SDL_JoystickGetButton( IntPtr joystick, int button ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte SDL_JoystickGetHat( IntPtr joystick, int hat ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickIndex(IntPtr joystick); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -4293,46 +4293,46 @@ namespace SDL2 /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickNumAxes(IntPtr joystick); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickNumBalls(IntPtr joystick); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickNumButtons(IntPtr joystick); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickNumHats(IntPtr joystick); - + /* IntPtr refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_JoystickOpen(int device_index); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickOpened(int device_index); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_JoystickUpdate(); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_NumJoysticks(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_JoystickGUID SDL_JoystickGetDeviceGUID( int device_index ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_JoystickGUID SDL_JoystickGetGUID( IntPtr joystick ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_JoystickGetGUIDString( SDL_JoystickGUID guid, @@ -4340,25 +4340,25 @@ namespace SDL2 System.Text.StringBuilder pszGUID, int cbGUID ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_JoystickGUID SDL_JoystickGetGUIDFromString( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string pchGUID ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_JoystickGetAttached(IntPtr joystick); - + /* int refers to an SDL_JoystickID, joystick to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickInstanceID(IntPtr joystick); - + #endregion - + #region SDL_gamecontroller.h - + public enum SDL_GameControllerBindType { SDL_CONTROLLER_BINDTYPE_NONE, @@ -4366,7 +4366,7 @@ namespace SDL2 SDL_CONTROLLER_BINDTYPE_AXIS, SDL_CONTROLLER_BINDTYPE_HAT } - + public enum SDL_GameControllerAxis { SDL_CONTROLLER_AXIS_INVALID = -1, @@ -4378,7 +4378,7 @@ namespace SDL2 SDL_CONTROLLER_AXIS_TRIGGERRIGHT, SDL_CONTROLLER_AXIS_MAX } - + public enum SDL_GameControllerButton { SDL_CONTROLLER_BUTTON_INVALID = -1, @@ -4399,7 +4399,7 @@ namespace SDL2 SDL_CONTROLLER_BUTTON_DPAD_RIGHT, SDL_CONTROLLER_BUTTON_MAX, } - + // FIXME: I'd rather this somehow be private... [StructLayout(LayoutKind.Sequential)] public struct INTERNAL_GameControllerButtonBind_hat @@ -4407,7 +4407,7 @@ namespace SDL2 public int hat; public int hat_mask; } - + /* This struct has a union in it, hence the Explicit layout. */ [StructLayout(LayoutKind.Explicit)] public struct SDL_GameControllerButtonBind @@ -4422,13 +4422,13 @@ namespace SDL2 [FieldOffset(4)] public INTERNAL_GameControllerButtonBind_hat hat; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GameControllerAddMapping( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string mappingString ); - + [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForGUID", CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GameControllerMappingForGUID( @@ -4443,7 +4443,7 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_bool SDL_IsGameController(int joystick_index); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GameControllerNameForIndex( @@ -4453,7 +4453,7 @@ namespace SDL2 /* IntPtr refers to an SDL_GameController* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_GameControllerOpen(int joystick_index); - + /* gamecontroller refers to an SDL_GameController* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -4466,7 +4466,7 @@ namespace SDL2 public static extern SDL_bool SDL_GameControllerGetAttached( IntPtr gamecontroller ); - + /* IntPtr refers to an SDL_Joystick* * gamecontroller refers to an SDL_GameController* */ @@ -4474,19 +4474,19 @@ namespace SDL2 public static extern IntPtr SDL_GameControllerGetJoystick( IntPtr gamecontroller ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GameControllerEventState(int state); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GameControllerUpdate(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_GameControllerAxis SDL_GameControllerGetAxisFromString( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string pchString ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GameControllerGetStringForAxis( @@ -4499,20 +4499,20 @@ namespace SDL2 IntPtr gamecontroller, SDL_GameControllerAxis axis ); - + /* gamecontroller refers to an SDL_GameController* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern short SDL_GameControllerGetAxis( IntPtr gamecontroller, SDL_GameControllerAxis axis ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_GameControllerButton SDL_GameControllerGetButtonFromString( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string pchString ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GameControllerGetStringForButton( @@ -4525,24 +4525,24 @@ namespace SDL2 IntPtr gamecontroller, SDL_GameControllerButton button ); - + /* gamecontroller refers to an SDL_GameController* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern byte SDL_GameControllerGetButton( IntPtr gamecontroller, SDL_GameControllerButton button ); - + /* gamecontroller refers to an SDL_GameController* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_GameControllerClose( IntPtr gamecontroller ); - + #endregion - + #region SDL_haptic.h - + /* SDL_HapticEffect type */ public const ushort SDL_HAPTIC_CONSTANT = (1 << 0); public const ushort SDL_HAPTIC_SINE = (1 << 1); @@ -4559,22 +4559,22 @@ namespace SDL2 public const ushort SDL_HAPTIC_AUTOCENTER = (1 << 13); public const ushort SDL_HAPTIC_STATUS = (1 << 14); public const ushort SDL_HAPTIC_PAUSE = (1 << 15); - + /* SDL_HapticDirection type */ public const byte SDL_HAPTIC_POLAR = 0; public const byte SDL_HAPTIC_CARTESIAN = 1; public const byte SDL_HAPTIC_SPHERICAL = 2; - + /* SDL_HapticRunEffect */ public const uint SDL_HAPTIC_INFINITY = 4292967295U; - + [StructLayout(LayoutKind.Sequential)] public unsafe struct SDL_HapticDirection { public byte type; public fixed int dir[3]; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_HapticConstant { @@ -4595,7 +4595,7 @@ namespace SDL2 public ushort fade_length; public ushort fade_level; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_HapticPeriodic { @@ -4619,7 +4619,7 @@ namespace SDL2 public ushort fade_length; public ushort fade_level; } - + [StructLayout(LayoutKind.Sequential)] public unsafe struct SDL_HapticCondition { @@ -4640,7 +4640,7 @@ namespace SDL2 public fixed ushort deadband[3]; public fixed short center[3]; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_HapticRamp { @@ -4674,7 +4674,7 @@ namespace SDL2 public ushort large_magnitude; public ushort small_magnitude; } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_HapticCustom { @@ -4698,7 +4698,7 @@ namespace SDL2 public ushort fade_length; public ushort fade_level; } - + [StructLayout(LayoutKind.Explicit)] public struct SDL_HapticEffect { @@ -4717,36 +4717,36 @@ namespace SDL2 [FieldOffset(0)] public SDL_HapticCustom custom; } - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_HapticClose(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_HapticDestroyEffect( IntPtr haptic, int effect ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticEffectSupported( IntPtr haptic, ref SDL_HapticEffect effect ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticGetEffectStatus( IntPtr haptic, int effect ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticIndex(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -4758,48 +4758,48 @@ namespace SDL2 IntPtr haptic, ref SDL_HapticEffect effect ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticNumAxes(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticNumEffects(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticNumEffectsPlaying(IntPtr haptic); - + /* IntPtr refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_HapticOpen(int device_index); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticOpened(int device_index); - + /* IntPtr refers to an SDL_Haptic*, joystick to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_HapticOpenFromJoystick( IntPtr joystick ); - + /* IntPtr refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr SDL_HapticOpenFromMouse(); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticPause(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_HapticQuery(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticRumbleInit(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticRumblePlay( @@ -4807,15 +4807,15 @@ namespace SDL2 float strength, uint length ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticRumbleStop(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticRumbleSupported(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticRunEffect( @@ -4823,36 +4823,36 @@ namespace SDL2 int effect, uint iterations ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticSetAutocenter( IntPtr haptic, int autocenter ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticSetGain( IntPtr haptic, int gain ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticStopAll(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticStopEffect( IntPtr haptic, int effect ); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticUnpause(IntPtr haptic); - + /* haptic refers to an SDL_Haptic* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_HapticUpdateEffect( @@ -4860,61 +4860,61 @@ namespace SDL2 int effect, ref SDL_HapticEffect data ); - + /* joystick refers to an SDL_Joystick* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_JoystickIsHaptic(IntPtr joystick); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_MouseIsHaptic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_NumHaptics(); - + #endregion #region SDL_audio.h - + public const ushort SDL_AUDIO_MASK_BITSIZE = 0xFF; public const ushort SDL_AUDIO_MASK_DATATYPE = (1 << 8); public const ushort SDL_AUDIO_MASK_ENDIAN = (1 << 12); public const ushort SDL_AUDIO_MASK_SIGNED = (1 << 15); - + public static ushort SDL_AUDIO_BITSIZE(ushort x) { return (ushort) (x & SDL_AUDIO_MASK_BITSIZE); } - + public static bool SDL_AUDIO_ISFLOAT(ushort x) { return (x & SDL_AUDIO_MASK_DATATYPE) != 0; } - + public static bool SDL_AUDIO_ISBIGENDIAN(ushort x) { return (x & SDL_AUDIO_MASK_ENDIAN) != 0; } - + public static bool SDL_AUDIO_ISSIGNED(ushort x) { return (x & SDL_AUDIO_MASK_SIGNED) != 0; } - + public static bool SDL_AUDIO_ISINT(ushort x) { return (x & SDL_AUDIO_MASK_DATATYPE) == 0; } - + public static bool SDL_AUDIO_ISLITTLEENDIAN(ushort x) { return (x & SDL_AUDIO_MASK_ENDIAN) == 0; } - + public static bool SDL_AUDIO_ISUNSIGNED(ushort x) { return (x & SDL_AUDIO_MASK_SIGNED) == 0; } - + public const ushort AUDIO_U8 = 0x0008; public const ushort AUDIO_S8 = 0x8008; public const ushort AUDIO_U16LSB = 0x0010; @@ -4929,7 +4929,7 @@ namespace SDL2 public const ushort AUDIO_F32LSB = 0x8120; public const ushort AUDIO_F32MSB = 0x9120; public const ushort AUDIO_F32 = AUDIO_F32LSB; - + public static readonly ushort AUDIO_U16SYS = BitConverter.IsLittleEndian ? AUDIO_U16LSB : AUDIO_U16MSB; public static readonly ushort AUDIO_S16SYS = @@ -4938,7 +4938,7 @@ namespace SDL2 BitConverter.IsLittleEndian ? AUDIO_S32LSB : AUDIO_S32MSB; public static readonly ushort AUDIO_F32SYS = BitConverter.IsLittleEndian ? AUDIO_F32LSB : AUDIO_F32MSB; - + public const uint SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001; public const uint SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000001; public const uint SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000001; @@ -4947,16 +4947,16 @@ namespace SDL2 SDL_AUDIO_ALLOW_FORMAT_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE ); - + public const int SDL_MIX_MAXVOLUME = 128; - + public enum SDL_AudioStatus { SDL_AUDIO_STOPPED, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED } - + [StructLayout(LayoutKind.Sequential)] public struct SDL_AudioSpec { @@ -4969,7 +4969,7 @@ namespace SDL2 public SDL_AudioCallback callback; public IntPtr userdata; // void* } - + /* userdata refers to a void*, stream to a Uint8 */ [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void SDL_AudioCallback( @@ -4977,31 +4977,31 @@ namespace SDL2 IntPtr stream, int len ); - + /* dev refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_AudioDeviceConnected(uint dev); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_AudioInit( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string driver_name ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_AudioQuit(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_CloseAudio(); - + /* dev refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_CloseAudioDevice(uint dev); - + /* audio_buf refers to a malloc()'d buffer from SDL_LoadWAV */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_FreeWAV(IntPtr audio_buf); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetAudioDeviceName( @@ -5014,24 +5014,24 @@ namespace SDL2 public static extern SDL_AudioStatus SDL_GetAudioDeviceStatus( uint dev ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetAudioDriver(int index); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern SDL_AudioStatus SDL_GetAudioStatus(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string SDL_GetCurrentAudioDriver(); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumAudioDevices(int iscapture); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetNumAudioDrivers(); - + /* audio_buf will refer to a malloc()'d byte buffer */ /* THIS IS AN RWops FUNCTION! */ [DllImport(nativeLibName, EntryPoint = "SDL_LoadWAV_RW", CallingConvention = CallingConvention.Cdecl)] @@ -5063,14 +5063,14 @@ namespace SDL2 ); return result; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_LockAudio(); - + /* dev refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_LockAudioDevice(uint dev); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_MixAudio( [Out()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] @@ -5080,7 +5080,7 @@ namespace SDL2 uint len, int volume ); - + /* format refers to an SDL_AudioFormat */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_MixAudioFormat( @@ -5092,13 +5092,13 @@ namespace SDL2 uint len, int volume ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_OpenAudio( ref SDL_AudioSpec desired, out SDL_AudioSpec obtained ); - + /* uint refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern uint SDL_OpenAudioDevice( @@ -5109,24 +5109,24 @@ namespace SDL2 out SDL_AudioSpec obtained, int allowed_changes ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_PauseAudio(int pause_on); - + /* dev refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_PauseAudioDevice( uint dev, int pause_on ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_UnlockAudio(); - + /* dev refers to an SDL_AudioDeviceID */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void SDL_UnlockAudioDevice(uint dev); - + #endregion #region SDL_systimer.h diff --git a/src/SDL2_image.cs b/src/SDL2_image.cs index e2a0641..5df4bac 100644 --- a/src/SDL2_image.cs +++ b/src/SDL2_image.cs @@ -36,14 +36,14 @@ namespace SDL2 public static class SDL_image { #region SDL2# Variables - + /* Used by DllImport to load the native library. */ private const string nativeLibName = "SDL2_image.dll"; - + #endregion - + #region SDL_image.h - + /* Similar to the headers, this is the version we're expecting to be * running with. You will likely want to check this somewhere in your * program! @@ -51,7 +51,7 @@ namespace SDL2 public const int SDL_IMAGE_MAJOR_VERSION = 2; public const int SDL_IMAGE_MINOR_VERSION = 0; public const int SDL_IMAGE_PATCHLEVEL = 0; - + [Flags] public enum IMG_InitFlags { @@ -60,14 +60,14 @@ namespace SDL2 IMG_INIT_TIF = 0x00000004, IMG_INIT_WEBP = 0x00000008 } - + public static void SDL_IMAGE_VERSION(out SDL.SDL_version X) { X.major = SDL_IMAGE_MAJOR_VERSION; X.minor = SDL_IMAGE_MINOR_VERSION; X.patch = SDL_IMAGE_PATCHLEVEL; } - + [DllImport(nativeLibName, EntryPoint = "IMG_LinkedVersion", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr INTERNAL_IMG_LinkedVersion(); public static SDL.SDL_version IMG_LinkedVersion() @@ -80,20 +80,20 @@ namespace SDL2 ); return result; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int IMG_Init(IMG_InitFlags flags); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void IMG_Quit(); - + /* IntPtr refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IMG_Load( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string file ); - + /* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IMG_LoadTexture( @@ -101,17 +101,17 @@ namespace SDL2 [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string file ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int IMG_InvertAlpha(int on); - + /* IntPtr refers to an SDL_Surface* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IMG_ReadXPMFromArray( [In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] xpm ); - + #endregion } } diff --git a/src/SDL2_mixer.cs b/src/SDL2_mixer.cs index 35d8aa7..22b42b6 100644 --- a/src/SDL2_mixer.cs +++ b/src/SDL2_mixer.cs @@ -36,14 +36,14 @@ namespace SDL2 public static class SDL_mixer { #region SDL2# Variables - + /* Used by DllImport to load the native library. */ private const string nativeLibName = "SDL2_mixer.dll"; - + #endregion - + #region SDL_mixer.h - + /* Similar to the headers, this is the version we're expecting to be * running with. You will likely want to check this somewhere in your * program! @@ -51,19 +51,19 @@ namespace SDL2 public const int SDL_MIXER_MAJOR_VERSION = 2; public const int SDL_MIXER_MINOR_VERSION = 0; public const int SDL_MIXER_PATCHLEVEL = 0; - + /* In C, you can redefine this value before including SDL_mixer.h. * We're not going to allow this in SDL2#, since the value of this * variable is persistent and not dependent on preprocessor ordering. */ public const int MIX_CHANNELS = 8; - + public static readonly int MIX_DEFAULT_FREQUENCY = 22050; public static readonly ushort MIX_DEFAULT_FORMAT = BitConverter.IsLittleEndian ? SDL.AUDIO_S16LSB : SDL.AUDIO_S16MSB; public static readonly int MIX_DEFAULT_CHANNELS = 2; public static readonly byte MIX_MAX_VOLUME = 128; - + [Flags] public enum MIX_InitFlags { @@ -73,14 +73,14 @@ namespace SDL2 MIX_INIT_OGG = 0x00000008, MIX_INIT_FLUIDSYNTH = 0x00000010, } - + public enum Mix_Fading { MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN } - + public enum Mix_MusicType { MUS_NONE, @@ -94,7 +94,7 @@ namespace SDL2 MUS_FLAC, MUS_MODPLUG } - + [StructLayout(LayoutKind.Sequential)] public struct Mix_Chunk { @@ -103,14 +103,14 @@ namespace SDL2 public uint alen; public byte volume; } - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void MixFuncDelegate( IntPtr udata, // void* IntPtr stream, // Uint8* int len ); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void Mix_EffectFunc_t( int chan, @@ -118,32 +118,32 @@ namespace SDL2 int len, IntPtr udata // void* ); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void Mix_EffectDone_t( int chan, IntPtr udata // void* ); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void MusicFinishedDelegate(); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void ChannelFinishedDelegate(int channel); - + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int SoundFontDelegate( IntPtr a, // const char* IntPtr b // void* ); - + public static void SDL_MIXER_VERSION(out SDL.SDL_version X) { X.major = SDL_MIXER_MAJOR_VERSION; X.minor = SDL_MIXER_MINOR_VERSION; X.patch = SDL_MIXER_PATCHLEVEL; } - + [DllImport(nativeLibName, EntryPoint = "MIX_Linked_Version", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr INTERNAL_MIX_Linked_Version(); public static SDL.SDL_version MIX_Linked_Version() @@ -156,13 +156,13 @@ namespace SDL2 ); return result; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_Init(MIX_InitFlags flags); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_Quit(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_OpenAudio( int frequency, @@ -170,17 +170,17 @@ namespace SDL2 int channels, int chunksize ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_AllocateChannels(int numchans); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_QuerySpec( out int frequency, out ushort format, out int channels ); - + /* These are for Mix_LoadWAV, which is a macro in the C header. * THIS IS AN RWops FUNCTION! */ @@ -195,21 +195,21 @@ namespace SDL2 IntPtr rwops = SDL.INTERNAL_SDL_RWFromFile(file, "rb"); return INTERNAL_Mix_LoadWAV_RW(rwops, 1); } - + /* IntPtr refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Mix_LoadMUS( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string file ); - + /* IntPtr refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Mix_QuickLoad_WAV( [In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1)] byte[] mem ); - + /* IntPtr refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mix_Chunk Mix_QuickLoad_RAW( @@ -217,25 +217,25 @@ namespace SDL2 byte[] mem, uint len ); - + /* chunk refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_FreeChunk(IntPtr chunk); - + /* music refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_FreeMusic(IntPtr music); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GetNumChunkDecoders(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string Mix_GetChunkDecoder(int index); [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GetNumMusicDecoders(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string Mix_GetMusicDecoder(int index); @@ -243,33 +243,33 @@ namespace SDL2 /* music refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mix_MusicType Mix_GetMusicType(IntPtr music); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_SetPostMix( MixFuncDelegate mix_func, IntPtr arg // void* ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_HookMusic( MixFuncDelegate mix_func, IntPtr arg // void* ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_HookMusicFinished( MusicFinishedDelegate music_finished ); - + /* IntPtr refers to a void* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Mix_GetMusicHookData(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_ChannelFinished( ChannelFinishedDelegate channel_finished ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_RegisterEffect( int chan, @@ -277,57 +277,57 @@ namespace SDL2 Mix_EffectDone_t d, IntPtr arg // void* ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_UnregisterEffect( int channel, Mix_EffectFunc_t f ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_UnregisterAllEffects(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetPanning( int channel, byte left, byte right ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetPosition( int channel, short angle, byte distance ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetDistance(int channel, byte distance); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetReverseStereo(int channel, int flip); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_ReserveChannels(int num); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupChannel(int which, int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupChannels(int from, int to, int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupAvailable(int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupCount(int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupOldest(int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GroupNewer(int tag); - + /* chunk refers to a Mix_Chunk* */ public static int Mix_PlayChannel( int channel, @@ -336,7 +336,7 @@ namespace SDL2 ) { return Mix_PlayChannelTimed(channel, chunk, loops, -1); } - + /* chunk refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_PlayChannelTimed( @@ -345,11 +345,11 @@ namespace SDL2 int loops, int ticks ); - + /* music refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_PlayMusic(IntPtr music, int loops); - + /* music refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeInMusic( @@ -357,7 +357,7 @@ namespace SDL2 int loops, int ms ); - + /* music refers to a Mix_Music* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeInMusicPos( @@ -366,7 +366,7 @@ namespace SDL2 int ms, double position ); - + /* chunk refers to a Mix_Chunk* */ public static int Mix_FadeInChannel( int channel, @@ -376,7 +376,7 @@ namespace SDL2 ) { return Mix_FadeInChannelTimed(channel, chunk, loops, ms, -1); } - + /* chunk refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeInChannelTimed( @@ -386,95 +386,95 @@ namespace SDL2 int ms, int ticks ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_Volume(int channel, int volume); - + /* chunk refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_VolumeChunk( IntPtr chunk, int volume ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_VolumeMusic(int volume); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_HaltChannel(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_HaltGroup(int tag); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_HaltMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_ExpireChannel(int channel, int ticks); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeOutChannel(int which, int ms); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeOutGroup(int tag, int ms); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_FadeOutMusic(int ms); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mix_Fading Mix_FadingMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern Mix_Fading Mix_FadingChannel(int which); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_Pause(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_Resume(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_Paused(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_PauseMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_ResumeMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_RewindMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_PausedMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetMusicPosition(double position); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_Playing(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_PlayingMusic(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetMusicCMD( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string command ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetSynchroValue(int value); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_GetSynchroValue(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int Mix_SetSoundFonts( [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] string paths ); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] public static extern string Mix_GetSoundFonts(); @@ -484,14 +484,14 @@ namespace SDL2 SoundFontDelegate function, IntPtr data // void* ); - + /* IntPtr refers to a Mix_Chunk* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Mix_GetChunk(int channel); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Mix_CloseAudio(); - + #endregion } } diff --git a/src/SDL2_ttf.cs b/src/SDL2_ttf.cs index 430c5db..c022f8c 100644 --- a/src/SDL2_ttf.cs +++ b/src/SDL2_ttf.cs @@ -36,14 +36,14 @@ namespace SDL2 public static class SDL_ttf { #region SDL2# Variables - + /* Used by DllImport to load the native library. */ private const string nativeLibName = "SDL2_ttf.dll"; - + #endregion - + #region SDL_ttf.h - + /* Similar to the headers, this is the version we're expecting to be * running with. You will likely want to check this somewhere in your * program! @@ -51,28 +51,28 @@ namespace SDL2 public const int SDL_TTF_MAJOR_VERSION = 2; public const int SDL_TTF_MINOR_VERSION = 0; public const int SDL_TTF_PATCHLEVEL = 12; - + public const int UNICODE_BOM_NATIVE = 0xFEFF; public const int UNICODE_BOM_SWAPPED = 0xFFFE; - + public const int TTF_STYLE_NORMAL = 0x00; public const int TTF_STYLE_BOLD = 0x01; public const int TTF_STYLE_ITALIC = 0x02; public const int TTF_STYLE_UNDERLINE = 0x04; public const int TTF_STYLE_STRIKETHROUGH = 0x08; - + public const int TTF_HINTING_NORMAL = 0; public const int TTF_HINTING_LIGHT = 1; public const int TTF_HINTING_MONO = 2; public const int TTF_HINTING_NONE = 3; - + public static void SDL_TTF_VERSION(out SDL.SDL_version X) { X.major = SDL_TTF_MAJOR_VERSION; X.minor = SDL_TTF_MINOR_VERSION; X.patch = SDL_TTF_PATCHLEVEL; } - + [DllImport(nativeLibName, EntryPoint = "TTF_LinkedVersion", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr INTERNAL_TTF_LinkedVersion(); public static SDL.SDL_version TTF_LinkedVersion() @@ -85,13 +85,13 @@ namespace SDL2 ); return result; } - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_ByteSwappedUNICODE(int swapped); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_Init(); - + /* IntPtr refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_OpenFont( @@ -99,7 +99,7 @@ namespace SDL2 string file, int ptsize ); - + /* IntPtr refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_OpenFontIndex( @@ -108,63 +108,63 @@ namespace SDL2 int ptsize, long index ); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GetFontStyle(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_SetFontStyle(IntPtr font, int style); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GetFontOutline(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_SetFontOutline(IntPtr font, int outline); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GetFontHinting(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_SetFontHinting(IntPtr font, int hinting); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_FontHeight(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_FontAscent(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_FontDescent(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_FontLineSkip(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GetFontKerning(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_SetFontKerning(IntPtr font, int allowed); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern long TTF_FontFaces(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_FontFaceIsFixedWidth(IntPtr font); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [return : MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler), MarshalCookie = LPUtf8StrMarshaler.LeaveAllocated)] @@ -182,7 +182,7 @@ namespace SDL2 /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GlyphIsProvided(IntPtr font, ushort ch); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_GlyphMetrics( @@ -194,7 +194,7 @@ namespace SDL2 out int maxy, out int advance ); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_SizeText( @@ -204,7 +204,7 @@ namespace SDL2 out int w, out int h ); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_SizeUTF8( @@ -214,7 +214,7 @@ namespace SDL2 out int w, out int h ); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_SizeUNICODE( @@ -224,7 +224,7 @@ namespace SDL2 out int w, out int h ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderText_Solid( @@ -233,7 +233,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUTF8_Solid( @@ -242,7 +242,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUNICODE_Solid( @@ -251,7 +251,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderGlyph_Solid( @@ -259,7 +259,7 @@ namespace SDL2 ushort ch, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderText_Shaded( @@ -269,7 +269,7 @@ namespace SDL2 SDL.SDL_Color fg, SDL.SDL_Color bg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUTF8_Shaded( @@ -279,7 +279,7 @@ namespace SDL2 SDL.SDL_Color fg, SDL.SDL_Color bg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUNICODE_Shaded( @@ -289,7 +289,7 @@ namespace SDL2 SDL.SDL_Color fg, SDL.SDL_Color bg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderGlyph_Shaded( @@ -298,7 +298,7 @@ namespace SDL2 SDL.SDL_Color fg, SDL.SDL_Color bg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderText_Blended( @@ -307,7 +307,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUTF8_Blended( @@ -316,7 +316,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUNICODE_Blended( @@ -325,7 +325,7 @@ namespace SDL2 string text, SDL.SDL_Color fg ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderText_Blended_Wrapped( @@ -335,7 +335,7 @@ namespace SDL2 SDL.SDL_Color fg, uint wrapped ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUTF8_Blended_Wrapped( @@ -345,7 +345,7 @@ namespace SDL2 SDL.SDL_Color fg, uint wrapped ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderUNICODE_Blended_Wrapped( @@ -355,7 +355,7 @@ namespace SDL2 SDL.SDL_Color fg, uint wrapped ); - + /* IntPtr refers to an SDL_Surface*, font to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr TTF_RenderGlyph_Blended( @@ -363,17 +363,17 @@ namespace SDL2 ushort ch, SDL.SDL_Color fg ); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_CloseFont(IntPtr font); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void TTF_Quit(); - + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int TTF_WasInit(); - + /* font refers to a TTF_Font* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_GetFontKerningSize( @@ -381,7 +381,7 @@ namespace SDL2 int prev_index, int index ); - + #endregion } }