public PixelFormat(global::SharpSDL.PixelFormat _0) { __Instance = Marshal.AllocHGlobal(sizeof(global::SharpSDL.PixelFormat.__Internal)); __ownsNativeInstance = true; NativeToManagedMap[__Instance] = this; *((global::SharpSDL.PixelFormat.__Internal *)__Instance) = *((global::SharpSDL.PixelFormat.__Internal *)_0.__Instance); }
/// <summary>Maps an RGBA quadruple to a pixel value for a given pixel format.</summary> /// <remarks>SDL_MapRGB</remarks> public static uint MapRGBA(global::SharpSDL.PixelFormat format, byte r, byte g, byte b, byte a) { var __arg0 = ReferenceEquals(format, null) ? global::System.IntPtr.Zero : format.__Instance; var __ret = __Internal.MapRGBA(__arg0, r, g, b, a); return(__ret); }
/// <summary>Set the palette for a pixel format structure.</summary> public static int SetPixelFormatPalette(global::SharpSDL.PixelFormat format, global::SharpSDL.Palette palette) { var __arg0 = ReferenceEquals(format, null) ? global::System.IntPtr.Zero : format.__Instance; var __arg1 = ReferenceEquals(palette, null) ? global::System.IntPtr.Zero : palette.__Instance; var __ret = __Internal.SetPixelFormatPalette(__arg0, __arg1); return(__ret); }
/// <summary> /// <para>Creates a new surface of the specified format, and then copies and maps</para> /// <para>the given surface to it so the blit of the converted surface will be as</para> /// <para>fast as possible. If this function fails, it returns NULL.</para> /// </summary> /// <remarks> /// <para>Theparameter is passed to SDL_CreateRGBSurface() and has those</para> /// <para>semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and</para> /// <para>SDL will try to RLE accelerate colorkey and alpha blits in the resulting</para> /// <para>surface.</para> /// </remarks> public static global::SharpSDL.Surface ConvertSurface(global::SharpSDL.Surface src, global::SharpSDL.PixelFormat fmt, uint flags) { var __arg0 = ReferenceEquals(src, null) ? global::System.IntPtr.Zero : src.__Instance; var __arg1 = ReferenceEquals(fmt, null) ? global::System.IntPtr.Zero : fmt.__Instance; var __ret = __Internal.ConvertSurface(__arg0, __arg1, flags); global::SharpSDL.Surface __result0; if (__ret == IntPtr.Zero) { __result0 = null; } else if (global::SharpSDL.Surface.NativeToManagedMap.ContainsKey(__ret)) { __result0 = (global::SharpSDL.Surface)global::SharpSDL.Surface.NativeToManagedMap[__ret]; } else { __result0 = global::SharpSDL.Surface.__CreateInstance(__ret); } return(__result0); }
/// <summary>Get the RGBA components from a pixel of the specified format.</summary> /// <remarks>SDL_GetRGB</remarks> public static void GetRGBA(uint pixel, global::SharpSDL.PixelFormat format, byte *r, byte *g, byte *b, byte *a) { var __arg1 = ReferenceEquals(format, null) ? global::System.IntPtr.Zero : format.__Instance; __Internal.GetRGBA(pixel, __arg1, r, g, b, a); }
/// <summary>Free an SDL_PixelFormat structure.</summary> public static void FreeFormat(global::SharpSDL.PixelFormat format) { var __arg0 = ReferenceEquals(format, null) ? global::System.IntPtr.Zero : format.__Instance; __Internal.FreeFormat(__arg0); }