master c9a7c1ee2392 cached
19 files
382.6 KB
106.6k tokens
1122 symbols
1 requests
Download .txt
Showing preview only (395K chars total). Download the full file or copy to clipboard to get everything.
Repository: zachbarth/minimalist-game-framework
Branch: master
Commit: c9a7c1ee2392
Files: 19
Total size: 382.6 KB

Directory structure:
gitextract__c256kt2/

├── .gitignore
├── Assets/
│   └── INSTRUCTIONS.txt
├── Engine/
│   ├── Audio.cs
│   ├── Content.cs
│   ├── Engine.cs
│   ├── Graphics.cs
│   ├── Input.cs
│   ├── SDL2/
│   │   ├── SDL2.cs
│   │   ├── SDL2_image.cs
│   │   ├── SDL2_mixer.cs
│   │   └── SDL2_ttf.cs
│   └── Utility/
│       ├── Bounds2.cs
│       ├── Color.cs
│       └── Vector2.cs
├── Game/
│   └── Game.cs
├── Game.csproj
├── Game.sln
├── LICENSE.md
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.vs/
Builds/


================================================
FILE: Assets/INSTRUCTIONS.txt
================================================
Place your assets (textures, sounds, and fonts) in this directory and they will be automatically copied when making builds.

================================================
FILE: Engine/Audio.cs
================================================
using SDL2;
using System;
using System.Collections.Generic;

static partial class Engine
{
    private static readonly int AudioChannelCount = 64;

    private static Dictionary<SoundInstance, int> SoundInstances = new Dictionary<SoundInstance, int>();

    private static int GetFadeTimeMs(float fadeTime)
    {
        return (int)(fadeTime * 1000);
    }

    /// <summary>
    /// Plays a sound. Returns an instance handle that can be passed to StopSound() to stop playback of the sound.
    /// </summary>
    /// <param name="sound">The sound to play.</param>
    /// <param name="repeat">Whether or not the sound should repeat until stopped.</param>
    /// <param name="fadeTime">The amount of time (in seconds) to fade in the sound's volume.</param>
    public static SoundInstance PlaySound(Sound sound, bool repeat = false, float fadeTime = 0)
    {
        // Start playing the new sound:
        int channel = SDL_mixer.Mix_FadeInChannel(-1, sound.Handle, repeat ? -1 : 0, GetFadeTimeMs(fadeTime));

        // Silently fail when we run out of channels:
        if (channel == -1)
        {
            return new SoundInstance();
        }

        // Invalidate old sound instances using this channel:
        foreach (var instanceAndChannel in SoundInstances)
        {
            if (instanceAndChannel.Value == channel)
            {
                SoundInstances.Remove(instanceAndChannel.Key);
                break;
            }
        }

        // Return a new sound instance for this channel:
        SoundInstance instance = new SoundInstance();
        SoundInstances[instance] = channel;
        return instance;
    }

    /// <summary>
    /// Stops a playing sound.
    /// </summary>
    /// <param name="instance">An instance handle from a prior call to PlaySound().</param>
    /// <param name="fadeTime">The amount of time (in seconds) to fade out the sound's volume.</param>
    public static void StopSound(SoundInstance instance, float fadeTime = 0)
    {
        int channel;
        if (SoundInstances.TryGetValue(instance, out channel))
        {
            SDL_mixer.Mix_FadeOutChannel(channel, GetFadeTimeMs(fadeTime));
        }
    }

    /// <summary>
    /// Plays music, stopping any currently playing music first.
    /// </summary>
    /// <param name="music">The music to play.</param>
    /// <param name="looping">Whether or not the music should repeat until stopped.</param>
    /// <param name="fadeTime">The amount of time (in seconds) to fade in the music's volume.</param>
    public static void PlayMusic(Music music, bool looping = true, float fadeTime = 0)
    {
        SDL_mixer.Mix_FadeInMusic(music.Handle, looping ? -1 : 0, GetFadeTimeMs(fadeTime));
    }

    /// <summary>
    /// Stops the current music.
    /// </summary>
    /// <param name="fadeTime">The amount of time (in seconds) to fade out the music's volume.</param>
    public static void StopMusic(float fadeTime = 0)
    {
        SDL_mixer.Mix_FadeOutMusic(GetFadeTimeMs(fadeTime));
    }
}

class SoundInstance
{
}


================================================
FILE: Engine/Content.cs
================================================
using SDL2;
using System;
using System.Collections.Generic;
using System.IO;

static partial class Engine
{
    private static string GetAssetPath(string path)
    {
        return Path.Combine("Assets", path);
    }

    /// <summary>
    /// Loads a texture from the Assets directory. Supports the following formats: BMP, GIF, JPEG, PNG, SVG, TGA, TIFF, WEBP.
    /// </summary>
    /// <param name="path">The path to the texture file, relative to the Assets directory.</param>
    public static Texture LoadTexture(string path)
    {
        IntPtr handle = SDL_image.IMG_LoadTexture(Renderer, GetAssetPath(path));
        if (handle == IntPtr.Zero)
        {
            throw new Exception("Failed to load texture.");
        }

        uint format;
        int access, width, height;
        SDL.SDL_QueryTexture(handle, out format, out access, out width, out height);

        return new Texture(handle, width, height);
    }

    /// <summary>
    /// Loads a resizable texture from the Assets directory. Supports the following formats: BMP, GIF, JPEG, PNG, SVG, TGA, TIFF, WEBP.
    /// See the documentation for an explanation of what these parameters _actually_ mean.
    /// </summary>
    /// <param name="path">The path to the texture file, relative to the Assets directory.</param>
    /// <param name="leftOffset">The resize offset from the left of the texture (in pixels).</param>
    /// <param name="rightOffset">The resize offset from the right of the texture (in pixels).</param>
    /// <param name="topOffset">The resize offset from the top of the texture (in pixels).</param>
    /// <param name="bottomOffset">The resize offset from the bottom of the texture (in pixels).</param>
    public static ResizableTexture LoadResizableTexture(string path, int leftOffset, int rightOffset, int topOffset, int bottomOffset)
    {
        IntPtr handle = SDL_image.IMG_LoadTexture(Renderer, GetAssetPath(path));
        if (handle == IntPtr.Zero)
        {
            throw new Exception("Failed to load texture.");
        }

        uint format;
        int access, width, height;
        SDL.SDL_QueryTexture(handle, out format, out access, out width, out height);

        // Convert the relative offsets (from the edges) into absolute offsets (from the origin):
        rightOffset = width - rightOffset - 1;
        bottomOffset = height - bottomOffset - 1;

        if (leftOffset < 0 || rightOffset >= width || topOffset < 0 || bottomOffset >= height || leftOffset > rightOffset || topOffset > bottomOffset)
        {
            throw new Exception("Invalid offset parameter.");
        }

        return new ResizableTexture(handle, width, height, leftOffset, rightOffset, topOffset, bottomOffset);
    }

    /// <summary>
    /// Loads a font from the Assets directory for a single text size. Supports the following formats: TTF, FON.
    /// </summary>
    /// <param name="path">The path to the font file, relative to the Assets directory.</param>
    /// <param name="pointSize">The size of the text that will be rendered by this font (in points).</param>
    public static Font LoadFont(string path, int pointSize)
    {
        IntPtr handle = SDL_ttf.TTF_OpenFont(GetAssetPath(path), pointSize);
        if (handle == IntPtr.Zero)
        {
            throw new Exception("Failed to load font.");
        }

        return new Font(handle);
    }

    /// <summary>
    /// Loads a sound file from the Assets directory. Supports the following formats: WAV, OGG.
    /// </summary>
    /// <param name="path">The path to the sound file, relative to the Assets directory.</param>
    public static Sound LoadSound(string path)
    {
        IntPtr handle = SDL_mixer.Mix_LoadWAV(GetAssetPath(path));
        if (handle == IntPtr.Zero)
        {
            throw new Exception("Failed to load sound.");
        }

        return new Sound(handle);
    }

    /// <summary>
    /// Loads a music file from the Assets directory. Supports the following formats: WAV, OGG, MP3, FLAC.
    /// </summary>
    /// <param name="path">The path to the music file, relative to the Assets directory.</param>
    public static Music LoadMusic(string path)
    {
        IntPtr handle = SDL_mixer.Mix_LoadMUS(GetAssetPath(path));
        if (handle == IntPtr.Zero)
        {
            throw new Exception("Failed to load music.");
        }

        return new Music(handle);
    }
}

/// <summary>
/// A handle to a texture. These should only be created by calling LoadTexture().
/// </summary>
class Texture
{
    public readonly IntPtr Handle;
    public readonly int Width;
    public readonly int Height;
    public readonly Vector2 Size;

    public Texture(IntPtr handle, int width, int height)
    {
        Handle = handle;
        Width = width;
        Height = height;
        Size = new Vector2(width, height);
    }
}

/// <summary>
/// A handle to a resizable texture. These should only be created by calling LoadResizableTexture().
/// </summary>
class ResizableTexture
{
    public readonly IntPtr Handle;
    public readonly int Width;
    public readonly int Height;
    public readonly int LeftOffset;
    public readonly int RightOffset;
    public readonly int TopOffset;
    public readonly int BottomOffset;

    public ResizableTexture(IntPtr handle, int width, int height, int leftOffset, int rightOffset, int topOffset, int bottomOffset)
    {
        Handle = handle;
        Width = width;
        Height = height;
        LeftOffset = leftOffset;
        RightOffset = rightOffset;
        TopOffset = topOffset;
        BottomOffset = bottomOffset;
    }
}

/// <summary>
/// A handle to a font. These should only be created by calling LoadFont().
/// </summary>
class Font
{
    public readonly IntPtr Handle;

    public Font(IntPtr handle)
    {
        Handle = handle;
    }
}

/// <summary>
/// A handle to a sound file. These should only be created by calling LoadSound().
/// </summary>
class Sound
{
    public readonly IntPtr Handle;

    public Sound(IntPtr handle)
    {
        Handle = handle;
    }
}

/// <summary>
/// A handle to a music file. These should only be created by calling LoadMusic().
/// </summary>
class Music
{
    public readonly IntPtr Handle;

    public Music(IntPtr handle)
    {
        Handle = handle;
    }
}


================================================
FILE: Engine/Engine.cs
================================================
using SDL2;
using System;
using System.Collections.Generic;

static partial class Engine
{
    private static IntPtr Window;
    private static bool Fullscreen;
    private static Texture RenderTarget;
    private static Game Game;

    /// <summary>
    /// The amount of time (in seconds) since the last frame.
    /// </summary>
    public static float TimeDelta { get; private set; }

    private static void Main(string[] args)
    {
        Start();
        Run();
    }

    private static void Start()
    {
        // ======================================================================================
        // Initialize SDL
        // ======================================================================================

        if (SDL.SDL_Init(SDL.SDL_INIT_EVERYTHING) != 0)
        {
            throw new Exception("Failed to initialize SDL.");
        }

        if (SDL_ttf.TTF_Init() != 0)
        {
            throw new Exception("Failed to initialize SDL_ttf.");
        }

        SDL_mixer.MIX_InitFlags mixInitFlags = SDL_mixer.MIX_InitFlags.MIX_INIT_MP3 | SDL_mixer.MIX_InitFlags.MIX_INIT_OGG | SDL_mixer.MIX_InitFlags.MIX_INIT_FLAC;
        if (((SDL_mixer.MIX_InitFlags)SDL_mixer.Mix_Init(mixInitFlags) & mixInitFlags) != mixInitFlags)
        {
            throw new Exception("Failed to initialize SDL_mixer.");
        }

        if (SDL_mixer.Mix_OpenAudio(44100, SDL_mixer.MIX_DEFAULT_FORMAT, 2, 1024) != 0)
        {
            throw new Exception("Failed to initialize SDL_mixer.");
        }

        SDL_mixer.Mix_AllocateChannels(AudioChannelCount);

        Window = SDL.SDL_CreateWindow(
            Game.Title,
            SDL.SDL_WINDOWPOS_CENTERED_DISPLAY(0),
            SDL.SDL_WINDOWPOS_CENTERED_DISPLAY(0),
            (int)Game.Resolution.X,
            (int)Game.Resolution.Y,
            0);

        if (Window == IntPtr.Zero)
        {
            throw new Exception("Failed to create window.");
        }

        Renderer = SDL.SDL_CreateRenderer(Window, -1, SDL.SDL_RendererFlags.SDL_RENDERER_ACCELERATED | SDL.SDL_RendererFlags.SDL_RENDERER_PRESENTVSYNC | SDL.SDL_RendererFlags.SDL_RENDERER_TARGETTEXTURE);

        if (Renderer == IntPtr.Zero)
        {
            throw new Exception("Failed to create renderer.");
        }

        IntPtr renderTargetHandle = SDL.SDL_CreateTexture(Renderer, SDL.SDL_PIXELFORMAT_RGBA8888, (int)SDL.SDL_TextureAccess.SDL_TEXTUREACCESS_TARGET, (int)Game.Resolution.X, (int)Game.Resolution.Y);
        RenderTarget = new Texture(renderTargetHandle, (int)Game.Resolution.X, (int)Game.Resolution.Y);

        // ======================================================================================
        // Instantiate the game object
        // ======================================================================================

        Game = new Game();
    }

    private static void Run()
    {
        ulong lastFrameStartTime = SDL.SDL_GetPerformanceCounter();

        while (true)
        {
            // Measure the time elapsed between one frame and the next:
            ulong now = SDL.SDL_GetPerformanceCounter();
            TimeDelta = (now - lastFrameStartTime) / (float)SDL.SDL_GetPerformanceFrequency();
            lastFrameStartTime = now;

            // Process pre-update engine logic:
            PollEvents();

            // Toggle between windowed and fullscreen mode when Alt+Enter is pressed:
            if (GetKeyDown(Key.Return) && (GetKeyHeld(Key.LeftAlt) || GetKeyHeld(Key.RightAlt)))
            {
                Fullscreen = !Fullscreen;
                SDL.SDL_SetWindowFullscreen(Window, Fullscreen ? (uint)SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
            }

            // Clear and start drawing into the render target:
            SDL.SDL_SetRenderTarget(Renderer, RenderTarget.Handle);
            SDL.SDL_SetRenderDrawColor(Renderer, 0, 0, 0, 255);
            SDL.SDL_RenderClear(Renderer);

            // Update game logic:
            Game.Update();

            // Figure out how to scale our render target to fill the window:
            int windowWidth, windowHeight;
            SDL.SDL_GetWindowSize(Window, out windowWidth, out windowHeight);
            float renderTargetScale = ((float)windowWidth / windowHeight > Game.Resolution.X / Game.Resolution.Y)
                ? windowHeight / Game.Resolution.Y
                : windowWidth / Game.Resolution.X;

            // Copy the render target to the screen:
            SDL.SDL_SetRenderTarget(Renderer, IntPtr.Zero);
            SDL.SDL_SetRenderDrawColor(Renderer, 0, 0, 0, 255);
            SDL.SDL_RenderClear(Renderer);
            Vector2 renderTargetSize = Game.Resolution * renderTargetScale;
            Vector2 renderTargetPos = 0.5f * (new Vector2(windowWidth, windowHeight) - renderTargetSize);
            DrawTexture(RenderTarget, renderTargetPos, size: renderTargetSize, scaleMode: TextureScaleMode.Nearest);

            // Present the screen:
            SDL.SDL_RenderPresent(Renderer);

            // Process post-update engine logic:
            FreeUnusedTextCacheEntries();
        }
    }
}


================================================
FILE: Engine/Graphics.cs
================================================
using SDL2;
using System;
using System.Collections.Generic;

static partial class Engine
{
    private static IntPtr Renderer;
    private static Dictionary<Tuple<Font, string>, TextCacheEntry> TextCache = new Dictionary<Tuple<Font, string>, TextCacheEntry>();

    // ======================================================================================
    // Primitive drawing
    // ======================================================================================

    private static void DrawPrimitiveSetup(Color color)
    {
        SDL.SDL_SetRenderDrawColor(Renderer, color.R, color.G, color.B, color.A);
        SDL.SDL_SetRenderDrawBlendMode(Renderer, SDL.SDL_BlendMode.SDL_BLENDMODE_BLEND);
    }

    /// <summary>
    /// Draws a line.
    /// </summary>
    /// <param name="start">The start of the line.</param>
    /// <param name="end">The end of the line.</param>
    /// <param name="color">The color of the line.</param>
    public static void DrawLine(Vector2 start, Vector2 end, Color color)
    {
        DrawPrimitiveSetup(color);

        SDL.SDL_RenderDrawLine(Renderer, (int)start.X, (int)start.Y, (int)end.X, (int)end.Y);
    }

    /// <summary>
    /// Draws an empty rectangle.
    /// </summary>
    /// <param name="bounds">The bounds of the rectangle.</param>
    /// <param name="color">The color of the rectangle.</param>
    public static void DrawRectEmpty(Bounds2 bounds, Color color)
    {
        DrawPrimitiveSetup(color);

        SDL.SDL_Rect rect = new SDL.SDL_Rect();
        rect.x = (int)bounds.Position.X;
        rect.y = (int)bounds.Position.Y;
        rect.w = (int)bounds.Size.X;
        rect.h = (int)bounds.Size.Y;
        SDL.SDL_RenderDrawRect(Renderer, ref rect);
    }

    /// <summary>
    /// Draws a solid rectangle.
    /// </summary>
    /// <param name="bounds">The bounds of the rectangle.</param>
    /// <param name="color">The color of the rectangle.</param>
    public static void DrawRectSolid(Bounds2 bounds, Color color)
    {
        DrawPrimitiveSetup(color);

        SDL.SDL_Rect rect = new SDL.SDL_Rect();
        rect.x = (int)bounds.Position.X;
        rect.y = (int)bounds.Position.Y;
        rect.w = (int)bounds.Size.X;
        rect.h = (int)bounds.Size.Y;
        SDL.SDL_RenderFillRect(Renderer, ref rect);
    }

    // ======================================================================================
    // Texture drawing
    // ======================================================================================

    private static void DrawTextureSetup(IntPtr textureHandle, Color? color, TextureBlendMode blendMode, TextureScaleMode scaleMode)
    {
        Color finalColor = color ?? Color.White;
        SDL.SDL_SetTextureColorMod(textureHandle, finalColor.R, finalColor.G, finalColor.B);
        SDL.SDL_SetTextureAlphaMod(textureHandle, finalColor.A);
        SDL.SDL_SetTextureBlendMode(textureHandle, (SDL.SDL_BlendMode)blendMode);
        SDL.SDL_SetTextureScaleMode(textureHandle, (SDL.SDL_ScaleMode)scaleMode);
    }

    /// <summary>
    /// Draws a texture.
    /// </summary>
    /// <param name="texture">The texture to draw.</param>
    /// <param name="position">The position where the texture will be drawn.</param>
    /// <param name="color">The color to multiply with the colors of the texture. If unspecified the colors of the texture will be unchanged.</param>
    /// <param name="size">The destination size of the texture. If unspecified the original texture size will be used.</param>
    /// <param name="rotation">The amount the texture will be rotated clockwise (in degrees). If unspecified the texture will not be rotated.</param>
    /// <param name="pivot">The offset from position to the pivot that the texture will be rotated about. If unspecified the center of the destination bounds will be used.</param>
    /// <param name="mirror">The mirroring to apply to the texture. If unspecified the texture will not be mirrored.</param>
    /// <param name="source">The source bounds of the texture to draw. If unspecified the entire texture will be drawn.</param>
    /// <param name="blendMode">The blend mode to use when drawing the texture. If unspecified the texture will be drawn using the standard alpha-based blend mode.</param>
    /// <param name="scaleMode">The scale mode to use when drawing the texture. If unspecified the texture will be linearly interpolated.</param>
    public static void DrawTexture(Texture texture, Vector2 position, Color? color = null, Vector2? size = null, float rotation = 0, Vector2? pivot = null, TextureMirror mirror = TextureMirror.None, Bounds2? source = null, TextureBlendMode blendMode = TextureBlendMode.Normal, TextureScaleMode scaleMode = TextureScaleMode.Linear)
    {
        DrawTextureSetup(texture.Handle, color, blendMode, scaleMode);

        SDL.SDL_Rect src;
        SDL.SDL_Rect dest;
        if (source.HasValue)
        {
            // Use the specified source coordinates:
            src.x = (int)source.Value.Position.X;
            src.y = (int)source.Value.Position.Y;
            src.w = (int)source.Value.Size.X;
            src.h = (int)source.Value.Size.Y;
            dest.x = (int)position.X;
            dest.y = (int)position.Y;
            dest.w = src.w;
            dest.h = src.h;
        }
        else
        {
            // Use the full texture as the source:
            src.x = 0;
            src.y = 0;
            src.w = texture.Width;
            src.h = texture.Height;
            dest.x = (int)position.X;
            dest.y = (int)position.Y;
            dest.w = texture.Width;
            dest.h = texture.Height;
        }

        // Apply the size override, if specified:
        if (size.HasValue)
        {
            dest.w = (int)size.Value.X;
            dest.h = (int)size.Value.Y;
        }

        // Apply the pivot override, if specified:
        SDL.SDL_Point center;
        if (pivot.HasValue)
        {
            center.x = (int)pivot.Value.X;
            center.y = (int)pivot.Value.Y;
        }
        else
        {
            center.x = dest.w / 2;
            center.y = dest.h / 2;
        }

        SDL.SDL_RenderCopyEx(Renderer, texture.Handle, ref src, ref dest, rotation, ref center, (SDL.SDL_RendererFlip)mirror);
    }

    /// <summary>
    /// Draws a resizable texture.
    /// See the documentation for an explanation of how resizable textures work.
    /// </summary>
    /// <param name="texture">The resizable texture to draw.</param>
    /// <param name="bounds">The bounds that the texture should be resized to.</param>
    /// <param name="color">The color to multiply with the colors of the texture. If unspecified the colors of the texture will be unchanged.</param>
    /// <param name="blendMode">The blend mode to use when drawing the texture. If unspecified the texture will be drawn using the standard alpha-based blend mode.</param>
    /// <param name="scaleMode">The scale mode to use when drawing the texture. If unspecified the texture will be linearly interpolated.</param>
    public static void DrawResizableTexture(ResizableTexture texture, Bounds2 bounds, Color? color = null, TextureBlendMode blendMode = TextureBlendMode.Normal, TextureScaleMode scaleMode = TextureScaleMode.Linear)
    {
        DrawTextureSetup(texture.Handle, color, blendMode, scaleMode);

        /*    
         *   0    bxmin     bxmax    txmax
         *   v    v             v    v
         *   +----|-------------|----+ < tymax
         *   | 1  |      5      | 2  |
         *   -----+-------------+----- < bymax
         *   |    |             |    |
         *   |    |             |    |
         *   | 6  |      9      | 7  |
         *   |    |             |    |
         *   |    |             |    |
         *   -----+-------------+----- < bymin
         *   | 3  |      8      | 4  |
         *   +----|-------------|----+ < 0
         */

        int bxmin = texture.LeftOffset;
        int bxmax = texture.RightOffset;
        int bymin = texture.TopOffset;
        int bymax = texture.BottomOffset;
        int txmax = texture.Width;
        int tymax = texture.Height;
        int px = (int)bounds.Position.X;
        int py = (int)bounds.Position.Y;
        
        // Don't let the overall size be so small that segment 9 has a negative size in either dimension:
        int sx = Math.Max((int)bounds.Size.X, txmax - bxmax + bxmin);
        int sy = Math.Max((int)bounds.Size.Y, tymax - bymax + bymin);

        // Draw each of the nine segments:
        DrawResizableTextureSegment(texture, 0, 0, bxmin, bymin, px, py, bxmin, bymin);
        DrawResizableTextureSegment(texture, bxmax, 0, txmax - bxmax, bymin, px + sx - (txmax - bxmax), py, txmax - bxmax, bymin);
        DrawResizableTextureSegment(texture, 0, bymax, bxmin, tymax - bymax, px, py + sy - (tymax - bymax), bxmin, tymax - bymax);
        DrawResizableTextureSegment(texture, bxmax, bymax, txmax - bxmax, tymax - bymax, px + sx - (txmax - bxmax), py + sy - (tymax - bymax), txmax - bxmax, tymax - bymax);
        DrawResizableTextureSegment(texture, bxmin, 0, bxmax - bxmin, bymin, px + bxmin, py, sx - bxmin - (txmax - bxmax), bymin);
        DrawResizableTextureSegment(texture, 0, bymin, bxmin, bymax - bymin, px, py + bymin, bxmin, sy - bymin - (tymax - bymax));
        DrawResizableTextureSegment(texture, bxmax, bymin, txmax - bxmax, bymax - bymin, px + sx - (txmax - bxmax), py + bymin, txmax - bxmax, sy - bymin - (tymax - bymax));
        DrawResizableTextureSegment(texture, bxmin, bymax, bxmax - bxmin, tymax - bymax, px + bxmin, py + sy - (tymax - bymax), sx - bxmin - (txmax - bxmax), tymax - bymax);
        DrawResizableTextureSegment(texture, bxmin, bymin, bxmax - bxmin, bymax - bymin, px + bxmin, py + bymin, sx - bxmin - (txmax - bxmax), sy - bymin - (tymax - bymax));
    }

    private static void DrawResizableTextureSegment(ResizableTexture texture, int subtextureX, int subtextureY, int subtextureW, int subtextureH, int destX, int destY, int destW, int destH)
    {
        // Don't draw invisible segments:
        if (subtextureW <= 0 || subtextureH <= 0)
        {
            return;
        }

        SDL.SDL_Rect src;
        src.x = subtextureX;
        src.y = subtextureY;
        src.w = subtextureW;
        src.h = subtextureH;

        SDL.SDL_Rect dest;
        dest.x = destX;
        dest.y = destY;
        dest.w = destW;
        dest.h = destH;

        SDL.SDL_RenderCopy(Renderer, texture.Handle, ref src, ref dest);
    }

    // ======================================================================================
    // Text drawing
    // ======================================================================================

    /// <summary>
    /// Draws a text string. Returns the bounds of the drawn text.
    /// </summary>
    /// <param name="text">The text to draw.</param>
    /// <param name="position">The position where the text will be drawn.</param>
    /// <param name="color">The color of the text.</param>
    /// <param name="font">The font to use to draw the text.</param>
    /// <param name="alignment">The alignment of the text relative to the position. If unspecified the text will be drawn left-aligned.</param>
    /// <param name="measureOnly">If true the text will only be measured and not actually drawn to the screen.</param>
    public static Bounds2 DrawString(string text, Vector2 position, Color color, Font font, TextAlignment alignment = TextAlignment.Left, bool measureOnly = false)
    {
        // Every time we draw a string we have to render it into a texture, which isn't the fastest thing in the world.
        // To make this faster we keep a cache of recently rendered strings and reuse them when possible.

        Tuple<Font, string> textCacheKey = Tuple.Create(font, text);
        TextCacheEntry entry;
        if (TextCache.TryGetValue(textCacheKey, out entry))
        {
            // We found the text in the cache, so use it and reset its age so that it doesn't get freed this frame:
            entry.Age = 0;
        }
        else
        {
            // We were unable to find the text in the cache, so render it to a texture and cache it for later:
            SDL.SDL_Color white = new SDL.SDL_Color() { r = 255, g = 255, b = 255, a = 255 };
            IntPtr surface = SDL_ttf.TTF_RenderText_Blended(font.Handle, text, white);
            IntPtr handle = SDL.SDL_CreateTextureFromSurface(Renderer, surface);
            SDL.SDL_FreeSurface(surface);
            entry = new TextCacheEntry(handle);
            TextCache[textCacheKey] = entry;
        }

        // Query the texture dimensions:
        uint format;
        int access, width, height;
        SDL.SDL_QueryTexture(entry.Handle, out format, out access, out width, out height);

        // Apply text alignment relative to the draw position:
        if (alignment == TextAlignment.Center)
        {
            position.X -= width / 2;
        }
        else if (alignment == TextAlignment.Right)
        {
            position.X -= width;
        }

        // If we're not only measuring the text, draw it:
        if (!measureOnly)
        {
            Texture texture = new Texture(entry.Handle, width, height);
            DrawTexture(texture, position, color);
        }

        // Return the bounds of the text:
        return new Bounds2(position, new Vector2(width, height));
    }

    private static void FreeUnusedTextCacheEntries()
    {
        // Cache entries are aggressively purged, and will essentially only stick around when the same text is drawn every frame.

        List<Tuple<Font, string>> expiredEntryKeys = new List<Tuple<Font, string>>();
        foreach (var keyAndEntry in TextCache)
        {
            keyAndEntry.Value.Age += 1;
            if (keyAndEntry.Value.Age > 2)
            {
                SDL.SDL_DestroyTexture(keyAndEntry.Value.Handle);
                expiredEntryKeys.Add(keyAndEntry.Key);
            }
        }

        foreach (Tuple<Font, string> key in expiredEntryKeys)
        {
            TextCache.Remove(key);
        }
    }

    private class TextCacheEntry
    {
        public readonly IntPtr Handle;
        public int Age;

        public TextCacheEntry(IntPtr handle)
        {
            Handle = handle;
            Age = 0;
        }
    }
}

enum TextAlignment
{
    /// <summary>
    /// Left-align the text.
    /// </summary>
    Left,

    /// <summary>
    /// Center the text.
    /// </summary>
    Center,

    /// <summary>
    /// Right-align the text.
    /// </summary>
    Right,
}

[Flags]
enum TextureMirror
{
    /// <summary>
    /// Do not mirror the texture.
    /// </summary>
    None = SDL.SDL_RendererFlip.SDL_FLIP_NONE,

    /// <summary>
    /// Mirror the texture horizontally.
    /// </summary>
    Horizontal = SDL.SDL_RendererFlip.SDL_FLIP_HORIZONTAL,

    /// <summary>
    /// Mirror the texture vertically.
    /// </summary>
    Vertical = SDL.SDL_RendererFlip.SDL_FLIP_VERTICAL,

    /// <summary>
    /// Mirror the texture horizontally and vertically. Equivalent to rotating it 180 degrees.
    /// </summary>
    Both = Horizontal | Vertical,
}

enum TextureBlendMode
{
    /// <summary>
    /// Use a normal blend mode where new colors replace old colors based on the alpha of the new color.
    /// </summary>
    Normal = SDL.SDL_BlendMode.SDL_BLENDMODE_BLEND,

    /// <summary>
    /// Use an additive blend mode where new colors are simply added to old colors and get brighter.
    /// </summary>
    Additive = SDL.SDL_BlendMode.SDL_BLENDMODE_ADD,
}

enum TextureScaleMode
{
    /// <summary>
    /// Use a linear scale mode that interpolates between pixels for a smooth but blurry image.
    /// </summary>
    Nearest = SDL.SDL_ScaleMode.SDL_ScaleModeNearest,

    /// <summary>
    /// Use a nearest neighbor scale mode that interpolates between pixels for a sharp but pixelated image.
    /// </summary>
    Linear = SDL.SDL_ScaleMode.SDL_ScaleModeLinear,
}


================================================
FILE: Engine/Input.cs
================================================
using SDL2;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

static partial class Engine
{
    private static HashSet<MouseButton> MouseButtonsDown = new HashSet<MouseButton>();
    private static HashSet<MouseButton> MouseButtonsHeld = new HashSet<MouseButton>();
    private static HashSet<MouseButton> MouseButtonsUp = new HashSet<MouseButton>();
    private static HashSet<Key> KeysDown = new HashSet<Key>();
    private static HashSet<Key> KeysDownAutorepeat = new HashSet<Key>();
    private static HashSet<Key> KeysHeld = new HashSet<Key>();
    private static HashSet<Key> KeysUp = new HashSet<Key>();
    private static Dictionary<int, Gamepad> GamepadsByID = new Dictionary<int, Gamepad>();
    private static Gamepad[] GamepadsByPlayer = new Gamepad[64];

    /// <summary>
    /// The current position of the mouse cursor (in pixels).
    /// </summary>
    public static Vector2 MousePosition { get; private set; }

    /// <summary>
    /// The change in position of the mouse cursor this frame (in pixels).
    /// </summary>
    public static Vector2 MouseMotion { get; private set; }

    /// <summary>
    /// The amount the mouse wheel has been scrolled this frame (in scroll units).
    /// </summary>
    public static float MouseScroll { get; private set; }

    /// <summary>
    /// The textual representation of the keys that were pressed this frame.
    /// </summary>
    public static string TypedText { get; private set; }

    private static void PollEvents()
    {
        // ======================================================================================
        // Reset per-frame input flags
        // ======================================================================================

        MouseButtonsDown.Clear();
        MouseButtonsUp.Clear();
        MouseScroll = 0;

        KeysDown.Clear();
        KeysDownAutorepeat.Clear();
        KeysUp.Clear();
        TypedText = "";
        
        foreach (Gamepad gamepad in GamepadsByID.Values)
        {
            gamepad.ButtonsDown.Clear();
            gamepad.ButtonsUp.Clear();
        }

        // ======================================================================================
        // Poll for new events from SDL
        // ======================================================================================

        SDL.SDL_Event evt;
        while (SDL.SDL_PollEvent(out evt) != 0)
        {
            if (evt.type == SDL.SDL_EventType.SDL_MOUSEMOTION)
            {
                MousePosition = new Vector2(evt.motion.x, evt.motion.y);
                MouseMotion = new Vector2(evt.motion.xrel, evt.motion.yrel);
            }
            else if (evt.type == SDL.SDL_EventType.SDL_MOUSEBUTTONDOWN)
            {
                MouseButton button = (MouseButton)evt.button.button;
                MouseButtonsDown.Add(button);
                MouseButtonsHeld.Add(button);
            }
            else if (evt.type == SDL.SDL_EventType.SDL_MOUSEBUTTONUP)
            {
                MouseButton button = (MouseButton)evt.button.button;
                MouseButtonsUp.Add(button);
                MouseButtonsHeld.Remove(button);
            }
            else if (evt.type == SDL.SDL_EventType.SDL_MOUSEWHEEL)
            {
                MouseScroll = evt.wheel.y;
            }
            else if (evt.type == SDL.SDL_EventType.SDL_KEYDOWN)
            {
                if (evt.key.repeat == 0)
                {
                    KeysDown.Add((Key)evt.key.keysym.sym);
                    KeysHeld.Add((Key)evt.key.keysym.sym);
                }
                else
                {
                    KeysDownAutorepeat.Add((Key)evt.key.keysym.sym);
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_KEYUP)
            {
                KeysUp.Add((Key)evt.key.keysym.sym);
                KeysHeld.Remove((Key)evt.key.keysym.sym);
            }
            else if (evt.type == SDL.SDL_EventType.SDL_TEXTINPUT)
            {
                // Convert the byte array into a C# string:
                string text = null;
                unsafe
                {
                    byte[] bufferCopy = new byte[SDL.SDL_TEXTINPUTEVENT_TEXT_SIZE];
                    Marshal.Copy((IntPtr)evt.text.text, bufferCopy, 0, bufferCopy.Length);
                    text = Encoding.UTF8.GetString(bufferCopy);
                }

                TypedText += text[0];
            }
            else if (evt.type == SDL.SDL_EventType.SDL_CONTROLLERDEVICEADDED)
            {
                // Create the gamepad object:
                IntPtr handle = SDL.SDL_GameControllerOpen(evt.cdevice.which);
                Gamepad gamepad = new Gamepad(handle);

                // All other gamepad events use the "joystick instance ID" to identify the gamepad:
                int id = SDL.SDL_JoystickInstanceID(SDL.SDL_GameControllerGetJoystick(handle));
                GamepadsByID[id] = gamepad;

                // Use the lowest available player number for this gamepad:
                for (int i = 0; i < GamepadsByPlayer.Length; i++)
                {
                    if (GamepadsByPlayer[i] == null)
                    {
                        GamepadsByPlayer[i] = gamepad;
                        break;
                    }
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_CONTROLLERDEVICEREMOVED)
            {
                Gamepad gamepad;
                if (GamepadsByID.TryGetValue(evt.cdevice.which, out gamepad))
                {
                    // Destroy the gamepad:
                    SDL.SDL_GameControllerClose(gamepad.Handle);
                    GamepadsByID.Remove(evt.cdevice.which);

                    // Free up this player number for use by the next gamepad attached:
                    for (int i = 0; i < GamepadsByPlayer.Length; i++)
                    {
                        if (GamepadsByPlayer[i] == gamepad)
                        {
                            GamepadsByPlayer[i] = null;
                            break;
                        }
                    }
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_CONTROLLERAXISMOTION)
            {
                Gamepad gamepad;
                if (GamepadsByID.TryGetValue(evt.caxis.which, out gamepad))
                {
                    float value = ((float)evt.caxis.axisValue) / short.MaxValue;
                    switch ((SDL.SDL_GameControllerAxis)evt.caxis.axis)
                    {
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_LEFTX: gamepad.LeftStick.X = value; break;
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_LEFTY: gamepad.LeftStick.Y = value; break;
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_RIGHTX: gamepad.RightStick.X = value; break;
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_RIGHTY: gamepad.RightStick.Y = value; break;
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_TRIGGERLEFT: gamepad.Triggers.X = value; break;
                        case SDL.SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_TRIGGERRIGHT: gamepad.Triggers.Y = value; break;
                    }
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_CONTROLLERBUTTONDOWN)
            {
                Gamepad gamepad;
                if (GamepadsByID.TryGetValue(evt.cbutton.which, out gamepad))
                {
                    GamepadButton button = (GamepadButton)evt.cbutton.button;
                    gamepad.ButtonsDown.Add(button);
                    gamepad.ButtonsHeld.Add(button);
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_CONTROLLERBUTTONUP)
            {
                Gamepad gamepad;
                if (GamepadsByID.TryGetValue(evt.cbutton.which, out gamepad))
                {
                    GamepadButton button = (GamepadButton)evt.cbutton.button;
                    gamepad.ButtonsUp.Add(button);
                    gamepad.ButtonsHeld.Remove(button);
                }
            }
            else if (evt.type == SDL.SDL_EventType.SDL_QUIT)
            {
                Environment.Exit(0);
            }
        }
    }

    // ======================================================================================
    // Mouse input
    // ======================================================================================

    /// <summary>
    /// Sets the mouse mode, which controls the visibility and lock state of the cursor.
    /// </summary>
    /// <param name="mode">The mouse mode to set.</param>
    public static void SetMouseMode(MouseMode mode)
    {
        switch (mode)
        {
            case MouseMode.Visible:
                SDL.SDL_SetRelativeMouseMode(SDL.SDL_bool.SDL_FALSE);
                SDL.SDL_ShowCursor(1);
                break;
            case MouseMode.Hidden:
                SDL.SDL_SetRelativeMouseMode(SDL.SDL_bool.SDL_FALSE);
                SDL.SDL_ShowCursor(0);
                break;
            case MouseMode.Locked:
                SDL.SDL_SetRelativeMouseMode(SDL.SDL_bool.SDL_TRUE);
                break;
        }
    }

    /// <summary>
    /// Returns true if a mouse button was pressed down this frame.
    /// </summary>
    /// <param name="button">The mouse button to query.</param>
    public static bool GetMouseButtonDown(MouseButton button)
    {
        return MouseButtonsDown.Contains(button);
    }

    /// <summary>
    /// Returns true if a mouse button was held during this frame.
    /// </summary>
    /// <param name="button">The mouse button to query.</param>
    public static bool GetMouseButtonHeld(MouseButton button)
    {
        return MouseButtonsHeld.Contains(button);
    }

    /// <summary>
    /// Returns true if a mouse button was released this frame.
    /// </summary>
    /// <param name="button"></param>
    public static bool GetMouseButtonUp(MouseButton button)
    {
        return MouseButtonsUp.Contains(button);
    }

    // ======================================================================================
    // Keyboard input
    // ======================================================================================

    /// <summary>
    /// Returns true if a key was pressed down this frame.
    /// </summary>
    /// <param name="key">The key to query.</param>
    /// <param name="allowAutorepeat">Whether or not key-down events generated by autorepeat will be included.</param>
    public static bool GetKeyDown(Key key, bool allowAutorepeat = false)
    {
        if (allowAutorepeat && KeysDownAutorepeat.Contains(key))
        {
            return true;
        }

        return KeysDown.Contains(key);
    }

    /// <summary>
    /// Returns true if a key was held during this frame.
    /// </summary>
    /// <param name="key">The key to query.</param>
    public static bool GetKeyHeld(Key key)
    {
        return KeysHeld.Contains(key);
    }

    /// <summary>
    /// Returns true if a key was released this frame.
    /// </summary>
    /// <param name="key">The key to query.</param>
    public static bool GetKeyUp(Key key)
    {
        return KeysUp.Contains(key);
    }

    // ======================================================================================
    // Gamepad input
    // ======================================================================================

    /// <summary>
    /// Returns true if a player's gamepad is connected.
    /// </summary>
    /// <param name="player">The player to query, starting with 0.</param>
    public static bool GetGamepadConnected(int player)
    {
        return player >= 0 && player < GamepadsByPlayer.Length && GamepadsByPlayer[player] != null;
    }

    /// <summary>
    /// Reads the analog values of the specified axis on a player's gamepad.
    /// </summary>
    /// <param name="player">The player to query, starting with 0.</param>
    /// <param name="axis">The gamepad axis to query.</param>
    public static Vector2 GetGamepadAxis(int player, GamepadAxis axis)
    {
        if (GetGamepadConnected(player))
        {
            switch (axis)
            {
                case GamepadAxis.LeftStick: return GamepadsByPlayer[player].LeftStick;
                case GamepadAxis.RightStick: return GamepadsByPlayer[player].RightStick;
                case GamepadAxis.Triggers: return GamepadsByPlayer[player].Triggers;
                default: throw new Exception("Unhandled case.");
            }
        }
        else
        {
            return Vector2.Zero;
        }
    }

    /// <summary>
    /// Returns true if a gamepad button was pressed down this frame.
    /// </summary>
    /// <param name="player">The player to query, starting with 0.</param>
    /// <param name="button">The gamepad button to query.</param>
    /// <returns></returns>
    public static bool GetGamepadButtonDown(int player, GamepadButton button)
    {
        if (GetGamepadConnected(player))
        {
            return GamepadsByPlayer[player].ButtonsDown.Contains(button);
        }
        else
        {
            return false;
        }
    }

    /// <summary>
    /// Returns true if a gamepad button was held during this frame.
    /// </summary>
    /// <param name="player">The player to query, starting with 0.</param>
    /// <param name="button">The gamepad button to query.</param>
    /// <returns></returns>
    public static bool GetGamepadButtonHeld(int player, GamepadButton button)
    {
        if (GetGamepadConnected(player))
        {
            return GamepadsByPlayer[player].ButtonsHeld.Contains(button);
        }
        else
        {
            return false;
        }
    }

    /// <summary>
    /// Returns true if a gamepad button was released this frame.
    /// </summary>
    /// <param name="player">The player to query, starting with 0.</param>
    /// <param name="button">The gamepad button to query.</param>
    /// <returns></returns>
    public static bool GetGamepadButtonUp(int player, GamepadButton button)
    {
        if (GetGamepadConnected(player))
        {
            return GamepadsByPlayer[player].ButtonsUp.Contains(button);
        }
        else
        {
            return false;
        }
    }

    private class Gamepad
    {
        public readonly IntPtr Handle;
        public readonly HashSet<GamepadButton> ButtonsDown = new HashSet<GamepadButton>();
        public readonly HashSet<GamepadButton> ButtonsHeld = new HashSet<GamepadButton>();
        public readonly HashSet<GamepadButton> ButtonsUp = new HashSet<GamepadButton>();
        public Vector2 LeftStick = Vector2.Zero;
        public Vector2 RightStick = Vector2.Zero;
        public Vector2 Triggers = Vector2.Zero;

        public Gamepad(IntPtr handle)
        {
            Handle = handle;
        }
    }
}

public enum Key
{
    Return = '\r',
    Escape = 27,
    Backspace = '\b',
    Tab = '\t',
    Space = ' ',
    Exclamation = '!',
    DoubleQuote = '"',
    Hash = '#',
    Percent = '%',
    Dollar = '$',
    Ampersand = '&',
    SingleQuote = '\'',
    LeftParen = '(',
    RightParen = ')',
    Asterisk = '*',
    Plus = '+',
    Comma = ',',
    Minus = '-',
    Period = '.',
    Slash = '/',
    NumRow0 = '0',
    NumRow1 = '1',
    NumRow2 = '2',
    NumRow3 = '3',
    NumRow4 = '4',
    NumRow5 = '5',
    NumRow6 = '6',
    NumRow7 = '7',
    NumRow8 = '8',
    NumRow9 = '9',
    Colon = ':',
    Semicolon = ';',
    Less = '<',
    Equals = '=',
    Greater = '>',
    Question = '?',
    At = '@',
    LeftBracket = '[',
    Backslash = '\\',
    RightBracket = ']',
    Caret = '^',
    Underscore = '_',
    Backquote = '`',
    A = 'a',
    B = 'b',
    C = 'c',
    D = 'd',
    E = 'e',
    F = 'f',
    G = 'g',
    H = 'h',
    I = 'i',
    J = 'j',
    K = 'k',
    L = 'l',
    M = 'm',
    N = 'n',
    O = 'o',
    P = 'p',
    Q = 'q',
    R = 'r',
    S = 's',
    T = 't',
    U = 'u',
    V = 'v',
    W = 'w',
    X = 'x',
    Y = 'y',
    Z = 'z',
    CapsLock = SDL.SDL_Scancode.SDL_SCANCODE_CAPSLOCK | SDL.SDLK_SCANCODE_MASK,
    F1 = SDL.SDL_Scancode.SDL_SCANCODE_F1 | SDL.SDLK_SCANCODE_MASK,
    F2 = SDL.SDL_Scancode.SDL_SCANCODE_F2 | SDL.SDLK_SCANCODE_MASK,
    F3 = SDL.SDL_Scancode.SDL_SCANCODE_F3 | SDL.SDLK_SCANCODE_MASK,
    F4 = SDL.SDL_Scancode.SDL_SCANCODE_F4 | SDL.SDLK_SCANCODE_MASK,
    F5 = SDL.SDL_Scancode.SDL_SCANCODE_F5 | SDL.SDLK_SCANCODE_MASK,
    F6 = SDL.SDL_Scancode.SDL_SCANCODE_F6 | SDL.SDLK_SCANCODE_MASK,
    F7 = SDL.SDL_Scancode.SDL_SCANCODE_F7 | SDL.SDLK_SCANCODE_MASK,
    F8 = SDL.SDL_Scancode.SDL_SCANCODE_F8 | SDL.SDLK_SCANCODE_MASK,
    F9 = SDL.SDL_Scancode.SDL_SCANCODE_F9 | SDL.SDLK_SCANCODE_MASK,
    F10 = SDL.SDL_Scancode.SDL_SCANCODE_F10 | SDL.SDLK_SCANCODE_MASK,
    F11 = SDL.SDL_Scancode.SDL_SCANCODE_F11 | SDL.SDLK_SCANCODE_MASK,
    F12 = SDL.SDL_Scancode.SDL_SCANCODE_F12 | SDL.SDLK_SCANCODE_MASK,
    PrintScreen = SDL.SDL_Scancode.SDL_SCANCODE_PRINTSCREEN | SDL.SDLK_SCANCODE_MASK,
    ScrollLock = SDL.SDL_Scancode.SDL_SCANCODE_SCROLLLOCK | SDL.SDLK_SCANCODE_MASK,
    Pause = SDL.SDL_Scancode.SDL_SCANCODE_PAUSE | SDL.SDLK_SCANCODE_MASK,
    Insert = SDL.SDL_Scancode.SDL_SCANCODE_INSERT | SDL.SDLK_SCANCODE_MASK,
    Home = SDL.SDL_Scancode.SDL_SCANCODE_HOME | SDL.SDLK_SCANCODE_MASK,
    PageUp = SDL.SDL_Scancode.SDL_SCANCODE_PAGEUP | SDL.SDLK_SCANCODE_MASK,
    Delete = 127,
    End = SDL.SDL_Scancode.SDL_SCANCODE_END | SDL.SDLK_SCANCODE_MASK,
    PageDown = SDL.SDL_Scancode.SDL_SCANCODE_PAGEDOWN | SDL.SDLK_SCANCODE_MASK,
    Right = SDL.SDL_Scancode.SDL_SCANCODE_RIGHT | SDL.SDLK_SCANCODE_MASK,
    Left = SDL.SDL_Scancode.SDL_SCANCODE_LEFT | SDL.SDLK_SCANCODE_MASK,
    Down = SDL.SDL_Scancode.SDL_SCANCODE_DOWN | SDL.SDLK_SCANCODE_MASK,
    Up = SDL.SDL_Scancode.SDL_SCANCODE_UP | SDL.SDLK_SCANCODE_MASK,
    NumpadDivide = SDL.SDL_Scancode.SDL_SCANCODE_KP_DIVIDE | SDL.SDLK_SCANCODE_MASK,
    NumpadMultiply = SDL.SDL_Scancode.SDL_SCANCODE_KP_MULTIPLY | SDL.SDLK_SCANCODE_MASK,
    NumpadMinus = SDL.SDL_Scancode.SDL_SCANCODE_KP_MINUS | SDL.SDLK_SCANCODE_MASK,
    NumpadPlus = SDL.SDL_Scancode.SDL_SCANCODE_KP_PLUS | SDL.SDLK_SCANCODE_MASK,
    NumpadEnter = SDL.SDL_Scancode.SDL_SCANCODE_KP_ENTER | SDL.SDLK_SCANCODE_MASK,
    Numpad1 = SDL.SDL_Scancode.SDL_SCANCODE_KP_1 | SDL.SDLK_SCANCODE_MASK,
    Numpad2 = SDL.SDL_Scancode.SDL_SCANCODE_KP_2 | SDL.SDLK_SCANCODE_MASK,
    Numpad3 = SDL.SDL_Scancode.SDL_SCANCODE_KP_3 | SDL.SDLK_SCANCODE_MASK,
    Numpad4 = SDL.SDL_Scancode.SDL_SCANCODE_KP_4 | SDL.SDLK_SCANCODE_MASK,
    Numpad5 = SDL.SDL_Scancode.SDL_SCANCODE_KP_5 | SDL.SDLK_SCANCODE_MASK,
    Numpad6 = SDL.SDL_Scancode.SDL_SCANCODE_KP_6 | SDL.SDLK_SCANCODE_MASK,
    Numpad7 = SDL.SDL_Scancode.SDL_SCANCODE_KP_7 | SDL.SDLK_SCANCODE_MASK,
    Numpad8 = SDL.SDL_Scancode.SDL_SCANCODE_KP_8 | SDL.SDLK_SCANCODE_MASK,
    Numpad9 = SDL.SDL_Scancode.SDL_SCANCODE_KP_9 | SDL.SDLK_SCANCODE_MASK,
    Numpad0 = SDL.SDL_Scancode.SDL_SCANCODE_KP_0 | SDL.SDLK_SCANCODE_MASK,
    NumpadPeriod = SDL.SDL_Scancode.SDL_SCANCODE_KP_PERIOD | SDL.SDLK_SCANCODE_MASK,
    LeftControl = SDL.SDL_Scancode.SDL_SCANCODE_LCTRL | SDL.SDLK_SCANCODE_MASK,
    LeftShift = SDL.SDL_Scancode.SDL_SCANCODE_LSHIFT | SDL.SDLK_SCANCODE_MASK,
    LeftAlt = SDL.SDL_Scancode.SDL_SCANCODE_LALT | SDL.SDLK_SCANCODE_MASK,
    RightControl = SDL.SDL_Scancode.SDL_SCANCODE_RCTRL | SDL.SDLK_SCANCODE_MASK,
    RightShift = SDL.SDL_Scancode.SDL_SCANCODE_RSHIFT | SDL.SDLK_SCANCODE_MASK,
    RightAlt = SDL.SDL_Scancode.SDL_SCANCODE_RALT | SDL.SDLK_SCANCODE_MASK,
}

public enum MouseMode
{
    /// <summary>
    /// Show the cursor and allow it to move freely. The default mode.
    /// </summary>
    Visible,

    /// <summary>
    /// Hide the cursor and allow it to move freely. Useful for when you want to draw your own mouse cursor.
    /// </summary>
    Hidden,

    /// <summary>
    /// Hide the cursor and lock it to the center of the screen so that only MouseMotion is relevant. Useful for games like first-person shooters.
    /// </summary>
    Locked,
}

public enum MouseButton
{
    Left = 1,
    Middle = 2,
    Right = 3,
}

public enum GamepadButton
{
    A = 0,
    B,
    X,
    Y,
    Back,
    Guide,
    Start,
    LeftStick,
    RightStick,
    LeftShoulder,
    RightShoulder,
    Up,
    Down,
    Left,
    Right,
}

public enum GamepadAxis
{
    /// <summary>
    /// The left analog stick, with values from -1 to 1.
    /// </summary>
    LeftStick,

    /// <summary>
    /// The right analog stick, with values from -1 to 1. 
    /// </summary>
    RightStick,

    /// <summary>
    /// The analog triggers, with the left trigger in X, the right trigger in Y, and values from 0 to 1.
    /// </summary>
    Triggers,
}


================================================
FILE: Engine/SDL2/SDL2.cs
================================================
#region License
/* SDL2# - C# Wrapper for SDL2
 *
 * Copyright (c) 2013-2020 Ethan Lee.
 *
 * This software is provided 'as-is', without any express or implied warranty.
 * In no event will the authors be held liable for any damages arising from
 * the use of this software.
 *
 * Permission is granted to anyone to use this software for any purpose,
 * including commercial applications, and to alter it and redistribute it
 * freely, subject to the following restrictions:
 *
 * 1. The origin of this software must not be misrepresented; you must not
 * claim that you wrote the original software. If you use this software in a
 * product, an acknowledgment in the product documentation would be
 * appreciated but is not required.
 *
 * 2. Altered source versions must be plainly marked as such, and must not be
 * misrepresented as being the original software.
 *
 * 3. This notice may not be removed or altered from any source distribution.
 *
 * Ethan "flibitijibibo" Lee <flibitijibibo@flibitijibibo.com>
 *
 */
#endregion

#region Using Statements
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
#endregion

namespace SDL2
{
	public static class SDL
	{
		#region SDL2# Variables

		private const string nativeLibName = "SDL2";

		#endregion

		#region UTF8 Marshaling

		/* Used for stack allocated string marshaling. */
		internal static int Utf8Size(string str)
		{
			Debug.Assert(str != null);
			return (str.Length * 4) + 1;
		}
		internal static int Utf8SizeNullable(string str)
		{
			return str != null ? (str.Length * 4) + 1 : 0;
		}
		internal static unsafe byte* Utf8Encode(string str, byte* buffer, int bufferSize)
		{
			Debug.Assert(str != null);
			fixed (char* strPtr = str)
			{
				Encoding.UTF8.GetBytes(strPtr, str.Length + 1, buffer, bufferSize);
			}
			return buffer;
		}
		internal static unsafe byte* Utf8EncodeNullable(string str, byte* buffer, int bufferSize)
		{
			if (str == null)
			{
				return (byte*) 0;
			}
			fixed (char* strPtr = str)
			{
				Encoding.UTF8.GetBytes(strPtr, str.Length + 1, buffer, bufferSize);
			}
			return buffer;
		}

		/* Used for heap allocated string marshaling.
		 * Returned byte* must be free'd with FreeHGlobal.
		 */
		internal static unsafe byte* Utf8Encode(string str)
		{
			Debug.Assert(str != null);
			int bufferSize = Utf8Size(str);
			byte* buffer = (byte*) Marshal.AllocHGlobal(bufferSize);
			fixed (char* strPtr = str)
			{
				Encoding.UTF8.GetBytes(strPtr, str.Length + 1, buffer, bufferSize);
			}
			return buffer;
		}
		internal static unsafe byte* Utf8EncodeNullable(string str)
		{
			if (str == null)
			{
				return (byte*) 0;
			}
			int bufferSize = Utf8Size(str);
			byte* buffer = (byte*) Marshal.AllocHGlobal(bufferSize);
			fixed (char* strPtr = str)
			{
				Encoding.UTF8.GetBytes(
					strPtr,
					(str != null) ? (str.Length + 1) : 0,
					buffer,
					bufferSize
				);
			}
			return buffer;
		}

		/* This is public because SDL_DropEvent needs it! */
		public static unsafe string UTF8_ToManaged(IntPtr s, bool freePtr = false)
		{
			if (s == IntPtr.Zero)
			{
				return null;
			}

			/* We get to do strlen ourselves! */
			byte* ptr = (byte*) s;
			while (*ptr != 0)
			{
				ptr++;
			}

			/* TODO: This #ifdef is only here because the equivalent
			 * .NET 2.0 constructor appears to be less efficient?
			 * Here's the pretty version, maybe steal this instead:
			 *
			string result = new string(
				(sbyte*) s, // Also, why sbyte???
				0,
				(int) (ptr - (byte*) s),
				System.Text.Encoding.UTF8
			);
			 * See the CoreCLR source for more info.
			 * -flibit
			 */
#if NETSTANDARD2_0
			/* Modern C# lets you just send the byte*, nice! */
			string result = System.Text.Encoding.UTF8.GetString(
				(byte*) s,
				(int) (ptr - (byte*) s)
			);
#else
			/* Old C# requires an extra memcpy, bleh! */
			int len = (int) (ptr - (byte*) s);
			if (len == 0)
			{
				return string.Empty;
			}
			char* chars = stackalloc char[len];
			int strLen = System.Text.Encoding.UTF8.GetChars((byte*) s, len, chars, len);
			string result = new string(chars, 0, strLen);
#endif

			/* Some SDL functions will malloc, we have to free! */
			if (freePtr)
			{
				SDL_free(s);
			}
			return result;
		}

		#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
		}

		/* malloc/free are used by the marshaler! -flibit */

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		internal static extern IntPtr SDL_malloc(IntPtr size);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		internal static extern void SDL_free(IntPtr memblock);

		/* Buffer.BlockCopy is not available in every runtime yet. Also,
		 * using memcpy directly can be a compatibility issue in other
		 * strange ways. So, we expose this to get around all that.
		 * -flibit
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_memcpy(IntPtr dst, IntPtr src, IntPtr len);

		#endregion

		#region SDL_rwops.h

		public const int RW_SEEK_SET = 0;
		public const int RW_SEEK_CUR = 1;
		public const int RW_SEEK_END = 2;

		public const UInt32 SDL_RWOPS_UNKNOWN	= 0; /* Unknown stream type */
		public const UInt32 SDL_RWOPS_WINFILE	= 1; /* Win32 file */
		public const UInt32 SDL_RWOPS_STDFILE	= 2; /* Stdio file */
		public const UInt32 SDL_RWOPS_JNIFILE	= 3; /* Android asset */
		public const UInt32 SDL_RWOPS_MEMORY	= 4; /* Memory stream */
		public const UInt32 SDL_RWOPS_MEMORY_RO = 5; /* Read-Only memory stream */

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate long SDLRWopsSizeCallback(IntPtr context);

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate long SDLRWopsSeekCallback(
			IntPtr context,
			long offset,
			int whence
		);

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate IntPtr SDLRWopsReadCallback(
			IntPtr context,
			IntPtr ptr,
			IntPtr size,
			IntPtr maxnum
		);

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate IntPtr SDLRWopsWriteCallback(
			IntPtr context,
			IntPtr ptr,
			IntPtr size,
			IntPtr num
		);

		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate int SDLRWopsCloseCallback(
			IntPtr context
		);

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_RWops
		{
			public IntPtr size;
			public IntPtr seek;
			public IntPtr read;
			public IntPtr write;
			public IntPtr close;

			public UInt32 type;

			/* NOTE: This isn't the full structure since
			 * the native SDL_RWops contains a hidden union full of
			 * internal information and platform-specific stuff depending
			 * on what conditions the native library was built with
			 */
		}

		/* IntPtr refers to an SDL_RWops* */
		[DllImport(nativeLibName, EntryPoint = "SDL_RWFromFile", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe IntPtr INTERNAL_SDL_RWFromFile(
			byte* file,
			byte* mode
		);
		public static unsafe IntPtr SDL_RWFromFile(
			string file,
			string mode
		) {
			byte* utf8File = Utf8Encode(file);
			byte* utf8Mode = Utf8Encode(mode);
			IntPtr rwOps = INTERNAL_SDL_RWFromFile(
				utf8File,
				utf8Mode
			);
			Marshal.FreeHGlobal((IntPtr) utf8Mode);
			Marshal.FreeHGlobal((IntPtr) utf8File);
			return rwOps;
		}

		/* IntPtr refers to an SDL_RWops* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_AllocRW();

		/* area refers to an SDL_RWops* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_FreeRW(IntPtr area);

		/* fp refers to a void* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_RWFromFP(IntPtr fp, SDL_bool autoclose);

		/* mem refers to a void*, IntPtr to an SDL_RWops* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_RWFromMem(IntPtr mem, int size);

		/* mem refers to a const void*, IntPtr to an SDL_RWops* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_RWFromConstMem(IntPtr mem, int size);

		/* context refers to an SDL_RWops*.
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWsize(IntPtr context);

		/* context refers to an SDL_RWops*.
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWseek(
			IntPtr context,
			long offset,
			int whence
		);

		/* context refers to an SDL_RWops*.
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWtell(IntPtr context);

		/* context refers to an SDL_RWops*, ptr refers to a void*.
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWread(
			IntPtr context,
			IntPtr ptr,
			IntPtr size,
			IntPtr maxnum
		);

		/* context refers to an SDL_RWops*, ptr refers to a const void*.
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWwrite(
			IntPtr context,
			IntPtr ptr,
			IntPtr size,
			IntPtr maxnum
		);

		/* Read endian functions */

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern byte SDL_ReadU8(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt16 SDL_ReadLE16(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt16 SDL_ReadBE16(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt32 SDL_ReadLE32(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt32 SDL_ReadBE32(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt64 SDL_ReadLE64(IntPtr src);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern UInt64 SDL_ReadBE64(IntPtr src);

		/* Write endian functions */

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteU8(IntPtr dst, byte value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteLE16(IntPtr dst, UInt16 value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteBE16(IntPtr dst, UInt16 value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteLE32(IntPtr dst, UInt32 value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteBE32(IntPtr dst, UInt32 value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteLE64(IntPtr dst, UInt64 value);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WriteBE64(IntPtr dst, UInt64 value);

		/* context refers to an SDL_RWops*
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern long SDL_RWclose(IntPtr context);

		/* file refers to a const char*, datasize to a size_t*
		 * IntPtr refers to a void*
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_LoadFile(IntPtr file, IntPtr datasize);

		#endregion

		#region SDL_main.h

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_SetMainReady();

		/* This is used as a function pointer to a C main() function */
		public delegate int SDL_main_func(int argc, IntPtr argv);

		/* Use this function with UWP to call your C# Main() function! */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_WinRTRunApp(
			SDL_main_func mainFunction,
			IntPtr reserved
		);

		/* Use this function with iOS to call your C# Main() function!
		 * Only available in SDL 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_UIKitRunApp(
			int argc,
			IntPtr argv,
			SDL_main_func mainFunction
		);

		#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;
		public const uint SDL_INIT_JOYSTICK =		0x00000200;
		public const uint SDL_INIT_HAPTIC =		0x00001000;
		public const uint SDL_INIT_GAMECONTROLLER =	0x00002000;
		public const uint SDL_INIT_EVENTS =		0x00004000;
		public const uint SDL_INIT_SENSOR =		0x00008000;
		public const uint SDL_INIT_NOPARACHUTE =	0x00100000;
		public const uint SDL_INIT_EVERYTHING = (
			SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO |
			SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC |
			SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_Init(uint flags);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_InitSubSystem(uint flags);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_Quit();

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_QuitSubSystem(uint flags);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_WasInit(uint flags);

		#endregion

		#region SDL_platform.h

		[DllImport(nativeLibName, EntryPoint = "SDL_GetPlatform", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetPlatform();
		public static string SDL_GetPlatform()
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetPlatform());
		}

		#endregion

		#region SDL_hints.h

		public const string SDL_HINT_FRAMEBUFFER_ACCELERATION =
			"SDL_FRAMEBUFFER_ACCELERATION";
		public const string SDL_HINT_RENDER_DRIVER =
			"SDL_RENDER_DRIVER";
		public const string SDL_HINT_RENDER_OPENGL_SHADERS =
			"SDL_RENDER_OPENGL_SHADERS";
		public const string SDL_HINT_RENDER_DIRECT3D_THREADSAFE =
			"SDL_RENDER_DIRECT3D_THREADSAFE";
		public const string SDL_HINT_RENDER_VSYNC =
			"SDL_RENDER_VSYNC";
		public const string SDL_HINT_VIDEO_X11_XVIDMODE =
			"SDL_VIDEO_X11_XVIDMODE";
		public const string SDL_HINT_VIDEO_X11_XINERAMA =
			"SDL_VIDEO_X11_XINERAMA";
		public const string SDL_HINT_VIDEO_X11_XRANDR =
			"SDL_VIDEO_X11_XRANDR";
		public const string SDL_HINT_GRAB_KEYBOARD =
			"SDL_GRAB_KEYBOARD";
		public const string SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS =
			"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS";
		public const string SDL_HINT_IDLE_TIMER_DISABLED =
			"SDL_IOS_IDLE_TIMER_DISABLED";
		public const string SDL_HINT_ORIENTATIONS =
			"SDL_IOS_ORIENTATIONS";
		public const string SDL_HINT_XINPUT_ENABLED =
			"SDL_XINPUT_ENABLED";
		public const string SDL_HINT_GAMECONTROLLERCONFIG =
			"SDL_GAMECONTROLLERCONFIG";
		public const string SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS =
			"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS";
		public const string SDL_HINT_ALLOW_TOPMOST =
			"SDL_ALLOW_TOPMOST";
		public const string SDL_HINT_TIMER_RESOLUTION =
			"SDL_TIMER_RESOLUTION";
		public const string SDL_HINT_RENDER_SCALE_QUALITY =
			"SDL_RENDER_SCALE_QUALITY";

		/* Only available in SDL 2.0.1 or higher. */
		public const string SDL_HINT_VIDEO_HIGHDPI_DISABLED =
			"SDL_VIDEO_HIGHDPI_DISABLED";

		/* Only available in SDL 2.0.2 or higher. */
		public const string SDL_HINT_CTRL_CLICK_EMULATE_RIGHT_CLICK =
			"SDL_CTRL_CLICK_EMULATE_RIGHT_CLICK";
		public const string SDL_HINT_VIDEO_WIN_D3DCOMPILER =
			"SDL_VIDEO_WIN_D3DCOMPILER";
		public const string SDL_HINT_MOUSE_RELATIVE_MODE_WARP =
			"SDL_MOUSE_RELATIVE_MODE_WARP";
		public const string SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT =
			"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT";
		public const string SDL_HINT_VIDEO_ALLOW_SCREENSAVER =
			"SDL_VIDEO_ALLOW_SCREENSAVER";
		public const string SDL_HINT_ACCELEROMETER_AS_JOYSTICK =
			"SDL_ACCELEROMETER_AS_JOYSTICK";
		public const string SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES =
			"SDL_VIDEO_MAC_FULLSCREEN_SPACES";

		/* Only available in SDL 2.0.3 or higher. */
		public const string SDL_HINT_WINRT_PRIVACY_POLICY_URL =
			"SDL_WINRT_PRIVACY_POLICY_URL";
		public const string SDL_HINT_WINRT_PRIVACY_POLICY_LABEL =
			"SDL_WINRT_PRIVACY_POLICY_LABEL";
		public const string SDL_HINT_WINRT_HANDLE_BACK_BUTTON =
			"SDL_WINRT_HANDLE_BACK_BUTTON";

		/* Only available in SDL 2.0.4 or higher. */
		public const string SDL_HINT_NO_SIGNAL_HANDLERS =
			"SDL_NO_SIGNAL_HANDLERS";
		public const string SDL_HINT_IME_INTERNAL_EDITING =
			"SDL_IME_INTERNAL_EDITING";
		public const string SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH =
			"SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH";
		public const string SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT =
			"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT";
		public const string SDL_HINT_THREAD_STACK_SIZE =
			"SDL_THREAD_STACK_SIZE";
		public const string SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN =
			"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN";
		public const string SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP =
			"SDL_WINDOWS_ENABLE_MESSAGELOOP";
		public const string SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 =
			"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4";
		public const string SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING =
			"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING";
		public const string SDL_HINT_MAC_BACKGROUND_APP =
			"SDL_MAC_BACKGROUND_APP";
		public const string SDL_HINT_VIDEO_X11_NET_WM_PING =
			"SDL_VIDEO_X11_NET_WM_PING";
		public const string SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION =
			"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION";
		public const string SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION =
			"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION";

		/* Only available in 2.0.5 or higher. */
		public const string SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH =
			"SDL_MOUSE_FOCUS_CLICKTHROUGH";
		public const string SDL_HINT_BMP_SAVE_LEGACY_FORMAT =
			"SDL_BMP_SAVE_LEGACY_FORMAT";
		public const string SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING =
			"SDL_WINDOWS_DISABLE_THREAD_NAMING";
		public const string SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION =
			"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION";

		/* Only available in 2.0.6 or higher. */
		public const string SDL_HINT_AUDIO_RESAMPLING_MODE =
			"SDL_AUDIO_RESAMPLING_MODE";
		public const string SDL_HINT_RENDER_LOGICAL_SIZE_MODE =
			"SDL_RENDER_LOGICAL_SIZE_MODE";
		public const string SDL_HINT_MOUSE_NORMAL_SPEED_SCALE =
			"SDL_MOUSE_NORMAL_SPEED_SCALE";
		public const string SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE =
			"SDL_MOUSE_RELATIVE_SPEED_SCALE";
		public const string SDL_HINT_TOUCH_MOUSE_EVENTS =
			"SDL_TOUCH_MOUSE_EVENTS";
		public const string SDL_HINT_WINDOWS_INTRESOURCE_ICON =
			"SDL_WINDOWS_INTRESOURCE_ICON";
		public const string SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL =
			"SDL_WINDOWS_INTRESOURCE_ICON_SMALL";

		/* Only available in 2.0.8 or higher. */
		public const string SDL_HINT_IOS_HIDE_HOME_INDICATOR =
			"SDL_IOS_HIDE_HOME_INDICATOR";
		public const string SDL_HINT_TV_REMOTE_AS_JOYSTICK =
			"SDL_TV_REMOTE_AS_JOYSTICK";

		/* Only available in 2.0.9 or higher. */
		public const string SDL_HINT_MOUSE_DOUBLE_CLICK_TIME =
			"SDL_MOUSE_DOUBLE_CLICK_TIME";
		public const string SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS =
			"SDL_MOUSE_DOUBLE_CLICK_RADIUS";
		public const string SDL_HINT_JOYSTICK_HIDAPI =
			"SDL_JOYSTICK_HIDAPI";
		public const string SDL_HINT_JOYSTICK_HIDAPI_PS4 =
			"SDL_JOYSTICK_HIDAPI_PS4";
		public const string SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE =
			"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE";
		public const string SDL_HINT_JOYSTICK_HIDAPI_STEAM =
			"SDL_JOYSTICK_HIDAPI_STEAM";
		public const string SDL_HINT_JOYSTICK_HIDAPI_SWITCH =
			"SDL_JOYSTICK_HIDAPI_SWITCH";
		public const string SDL_HINT_JOYSTICK_HIDAPI_XBOX =
			"SDL_JOYSTICK_HIDAPI_XBOX";
		public const string SDL_HINT_ENABLE_STEAM_CONTROLLERS =
			"SDL_ENABLE_STEAM_CONTROLLERS";
		public const string SDL_HINT_ANDROID_TRAP_BACK_BUTTON =
			"SDL_ANDROID_TRAP_BACK_BUTTON";

		/* Only available in 2.0.10 or higher. */
		public const string SDL_HINT_MOUSE_TOUCH_EVENTS =
			"SDL_MOUSE_TOUCH_EVENTS";
		public const string SDL_HINT_GAMECONTROLLERCONFIG_FILE =
			"SDL_GAMECONTROLLERCONFIG_FILE";
		public const string SDL_HINT_ANDROID_BLOCK_ON_PAUSE =
			"SDL_ANDROID_BLOCK_ON_PAUSE";
		public const string SDL_HINT_RENDER_BATCHING =
			"SDL_RENDER_BATCHING";
		public const string SDL_HINT_EVENT_LOGGING =
			"SDL_EVENT_LOGGING";
		public const string SDL_HINT_WAVE_RIFF_CHUNK_SIZE =
			"SDL_WAVE_RIFF_CHUNK_SIZE";
		public const string SDL_HINT_WAVE_TRUNCATION =
			"SDL_WAVE_TRUNCATION";
		public const string SDL_HINT_WAVE_FACT_CHUNK =
			"SDL_WAVE_FACT_CHUNK";

		/* Only available in 2.0.11 or higher. */
		public const string SDL_HINT_VIDO_X11_WINDOW_VISUALID =
			"SDL_VIDEO_X11_WINDOW_VISUALID";
		public const string SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS =
			"SDL_GAMECONTROLLER_USE_BUTTON_LABELS";
		public const string SDL_HINT_VIDEO_EXTERNAL_CONTEXT =
			"SDL_VIDEO_EXTERNAL_CONTEXT";
		public const string SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE =
			"SDL_JOYSTICK_HIDAPI_GAMECUBE";
		public const string SDL_HINT_DISPLAY_USABLE_BOUNDS =
			"SDL_DISPLAY_USABLE_BOUNDS";
		public const string SDL_HINT_VIDEO_X11_FORCE_EGL =
			"SDL_VIDEO_X11_FORCE_EGL";
		public const string SDL_HINT_GAMECONTROLLERTYPE =
			"SDL_GAMECONTROLLERTYPE";

		public enum SDL_HintPriority
		{
			SDL_HINT_DEFAULT,
			SDL_HINT_NORMAL,
			SDL_HINT_OVERRIDE
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_ClearHints();

		[DllImport(nativeLibName, EntryPoint = "SDL_GetHint", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe IntPtr INTERNAL_SDL_GetHint(byte* name);
		public static unsafe string SDL_GetHint(string name)
		{
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];
			return UTF8_ToManaged(
				INTERNAL_SDL_GetHint(
					Utf8Encode(name, utf8Name, utf8NameBufSize)
				)
			);
		}

		[DllImport(nativeLibName, EntryPoint = "SDL_SetHint", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe SDL_bool INTERNAL_SDL_SetHint(
			byte* name,
			byte* value
		);
		public static unsafe SDL_bool SDL_SetHint(string name, string value)
		{
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];

			int utf8ValueBufSize = Utf8Size(value);
			byte* utf8Value = stackalloc byte[utf8ValueBufSize];

			return INTERNAL_SDL_SetHint(
				Utf8Encode(name, utf8Name, utf8NameBufSize),
				Utf8Encode(value, utf8Value, utf8ValueBufSize)
			);
		}

		[DllImport(nativeLibName, EntryPoint = "SDL_SetHintWithPriority", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe SDL_bool INTERNAL_SDL_SetHintWithPriority(
			byte* name,
			byte* value,
			SDL_HintPriority priority
		);
		public static unsafe SDL_bool SDL_SetHintWithPriority(
			string name,
			string value,
			SDL_HintPriority priority
		) {
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];

			int utf8ValueBufSize = Utf8Size(value);
			byte* utf8Value = stackalloc byte[utf8ValueBufSize];

			return INTERNAL_SDL_SetHintWithPriority(
				Utf8Encode(name, utf8Name, utf8NameBufSize),
				Utf8Encode(value, utf8Value, utf8ValueBufSize),
				priority
			);
		}

		/* Only available in 2.0.5 or higher. */
		[DllImport(nativeLibName, EntryPoint = "SDL_GetHintBoolean", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe SDL_bool INTERNAL_SDL_GetHintBoolean(
			byte* name,
			SDL_bool default_value
		);
		public static unsafe SDL_bool SDL_GetHintBoolean(
			string name,
			SDL_bool default_value
		) {
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];
			return INTERNAL_SDL_GetHintBoolean(
				Utf8Encode(name, utf8Name, utf8NameBufSize),
				default_value
			);
		}

		#endregion

		#region SDL_error.h

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_ClearError();

		[DllImport(nativeLibName, EntryPoint = "SDL_GetError", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetError();
		public static string SDL_GetError()
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetError());
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_SetError", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_SetError(byte* fmtAndArglist);
		public static unsafe void SDL_SetError(string fmtAndArglist)
		{
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_SetError(
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		#endregion

		#region SDL_log.h

		public enum SDL_LogCategory
		{
			SDL_LOG_CATEGORY_APPLICATION,
			SDL_LOG_CATEGORY_ERROR,
			SDL_LOG_CATEGORY_ASSERT,
			SDL_LOG_CATEGORY_SYSTEM,
			SDL_LOG_CATEGORY_AUDIO,
			SDL_LOG_CATEGORY_VIDEO,
			SDL_LOG_CATEGORY_RENDER,
			SDL_LOG_CATEGORY_INPUT,
			SDL_LOG_CATEGORY_TEST,

			/* Reserved for future SDL library use */
			SDL_LOG_CATEGORY_RESERVED1,
			SDL_LOG_CATEGORY_RESERVED2,
			SDL_LOG_CATEGORY_RESERVED3,
			SDL_LOG_CATEGORY_RESERVED4,
			SDL_LOG_CATEGORY_RESERVED5,
			SDL_LOG_CATEGORY_RESERVED6,
			SDL_LOG_CATEGORY_RESERVED7,
			SDL_LOG_CATEGORY_RESERVED8,
			SDL_LOG_CATEGORY_RESERVED9,
			SDL_LOG_CATEGORY_RESERVED10,

			/* Beyond this point is reserved for application use, e.g.
			enum {
				MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
				MYAPP_CATEGORY_AWESOME2,
				MYAPP_CATEGORY_AWESOME3,
				...
			};
			*/
			SDL_LOG_CATEGORY_CUSTOM
		}

		public enum SDL_LogPriority
		{
			SDL_LOG_PRIORITY_VERBOSE = 1,
			SDL_LOG_PRIORITY_DEBUG,
			SDL_LOG_PRIORITY_INFO,
			SDL_LOG_PRIORITY_WARN,
			SDL_LOG_PRIORITY_ERROR,
			SDL_LOG_PRIORITY_CRITICAL,
			SDL_NUM_LOG_PRIORITIES
		}

		/* userdata refers to a void*, message to a const char* */
		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate void SDL_LogOutputFunction(
			IntPtr userdata,
			int category,
			SDL_LogPriority priority,
			IntPtr message
		);

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_Log", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_Log(byte* fmtAndArglist);
		public static unsafe void SDL_Log(string fmtAndArglist)
		{
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_Log(
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogVerbose", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogVerbose(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogVerbose(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogVerbose(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogDebug", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogDebug(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogDebug(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogDebug(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogInfo", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogInfo(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogInfo(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogInfo(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogWarn", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogWarn(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogWarn(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogWarn(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogError", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogError(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogError(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogError(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogCritical", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogCritical(
			int category,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogCritical(
			int category,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogCritical(
				category,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogMessage", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogMessage(
			int category,
			SDL_LogPriority priority,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogMessage(
			int category,
			SDL_LogPriority priority,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogMessage(
				category,
				priority,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		/* Use string.Format for arglists */
		[DllImport(nativeLibName, EntryPoint = "SDL_LogMessageV", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_LogMessageV(
			int category,
			SDL_LogPriority priority,
			byte* fmtAndArglist
		);
		public static unsafe void SDL_LogMessageV(
			int category,
			SDL_LogPriority priority,
			string fmtAndArglist
		) {
			int utf8FmtAndArglistBufSize = Utf8Size(fmtAndArglist);
			byte* utf8FmtAndArglist = stackalloc byte[utf8FmtAndArglistBufSize];
			INTERNAL_SDL_LogMessageV(
				category,
				priority,
				Utf8Encode(fmtAndArglist, utf8FmtAndArglist, utf8FmtAndArglistBufSize)
			);
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_LogPriority SDL_LogGetPriority(
			int category
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_LogSetPriority(
			int category,
			SDL_LogPriority priority
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_LogSetAllPriority(
			SDL_LogPriority priority
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_LogResetPriorities();

		/* userdata refers to a void* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		private static extern void SDL_LogGetOutputFunction(
			out IntPtr callback,
			out IntPtr userdata
		);
		public static void SDL_LogGetOutputFunction(
			out SDL_LogOutputFunction callback,
			out IntPtr userdata
		) {
			IntPtr result = IntPtr.Zero;
			SDL_LogGetOutputFunction(
				out result,
				out userdata
			);
			if (result != IntPtr.Zero)
			{
				callback = (SDL_LogOutputFunction) Marshal.GetDelegateForFunctionPointer(
					result,
					typeof(SDL_LogOutputFunction)
				);
			}
			else
			{
				callback = null;
			}
		}

		/* userdata refers to a void* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_LogSetOutputFunction(
			SDL_LogOutputFunction callback,
			IntPtr userdata
		);

		#endregion

		#region SDL_messagebox.h

		[Flags]
		public enum SDL_MessageBoxFlags : uint
		{
			SDL_MESSAGEBOX_ERROR =		0x00000010,
			SDL_MESSAGEBOX_WARNING =	0x00000020,
			SDL_MESSAGEBOX_INFORMATION =	0x00000040
		}

		[Flags]
		public enum SDL_MessageBoxButtonFlags : uint
		{
			SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001,
			SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002
		}

		[StructLayout(LayoutKind.Sequential)]
		private struct INTERNAL_SDL_MessageBoxButtonData
		{
			public SDL_MessageBoxButtonFlags flags;
			public int buttonid;
			public IntPtr text; /* The UTF-8 button text */
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MessageBoxButtonData
		{
			public SDL_MessageBoxButtonFlags flags;
			public int buttonid;
			public string text; /* The UTF-8 button text */
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MessageBoxColor
		{
			public byte r, g, b;
		}

		public enum SDL_MessageBoxColorType
		{
			SDL_MESSAGEBOX_COLOR_BACKGROUND,
			SDL_MESSAGEBOX_COLOR_TEXT,
			SDL_MESSAGEBOX_COLOR_BUTTON_BORDER,
			SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND,
			SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED,
			SDL_MESSAGEBOX_COLOR_MAX
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MessageBoxColorScheme
		{
			[MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct, SizeConst = (int)SDL_MessageBoxColorType.SDL_MESSAGEBOX_COLOR_MAX)]
				public SDL_MessageBoxColor[] colors;
		}

		[StructLayout(LayoutKind.Sequential)]
		private struct INTERNAL_SDL_MessageBoxData
		{
			public SDL_MessageBoxFlags flags;
			public IntPtr window;				/* Parent window, can be NULL */
			public IntPtr title;				/* UTF-8 title */
			public IntPtr message;				/* UTF-8 message text */
			public int numbuttons;
			public IntPtr buttons;
			public IntPtr colorScheme;			/* Can be NULL to use system settings */
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MessageBoxData
		{
			public SDL_MessageBoxFlags flags;
			public IntPtr window;				/* Parent window, can be NULL */
			public string title;				/* UTF-8 title */
			public string message;				/* UTF-8 message text */
			public int numbuttons;
			public SDL_MessageBoxButtonData[] buttons;
			public SDL_MessageBoxColorScheme? colorScheme;	/* Can be NULL to use system settings */
		}

		[DllImport(nativeLibName, EntryPoint = "SDL_ShowMessageBox", CallingConvention = CallingConvention.Cdecl)]
		private static extern int INTERNAL_SDL_ShowMessageBox([In()] ref INTERNAL_SDL_MessageBoxData messageboxdata, out int buttonid);

		/* Ripped from Jameson's LpUtf8StrMarshaler */
		private static IntPtr INTERNAL_AllocUTF8(string str)
		{
			if (string.IsNullOrEmpty(str))
			{
				return IntPtr.Zero;
			}
			byte[] bytes = System.Text.Encoding.UTF8.GetBytes(str + '\0');
			IntPtr mem = SDL.SDL_malloc((IntPtr) bytes.Length);
			Marshal.Copy(bytes, 0, mem, bytes.Length);
			return mem;
		}

		public static unsafe int SDL_ShowMessageBox([In()] ref SDL_MessageBoxData messageboxdata, out int buttonid)
		{
			var data = new INTERNAL_SDL_MessageBoxData()
			{
				flags = messageboxdata.flags,
				window = messageboxdata.window,
				title = INTERNAL_AllocUTF8(messageboxdata.title),
				message = INTERNAL_AllocUTF8(messageboxdata.message),
				numbuttons = messageboxdata.numbuttons,
			};

			var buttons = new INTERNAL_SDL_MessageBoxButtonData[messageboxdata.numbuttons];
			for (int i = 0; i < messageboxdata.numbuttons; i++)
			{
				buttons[i] = new INTERNAL_SDL_MessageBoxButtonData()
				{
					flags = messageboxdata.buttons[i].flags,
					buttonid = messageboxdata.buttons[i].buttonid,
					text = INTERNAL_AllocUTF8(messageboxdata.buttons[i].text),
				};
			}

			if (messageboxdata.colorScheme != null)
			{
				data.colorScheme = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SDL_MessageBoxColorScheme)));
				Marshal.StructureToPtr(messageboxdata.colorScheme.Value, data.colorScheme, false);
			}

			int result;
			fixed (INTERNAL_SDL_MessageBoxButtonData* buttonsPtr = &buttons[0])
			{
				data.buttons = (IntPtr)buttonsPtr;
				result = INTERNAL_SDL_ShowMessageBox(ref data, out buttonid);
			}

			Marshal.FreeHGlobal(data.colorScheme);
			for (int i = 0; i < messageboxdata.numbuttons; i++)
			{
				SDL_free(buttons[i].text);
			}
			SDL_free(data.message);
			SDL_free(data.title);

			return result;
		}

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, EntryPoint = "SDL_ShowSimpleMessageBox", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe int INTERNAL_SDL_ShowSimpleMessageBox(
			SDL_MessageBoxFlags flags,
			byte* title,
			byte* message,
			IntPtr window
		);
		public static unsafe int SDL_ShowSimpleMessageBox(
			SDL_MessageBoxFlags flags,
			string title,
			string message,
			IntPtr window
		) {
			int utf8TitleBufSize = Utf8SizeNullable(title);
			byte* utf8Title = stackalloc byte[utf8TitleBufSize];

			int utf8MessageBufSize = Utf8SizeNullable(message);
			byte* utf8Message = stackalloc byte[utf8MessageBufSize];

			return INTERNAL_SDL_ShowSimpleMessageBox(
				flags,
				Utf8EncodeNullable(title, utf8Title, utf8TitleBufSize),
				Utf8EncodeNullable(message, utf8Message, utf8MessageBufSize),
				window
			);
		}

		#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!
		 */
		public const int SDL_MAJOR_VERSION =	2;
		public const int SDL_MINOR_VERSION =	0;
		public const int SDL_PATCHLEVEL =	12;

		public static readonly int SDL_COMPILEDVERSION = SDL_VERSIONNUM(
			SDL_MAJOR_VERSION,
			SDL_MINOR_VERSION,
			SDL_PATCHLEVEL
		);

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_version
		{
			public byte major;
			public byte minor;
			public byte patch;
		}

		public static void SDL_VERSION(out SDL_version x)
		{
			x.major = SDL_MAJOR_VERSION;
			x.minor = SDL_MINOR_VERSION;
			x.patch = SDL_PATCHLEVEL;
		}

		public static int SDL_VERSIONNUM(int X, int Y, int Z)
		{
			return (X * 1000) + (Y * 100) + Z;
		}

		public static bool SDL_VERSION_ATLEAST(int X, int Y, int Z)
		{
			return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetVersion(out SDL_version ver);

		[DllImport(nativeLibName, EntryPoint = "SDL_GetRevision", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetRevision();
		public static string SDL_GetRevision()
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetRevision());
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetRevisionNumber();

		#endregion

		#region SDL_video.h

		public enum SDL_GLattr
		{
			SDL_GL_RED_SIZE,
			SDL_GL_GREEN_SIZE,
			SDL_GL_BLUE_SIZE,
			SDL_GL_ALPHA_SIZE,
			SDL_GL_BUFFER_SIZE,
			SDL_GL_DOUBLEBUFFER,
			SDL_GL_DEPTH_SIZE,
			SDL_GL_STENCIL_SIZE,
			SDL_GL_ACCUM_RED_SIZE,
			SDL_GL_ACCUM_GREEN_SIZE,
			SDL_GL_ACCUM_BLUE_SIZE,
			SDL_GL_ACCUM_ALPHA_SIZE,
			SDL_GL_STEREO,
			SDL_GL_MULTISAMPLEBUFFERS,
			SDL_GL_MULTISAMPLESAMPLES,
			SDL_GL_ACCELERATED_VISUAL,
			SDL_GL_RETAINED_BACKING,
			SDL_GL_CONTEXT_MAJOR_VERSION,
			SDL_GL_CONTEXT_MINOR_VERSION,
			SDL_GL_CONTEXT_EGL,
			SDL_GL_CONTEXT_FLAGS,
			SDL_GL_CONTEXT_PROFILE_MASK,
			SDL_GL_SHARE_WITH_CURRENT_CONTEXT,
			SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
			SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
			SDL_GL_CONTEXT_RESET_NOTIFICATION,	/* Requires >= 2.0.6 */
			SDL_GL_CONTEXT_NO_ERROR,		/* Requires >= 2.0.6 */
		}

		[Flags]
		public enum SDL_GLprofile
		{
			SDL_GL_CONTEXT_PROFILE_CORE				= 0x0001,
			SDL_GL_CONTEXT_PROFILE_COMPATIBILITY	= 0x0002,
			SDL_GL_CONTEXT_PROFILE_ES				= 0x0004
		}

		[Flags]
		public enum SDL_GLcontext
		{
			SDL_GL_CONTEXT_DEBUG_FLAG				= 0x0001,
			SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG	= 0x0002,
			SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG		= 0x0004,
			SDL_GL_CONTEXT_RESET_ISOLATION_FLAG		= 0x0008
		}

		public enum SDL_WindowEventID : byte
		{
			SDL_WINDOWEVENT_NONE,
			SDL_WINDOWEVENT_SHOWN,
			SDL_WINDOWEVENT_HIDDEN,
			SDL_WINDOWEVENT_EXPOSED,
			SDL_WINDOWEVENT_MOVED,
			SDL_WINDOWEVENT_RESIZED,
			SDL_WINDOWEVENT_SIZE_CHANGED,
			SDL_WINDOWEVENT_MINIMIZED,
			SDL_WINDOWEVENT_MAXIMIZED,
			SDL_WINDOWEVENT_RESTORED,
			SDL_WINDOWEVENT_ENTER,
			SDL_WINDOWEVENT_LEAVE,
			SDL_WINDOWEVENT_FOCUS_GAINED,
			SDL_WINDOWEVENT_FOCUS_LOST,
			SDL_WINDOWEVENT_CLOSE,
			/* Only available in 2.0.5 or higher. */
			SDL_WINDOWEVENT_TAKE_FOCUS,
			SDL_WINDOWEVENT_HIT_TEST
		}

		public enum SDL_DisplayEventID : byte
		{
			SDL_DISPLAYEVENT_NONE,
			SDL_DISPLAYEVENT_ORIENTATION
		}

		public enum SDL_DisplayOrientation
		{
			SDL_ORIENTATION_UNKNOWN,
			SDL_ORIENTATION_LANDSCAPE,
			SDL_ORIENTATION_LANDSCAPE_FLIPPED,
			SDL_ORIENTATION_PORTRAIT,
			SDL_ORIENTATION_PORTRAIT_FLIPPED
		}

		[Flags]
		public enum SDL_WindowFlags : uint
		{
			SDL_WINDOW_FULLSCREEN =		0x00000001,
			SDL_WINDOW_OPENGL =		0x00000002,
			SDL_WINDOW_SHOWN =		0x00000004,
			SDL_WINDOW_HIDDEN =		0x00000008,
			SDL_WINDOW_BORDERLESS =		0x00000010,
			SDL_WINDOW_RESIZABLE =		0x00000020,
			SDL_WINDOW_MINIMIZED =		0x00000040,
			SDL_WINDOW_MAXIMIZED =		0x00000080,
			SDL_WINDOW_INPUT_GRABBED =	0x00000100,
			SDL_WINDOW_INPUT_FOCUS =	0x00000200,
			SDL_WINDOW_MOUSE_FOCUS =	0x00000400,
			SDL_WINDOW_FULLSCREEN_DESKTOP =
				(SDL_WINDOW_FULLSCREEN | 0x00001000),
			SDL_WINDOW_FOREIGN =		0x00000800,
			SDL_WINDOW_ALLOW_HIGHDPI =	0x00002000,	/* Requires >= 2.0.1 */
			SDL_WINDOW_MOUSE_CAPTURE =	0x00004000,	/* Requires >= 2.0.4 */
			SDL_WINDOW_ALWAYS_ON_TOP =	0x00008000,	/* Requires >= 2.0.5 */
			SDL_WINDOW_SKIP_TASKBAR =	0x00010000,	/* Requires >= 2.0.5 */
			SDL_WINDOW_UTILITY =		0x00020000,	/* Requires >= 2.0.5 */
			SDL_WINDOW_TOOLTIP =		0x00040000,	/* Requires >= 2.0.5 */
			SDL_WINDOW_POPUP_MENU =		0x00080000,	/* Requires >= 2.0.5 */
			SDL_WINDOW_VULKAN =		0x10000000,	/* Requires >= 2.0.6 */
		}

		/* Only available in 2.0.4 or higher. */
		public enum SDL_HitTestResult
		{
			SDL_HITTEST_NORMAL,		/* Region is normal. No special properties. */
			SDL_HITTEST_DRAGGABLE,		/* Region can drag entire window. */
			SDL_HITTEST_RESIZE_TOPLEFT,
			SDL_HITTEST_RESIZE_TOP,
			SDL_HITTEST_RESIZE_TOPRIGHT,
			SDL_HITTEST_RESIZE_RIGHT,
			SDL_HITTEST_RESIZE_BOTTOMRIGHT,
			SDL_HITTEST_RESIZE_BOTTOM,
			SDL_HITTEST_RESIZE_BOTTOMLEFT,
			SDL_HITTEST_RESIZE_LEFT
		}

		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;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_DisplayMode
		{
			public uint format;
			public int w;
			public int h;
			public int refresh_rate;
			public IntPtr driverdata; // void*
		}

		/* win refers to an SDL_Window*, area to a const SDL_Point*, data to a void*.
		 * Only available in 2.0.4 or higher.
		 */
		[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
		public delegate SDL_HitTestResult SDL_HitTest(IntPtr win, IntPtr area, IntPtr data);

		/* IntPtr refers to an SDL_Window* */
		[DllImport(nativeLibName, EntryPoint = "SDL_CreateWindow", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe IntPtr INTERNAL_SDL_CreateWindow(
			byte* title,
			int x,
			int y,
			int w,
			int h,
			SDL_WindowFlags flags
		);
		public static unsafe IntPtr SDL_CreateWindow(
			string title,
			int x,
			int y,
			int w,
			int h,
			SDL_WindowFlags flags
		) {
			int utf8TitleBufSize = Utf8SizeNullable(title);
			byte* utf8Title = stackalloc byte[utf8TitleBufSize];
			return INTERNAL_SDL_CreateWindow(
				Utf8EncodeNullable(title, utf8Title, utf8TitleBufSize),
				x, y, w, h,
				flags
			);
		}

		/* window refers to an SDL_Window*, renderer to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_CreateWindowAndRenderer(
			int width,
			int height,
			SDL_WindowFlags window_flags,
			out IntPtr window,
			out IntPtr renderer
		);

		/* data refers to some native window type, IntPtr to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateWindowFrom(IntPtr data);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_DestroyWindow(IntPtr window);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_DisableScreenSaver();

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_EnableScreenSaver();

		/* IntPtr refers to an SDL_DisplayMode. Just use closest. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GetClosestDisplayMode(
			int displayIndex,
			ref SDL_DisplayMode mode,
			out SDL_DisplayMode closest
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetCurrentDisplayMode(
			int displayIndex,
			out SDL_DisplayMode mode
		);

		[DllImport(nativeLibName, EntryPoint = "SDL_GetCurrentVideoDriver", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetCurrentVideoDriver();
		public static string SDL_GetCurrentVideoDriver()
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetCurrentVideoDriver());
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetDesktopDisplayMode(
			int displayIndex,
			out SDL_DisplayMode mode
		);

		[DllImport(nativeLibName, EntryPoint = "SDL_GetDisplayName", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetDisplayName(int index);
		public static string SDL_GetDisplayName(int index)
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetDisplayName(index));
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetDisplayBounds(
			int displayIndex,
			out SDL_Rect rect
		);

		/* Only available in 2.0.4 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetDisplayDPI(
			int displayIndex,
			out float ddpi,
			out float hdpi,
			out float vdpi
		);

		/* Only available in 2.0.9 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_DisplayOrientation SDL_GetDisplayOrientation(
			int displayIndex
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetDisplayMode(
			int displayIndex,
			int modeIndex,
			out SDL_DisplayMode mode
		);

		/* Only available in 2.0.5 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetDisplayUsableBounds(
			int displayIndex,
			out SDL_Rect rect
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetNumDisplayModes(
			int displayIndex
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetNumVideoDisplays();

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetNumVideoDrivers();

		[DllImport(nativeLibName, EntryPoint = "SDL_GetVideoDriver", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetVideoDriver(
			int index
		);
		public static string SDL_GetVideoDriver(int index)
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetVideoDriver(index));
		}

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern float SDL_GetWindowBrightness(
			IntPtr window
		);

		/* window refers to an SDL_Window*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetWindowOpacity(
			IntPtr window,
			float opacity
		);

		/* window refers to an SDL_Window*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetWindowOpacity(
			IntPtr window,
			out float out_opacity
		);

		/* modal_window and parent_window refer to an SDL_Window*s
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetWindowModalFor(
			IntPtr modal_window,
			IntPtr parent_window
		);

		/* window refers to an SDL_Window*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetWindowInputFocus(IntPtr window);

		/* window refers to an SDL_Window*, IntPtr to a void* */
		[DllImport(nativeLibName, EntryPoint = "SDL_GetWindowData", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe IntPtr INTERNAL_SDL_GetWindowData(
			IntPtr window,
			byte* name
		);
		public static unsafe IntPtr SDL_GetWindowData(
			IntPtr window,
			string name
		) {
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];
			return INTERNAL_SDL_GetWindowData(
				window,
				Utf8Encode(name, utf8Name, utf8NameBufSize)
			);
		}

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetWindowDisplayIndex(
			IntPtr window
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetWindowDisplayMode(
			IntPtr window,
			out SDL_DisplayMode mode
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_GetWindowFlags(IntPtr window);

		/* IntPtr refers to an SDL_Window* */
		[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(
			IntPtr window,
			[Out()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)]
				ushort[] red,
			[Out()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)]
				ushort[] green,
			[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_GetWindowMaximumSize(
			IntPtr window,
			out int max_w,
			out int max_h
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetWindowMinimumSize(
			IntPtr window,
			out int min_w,
			out int min_h
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetWindowPosition(
			IntPtr window,
			out int x,
			out int y
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetWindowSize(
			IntPtr window,
			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, EntryPoint = "SDL_GetWindowTitle", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetWindowTitle(
			IntPtr window
		);
		public static string SDL_GetWindowTitle(IntPtr window)
		{
			return UTF8_ToManaged(
				INTERNAL_SDL_GetWindowTitle(window)
			);
		}

		/* texture refers to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GL_BindTexture(
			IntPtr texture,
			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);

		[DllImport(nativeLibName, EntryPoint = "SDL_GL_LoadLibrary", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe int INTERNAL_SDL_GL_LoadLibrary(byte* path);
		public static unsafe int SDL_GL_LoadLibrary(string path)
		{
			byte* utf8Path = Utf8Encode(path);
			int result = INTERNAL_SDL_GL_LoadLibrary(
				utf8Path
			);
			Marshal.FreeHGlobal((IntPtr) utf8Path);
			return result;
		}

		/* IntPtr refers to a function pointer, proc to a const char* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GL_GetProcAddress(IntPtr proc);

		/* IntPtr refers to a function pointer */
		public static unsafe IntPtr SDL_GL_GetProcAddress(string proc)
		{
			int utf8ProcBufSize = Utf8Size(proc);
			byte* utf8Proc = stackalloc byte[utf8ProcBufSize];
			return SDL_GL_GetProcAddress(
				(IntPtr) Utf8Encode(proc, utf8Proc, utf8ProcBufSize)
			);
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GL_UnloadLibrary();

		[DllImport(nativeLibName, EntryPoint = "SDL_GL_ExtensionSupported", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe SDL_bool INTERNAL_SDL_GL_ExtensionSupported(
			byte* extension
		);
		public static unsafe SDL_bool SDL_GL_ExtensionSupported(string extension)
		{
			int utf8ExtensionBufSize = Utf8SizeNullable(extension);
			byte* utf8Extension = stackalloc byte[utf8ExtensionBufSize];
			return INTERNAL_SDL_GL_ExtensionSupported(
				Utf8Encode(extension, utf8Extension, utf8ExtensionBufSize)
			);
		}

		/* Only available in SDL 2.0.2 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GL_ResetAttributes();

		[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
		);

		/* IntPtr refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GL_GetCurrentWindow();

		/* IntPtr refers to an SDL_Context */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GL_GetCurrentContext();

		/* window refers to an SDL_Window*.
		 * Only available in SDL 2.0.1 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GL_GetDrawableSize(
			IntPtr window,
			out int w,
			out int h
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GL_SetAttribute(
			SDL_GLattr attr,
			int value
		);

		public static int SDL_GL_SetAttribute(
			SDL_GLattr attr,
			SDL_GLprofile profile
		) {
			return SDL_GL_SetAttribute(attr, (int)profile);
		}

		[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, EntryPoint = "SDL_SetWindowData", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe IntPtr INTERNAL_SDL_SetWindowData(
			IntPtr window,
			byte* name,
			IntPtr userdata
		);
		public static unsafe IntPtr SDL_SetWindowData(
			IntPtr window,
			string name,
			IntPtr userdata
		) {
			int utf8NameBufSize = Utf8Size(name);
			byte* utf8Name = stackalloc byte[utf8NameBufSize];
			return INTERNAL_SDL_SetWindowData(
				window,
				Utf8Encode(name, utf8Name, utf8NameBufSize),
				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(
			IntPtr window,
			[In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)]
				ushort[] red,
			[In()] [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeConst = 256)]
				ushort[] green,
			[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_SetWindowMaximumSize(
			IntPtr window,
			int max_w,
			int max_h
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_SetWindowMinimumSize(
			IntPtr window,
			int min_w,
			int min_h
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_SetWindowPosition(
			IntPtr window,
			int x,
			int y
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_SetWindowSize(
			IntPtr window,
			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 int SDL_GetWindowBordersSize(
			IntPtr window,
			out int top,
			out int left,
			out int bottom,
			out int right
		);

		/* window refers to an SDL_Window*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_SetWindowResizable(
			IntPtr window,
			SDL_bool resizable
		);

		/* window refers to an SDL_Window* */
		[DllImport(nativeLibName, EntryPoint = "SDL_SetWindowTitle", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe void INTERNAL_SDL_SetWindowTitle(
			IntPtr window,
			byte* title
		);
		public static unsafe void SDL_SetWindowTitle(
			IntPtr window,
			string title
		) {
			int utf8TitleBufSize = Utf8Size(title);
			byte* utf8Title = stackalloc byte[utf8TitleBufSize];
			INTERNAL_SDL_SetWindowTitle(
				window,
				Utf8Encode(title, utf8Title, utf8TitleBufSize)
			);
		}

		/* 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(
			IntPtr window,
			[In] SDL_Rect[] rects,
			int numrects
		);

		[DllImport(nativeLibName, EntryPoint = "SDL_VideoInit", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe int INTERNAL_SDL_VideoInit(
			byte* driver_name
		);
		public static unsafe int SDL_VideoInit(string driver_name)
		{
			int utf8DriverNameBufSize = Utf8Size(driver_name);
			byte* utf8DriverName = stackalloc byte[utf8DriverNameBufSize];
			return INTERNAL_SDL_VideoInit(
				Utf8Encode(driver_name, utf8DriverName, utf8DriverNameBufSize)
			);
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_VideoQuit();

		/* window refers to an SDL_Window*, callback_data to a void*
		 * Only available in 2.0.4 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetWindowHitTest(
			IntPtr window,
			SDL_HitTest callback,
			IntPtr callback_data
		);

		/* IntPtr refers to an SDL_Window*
		 * Only available in 2.0.4 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GetGrabbedWindow();

		#endregion

		#region SDL_blendmode.h

		[Flags]
		public enum SDL_BlendMode
		{
			SDL_BLENDMODE_NONE =	0x00000000,
			SDL_BLENDMODE_BLEND =	0x00000001,
			SDL_BLENDMODE_ADD =	0x00000002,
			SDL_BLENDMODE_MOD =	0x00000004,
			SDL_BLENDMODE_MUL =	0x00000008,	/* >= 2.0.11 */
			SDL_BLENDMODE_INVALID =	0x7FFFFFFF
		}

		public enum SDL_BlendOperation
		{
			SDL_BLENDOPERATION_ADD		= 0x1,
			SDL_BLENDOPERATION_SUBTRACT	= 0x2,
			SDL_BLENDOPERATION_REV_SUBTRACT	= 0x3,
			SDL_BLENDOPERATION_MINIMUM	= 0x4,
			SDL_BLENDOPERATION_MAXIMUM	= 0x5
		}

		public enum SDL_BlendFactor
		{
			SDL_BLENDFACTOR_ZERO			= 0x1,
			SDL_BLENDFACTOR_ONE			= 0x2,
			SDL_BLENDFACTOR_SRC_COLOR		= 0x3,
			SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR	= 0x4,
			SDL_BLENDFACTOR_SRC_ALPHA		= 0x5,
			SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA	= 0x6,
			SDL_BLENDFACTOR_DST_COLOR		= 0x7,
			SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR	= 0x8,
			SDL_BLENDFACTOR_DST_ALPHA		= 0x9,
			SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA	= 0xA
		}

		/* Only available in 2.0.6 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_BlendMode SDL_ComposeCustomBlendMode(
			SDL_BlendFactor srcColorFactor,
			SDL_BlendFactor dstColorFactor,
			SDL_BlendOperation colorOperation,
			SDL_BlendFactor srcAlphaFactor,
			SDL_BlendFactor dstAlphaFactor,
			SDL_BlendOperation alphaOperation
		);

		#endregion

		#region SDL_vulkan.h

		/* Only available in 2.0.6 or higher. */
		[DllImport(nativeLibName, EntryPoint = "SDL_Vulkan_LoadLibrary", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe int INTERNAL_SDL_Vulkan_LoadLibrary(
			byte* path
		);
		public static unsafe int SDL_Vulkan_LoadLibrary(string path)
		{
			byte* utf8Path = Utf8Encode(path);
			int result = INTERNAL_SDL_Vulkan_LoadLibrary(
				utf8Path
			);
			Marshal.FreeHGlobal((IntPtr) utf8Path);
			return result;
		}

		/* Only available in 2.0.6 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_Vulkan_GetVkGetInstanceProcAddr();

		/* Only available in 2.0.6 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_Vulkan_UnloadLibrary();

		/* window refers to an SDL_Window*, pNames to a const char**.
		 * Only available in 2.0.6 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_Vulkan_GetInstanceExtensions(
			IntPtr window,
			out uint pCount,
			IntPtr[] pNames
		);

		/* window refers to an SDL_Window.
		 * instance refers to a VkInstance.
		 * surface refers to a VkSurfaceKHR.
		 * Only available in 2.0.6 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_Vulkan_CreateSurface(
			IntPtr window,
			IntPtr instance,
			out ulong surface
		);

		/* window refers to an SDL_Window*.
		 * Only available in 2.0.6 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_Vulkan_GetDrawableSize(
			IntPtr window,
			out int w,
			out int h
		);

		#endregion

		#region SDL_metal.h

		/* Only available in 2.0.11 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_Metal_CreateView(
			IntPtr window
		);

		/* Only available in 2.0.11 or higher. */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_Metal_DestroyView(
			IntPtr view
		);

		#endregion

		#region SDL_render.h

		[Flags]
		public enum SDL_RendererFlags : uint
		{
			SDL_RENDERER_SOFTWARE =		0x00000001,
			SDL_RENDERER_ACCELERATED =	0x00000002,
			SDL_RENDERER_PRESENTVSYNC =	0x00000004,
			SDL_RENDERER_TARGETTEXTURE =	0x00000008
		}

		[Flags]
		public enum SDL_RendererFlip
		{
			SDL_FLIP_NONE =		0x00000000,
			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
		{
			SDL_TEXTUREMODULATE_NONE =		0x00000000,
			SDL_TEXTUREMODULATE_HORIZONTAL =	0x00000001,
			SDL_TEXTUREMODULATE_VERTICAL =		0x00000002
		}

		[StructLayout(LayoutKind.Sequential)]
		public unsafe struct SDL_RendererInfo
		{
			public IntPtr name; // const char*
			public uint flags;
			public uint num_texture_formats;
			public fixed uint texture_formats[16];
			public int max_texture_width;
			public int max_texture_height;
		}

		/* Only available in 2.0.11 or higher. */
		public enum SDL_ScaleMode
		{
			SDL_ScaleModeNearest,
			SDL_ScaleModeLinear,
			SDL_ScaleModeBest
		}

		/* IntPtr refers to an SDL_Renderer*, window to an SDL_Window* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateRenderer(
			IntPtr window,
			int index,
			SDL_RendererFlags flags
		);

		/* IntPtr refers to an SDL_Renderer*, surface to an SDL_Surface* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateSoftwareRenderer(IntPtr surface);

		/* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateTexture(
			IntPtr renderer,
			uint format,
			int access,
			int w,
			int h
		);

		/* IntPtr refers to an SDL_Texture*
		 * renderer refers to an SDL_Renderer*
		 * surface refers to an SDL_Surface*
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateTextureFromSurface(
			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
		);

		/* texture refers to an SDL_Texture*
		 * Only available in 2.0.11 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetTextureScaleMode(
			IntPtr texture,
			SDL_ScaleMode scaleMode
		);

		/* texture refers to an SDL_Texture*
		 * Only available in 2.0.11 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetTextureScaleMode(
			IntPtr texture,
			out SDL_ScaleMode scaleMode
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetRenderDrawColor(
			IntPtr renderer,
			out byte r,
			out byte g,
			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
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_GetRendererOutputSize(
			IntPtr renderer,
			out int w,
			out int h
		);

		/* 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(
			IntPtr texture,
			out byte r,
			out byte g,
			out byte b
		);

		/* texture refers to an SDL_Texture*, pixels to a void* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_LockTexture(
			IntPtr texture,
			ref SDL_Rect rect,
			out IntPtr pixels,
			out int pitch
		);

		/* texture refers to an SDL_Texture*, pixels to a void*.
		 * Internally, this function contains logic to use default values when
		 * the rectangle is passed as NULL.
		 * This overload allows for IntPtr.Zero to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_LockTexture(
			IntPtr texture,
			IntPtr rect,
			out IntPtr pixels,
			out int pitch
		);

		/* texture refers to an SDL_Texture*, surface to an SDL_Surface*
		 * Only available in 2.0.11 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_LockTextureToSurface(
			IntPtr texture,
			ref SDL_Rect rect,
			out IntPtr surface
		);

		/* texture refers to an SDL_Texture*, surface to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * the rectangle is passed as NULL.
		 * This overload allows for IntPtr.Zero to be passed for rect.
		 * Only available in 2.0.11 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_LockTextureToSurface(
			IntPtr texture,
			IntPtr rect,
			out IntPtr surface
		);

		/* texture refers to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_QueryTexture(
			IntPtr texture,
			out uint format,
			out int access,
			out int w,
			out int h
		);

		/* 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(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_Rect dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopy(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_Rect dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopy(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopy(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_Rect dstrect,
			double angle,
			ref SDL_Point center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_Rect dstrect,
			double angle,
			ref SDL_Point center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect,
			double angle,
			ref SDL_Point center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_Rect dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * srcrect and dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect,
			double angle,
			ref SDL_Point center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * srcrect and center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_Rect dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * dstrect and center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for all
		 * three parameters.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawLine(
			IntPtr renderer,
			int x1,
			int y1,
			int x2,
			int y2
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawLines(
			IntPtr renderer,
			[In] SDL_Point[] points,
			int count
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawPoint(
			IntPtr renderer,
			int x,
			int y
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawPoints(
			IntPtr renderer,
			[In] 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*, rect to an SDL_Rect*.
		 * This overload allows for IntPtr.Zero (null) to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawRect(
			IntPtr renderer,
			IntPtr rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawRects(
			IntPtr renderer,
			[In] 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*, rect to an SDL_Rect*.
		 * This overload allows for IntPtr.Zero (null) to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFillRect(
			IntPtr renderer,
			IntPtr rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFillRects(
			IntPtr renderer,
			[In] SDL_Rect[] rects,
			int count
		);

		#region Floating Point Render Functions

		/* This region only available in SDL 2.0.10 or higher. */

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyF(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_FRect dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyF(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_FRect dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyF(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyF(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_FRect dstrect,
			double angle,
			ref SDL_FPoint center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyEx(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_FRect dstrect,
			double angle,
			ref SDL_FPoint center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect,
			double angle,
			ref SDL_FPoint center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			ref SDL_FRect dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * srcrect and dstrect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect,
			double angle,
			ref SDL_FPoint center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * srcrect and center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			ref SDL_FRect dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both
		 * dstrect and center.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			ref SDL_Rect srcrect,
			IntPtr dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer*, texture to an SDL_Texture*.
		 * Internally, this function contains logic to use default values when
		 * source, destination, and/or center are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for all
		 * three parameters.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderCopyExF(
			IntPtr renderer,
			IntPtr texture,
			IntPtr srcrect,
			IntPtr dstrect,
			double angle,
			IntPtr center,
			SDL_RendererFlip flip
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawPointF(
			IntPtr renderer,
			float x,
			float y
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawPointsF(
			IntPtr renderer,
			[In] SDL_FPoint[] points,
			int count
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawLineF(
			IntPtr renderer,
			float x1,
			float y1,
			float x2,
			float y2
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawLinesF(
			IntPtr renderer,
			[In] SDL_FPoint[] points,
			int count
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawRectF(
			IntPtr renderer,
			ref SDL_FRect rect
		);

		/* renderer refers to an SDL_Renderer*, rect to an SDL_Rect*.
		 * This overload allows for IntPtr.Zero (null) to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawRectF(
			IntPtr renderer,
			IntPtr rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderDrawRectsF(
			IntPtr renderer,
			[In] SDL_FRect[] rects,
			int count
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFillRectF(
			IntPtr renderer,
			ref SDL_FRect rect
		);

		/* renderer refers to an SDL_Renderer*, rect to an SDL_Rect*.
		 * This overload allows for IntPtr.Zero (null) to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFillRectF(
			IntPtr renderer,
			IntPtr rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFillRectsF(
			IntPtr renderer,
			[In] SDL_FRect[] rects,
			int count
		);

		#endregion

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_RenderGetClipRect(
			IntPtr renderer,
			out SDL_Rect rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_RenderGetLogicalSize(
			IntPtr renderer,
			out int w,
			out int h
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_RenderGetScale(
			IntPtr renderer,
			out float scaleX,
			out float scaleY
		);

		/* 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(
			IntPtr renderer,
			ref SDL_Rect rect,
			uint format,
			IntPtr pixels,
			int pitch
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderSetClipRect(
			IntPtr renderer,
			ref SDL_Rect rect
		);

		/* renderer refers to an SDL_Renderer*
		 * This overload allows for IntPtr.Zero (null) to be passed for rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderSetClipRect(
			IntPtr renderer,
			IntPtr rect
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderSetLogicalSize(
			IntPtr renderer,
			int w,
			int h
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderSetScale(
			IntPtr renderer,
			float scaleX,
			float scaleY
		);

		/* renderer refers to an SDL_Renderer*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderSetIntegerScale(
			IntPtr renderer,
			SDL_bool enable
		);

		/* 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(
			IntPtr renderer,
			byte r,
			byte g,
			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(
			IntPtr texture,
			byte r,
			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(
			IntPtr texture,
			ref SDL_Rect rect,
			IntPtr pixels,
			int pitch
		);

		/* texture refers to an SDL_Texture* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_UpdateTexture(
			IntPtr texture,
			IntPtr rect,
			IntPtr pixels,
			int pitch
		);

		/* texture refers to an SDL_Texture*
		 * Only available in 2.0.1 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_UpdateYUVTexture(
			IntPtr texture,
			ref SDL_Rect rect,
			IntPtr yPlane,
			int yPitch,
			IntPtr uPlane,
			int uPitch,
			IntPtr vPlane,
			int vPitch
		);

		/* renderer refers to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_RenderTargetSupported(
			IntPtr renderer
		);

		/* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_GetRenderTarget(IntPtr renderer);

		/* renderer refers to an SDL_Renderer*
		 * Only available in 2.0.8 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_RenderGetMetalLayer(
			IntPtr renderer
		);

		/* renderer refers to an SDL_Renderer*
		 * Only available in 2.0.8 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_RenderGetMetalCommandEncoder(
			IntPtr renderer
		);

		/* renderer refers to an SDL_Renderer*
		 * Only available in 2.0.4 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_RenderIsClipEnabled(IntPtr renderer);

		/* renderer refers to an SDL_Renderer*
		 * Only available in 2.0.10 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_RenderFlush(IntPtr renderer);

		#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 type,
			uint order,
			SDL_PackedLayout layout,
			byte bits,
			byte bytes
		) {
			return (uint) (
				(1 << 28) |
				(((byte) type) << 24) |
				(((byte) order) << 20) |
				(((byte) layout) << 16) |
				(bits << 8) |
				(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_PIXELLAYOUT(uint X)
		{
			return (byte) ((X >> 16) & 0x0F);
		}

		public static byte SDL_BITSPERPIXEL(uint X)
		{
			return (byte) ((X >> 8) & 0xFF);
		}

		public static byte SDL_BYTESPERPIXEL(uint X)
		{
			if (SDL_ISPIXELFORMAT_FOURCC(X))
			{
				if (	(X == SDL_PIXELFORMAT_YUY2) ||
						(X == SDL_PIXELFORMAT_UYVY) ||
						(X == SDL_PIXELFORMAT_YVYU)	)
				{
					return 2;
				}
				return 1;
			}
			return (byte) (X & 0xFF);
		}

		public static bool SDL_ISPIXELFORMAT_INDEXED(uint format)
		{
			if (SDL_ISPIXELFORMAT_FOURCC(format))
			{
				return false;
			}
			SDL_PixelType pType =
				(SDL_PixelType) SDL_PIXELTYPE(format);
			return (
				pType == SDL_PixelType.SDL_PIXELTYPE_INDEX1 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_INDEX4 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_INDEX8
			);
		}

		public static bool SDL_ISPIXELFORMAT_PACKED(uint format)
		{
			if (SDL_ISPIXELFORMAT_FOURCC(format))
			{
				return false;
			}
			SDL_PixelType pType =
				(SDL_PixelType) SDL_PIXELTYPE(format);
			return (
				pType == SDL_PixelType.SDL_PIXELTYPE_PACKED8 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_PACKED16 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_PACKED32
			);
		}

		public static bool SDL_ISPIXELFORMAT_ARRAY(uint format)
		{
			if (SDL_ISPIXELFORMAT_FOURCC(format))
			{
				return false;
			}
			SDL_PixelType pType =
				(SDL_PixelType) SDL_PIXELTYPE(format);
			return (
				pType == SDL_PixelType.SDL_PIXELTYPE_ARRAYU8 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_ARRAYU16 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_ARRAYU32 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_ARRAYF16 ||
				pType == SDL_PixelType.SDL_PIXELTYPE_ARRAYF32
			);
		}

		public static bool SDL_ISPIXELFORMAT_ALPHA(uint format)
		{
			if (SDL_ISPIXELFORMAT_PACKED(format))
			{
				SDL_PackedOrder pOrder =
					(SDL_PackedOrder) SDL_PIXELORDER(format);
				return (
					pOrder == SDL_PackedOrder.SDL_PACKEDORDER_ARGB ||
					pOrder == SDL_PackedOrder.SDL_PACKEDORDER_RGBA ||
					pOrder == SDL_PackedOrder.SDL_PACKEDORDER_ABGR ||
					pOrder == SDL_PackedOrder.SDL_PACKEDORDER_BGRA
				);
			}
			else if (SDL_ISPIXELFORMAT_ARRAY(format))
			{
				SDL_ArrayOrder aOrder =
					(SDL_ArrayOrder) SDL_PIXELORDER(format);
				return (
					aOrder == SDL_ArrayOrder.SDL_ARRAYORDER_ARGB ||
					aOrder == SDL_ArrayOrder.SDL_ARRAYORDER_RGBA ||
					aOrder == SDL_ArrayOrder.SDL_ARRAYORDER_ABGR ||
					aOrder == SDL_ArrayOrder.SDL_ARRAYORDER_BGRA
				);
			}
			return false;
		}

		public static bool SDL_ISPIXELFORMAT_FOURCC(uint format)
		{
			return (format == 0) && (SDL_PIXELFLAG(format) != 1);
		}

		public enum SDL_PixelType
		{
			SDL_PIXELTYPE_UNKNOWN,
			SDL_PIXELTYPE_INDEX1,
			SDL_PIXELTYPE_INDEX4,
			SDL_PIXELTYPE_INDEX8,
			SDL_PIXELTYPE_PACKED8,
			SDL_PIXELTYPE_PACKED16,
			SDL_PIXELTYPE_PACKED32,
			SDL_PIXELTYPE_ARRAYU8,
			SDL_PIXELTYPE_ARRAYU16,
			SDL_PIXELTYPE_ARRAYU32,
			SDL_PIXELTYPE_ARRAYF16,
			SDL_PIXELTYPE_ARRAYF32
		}

		public enum SDL_BitmapOrder
		{
			SDL_BITMAPORDER_NONE,
			SDL_BITMAPORDER_4321,
			SDL_BITMAPORDER_1234
		}

		public enum SDL_PackedOrder
		{
			SDL_PACKEDORDER_NONE,
			SDL_PACKEDORDER_XRGB,
			SDL_PACKEDORDER_RGBX,
			SDL_PACKEDORDER_ARGB,
			SDL_PACKEDORDER_RGBA,
			SDL_PACKEDORDER_XBGR,
			SDL_PACKEDORDER_BGRX,
			SDL_PACKEDORDER_ABGR,
			SDL_PACKEDORDER_BGRA
		}

		public enum SDL_ArrayOrder
		{
			SDL_ARRAYORDER_NONE,
			SDL_ARRAYORDER_RGB,
			SDL_ARRAYORDER_RGBA,
			SDL_ARRAYORDER_ARGB,
			SDL_ARRAYORDER_BGR,
			SDL_ARRAYORDER_BGRA,
			SDL_ARRAYORDER_ABGR
		}

		public enum SDL_PackedLayout
		{
			SDL_PACKEDLAYOUT_NONE,
			SDL_PACKEDLAYOUT_332,
			SDL_PACKEDLAYOUT_4444,
			SDL_PACKEDLAYOUT_1555,
			SDL_PACKEDLAYOUT_5551,
			SDL_PACKEDLAYOUT_565,
			SDL_PACKEDLAYOUT_8888,
			SDL_PACKEDLAYOUT_2101010,
			SDL_PACKEDLAYOUT_1010102
		}

		public static readonly uint SDL_PIXELFORMAT_UNKNOWN = 0;
		public static readonly uint SDL_PIXELFORMAT_INDEX1LSB =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX1,
				(uint) SDL_BitmapOrder.SDL_BITMAPORDER_4321,
				0,
				1, 0
			);
		public static readonly uint SDL_PIXELFORMAT_INDEX1MSB =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX1,
				(uint) SDL_BitmapOrder.SDL_BITMAPORDER_1234,
				0,
				1, 0
			);
		public static readonly uint SDL_PIXELFORMAT_INDEX4LSB =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX4,
				(uint) SDL_BitmapOrder.SDL_BITMAPORDER_4321,
				0,
				4, 0
			);
		public static readonly uint SDL_PIXELFORMAT_INDEX4MSB =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX4,
				(uint) SDL_BitmapOrder.SDL_BITMAPORDER_1234,
				0,
				4, 0
			);
		public static readonly uint SDL_PIXELFORMAT_INDEX8 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX8,
				0,
				0,
				8, 1
			);
		public static readonly uint SDL_PIXELFORMAT_RGB332 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED8,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XRGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_332,
				8, 1
			);
		public static readonly uint SDL_PIXELFORMAT_RGB444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XRGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				12, 2
			);
		public static readonly uint SDL_PIXELFORMAT_BGR444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XBGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				12, 2
			);
		public static readonly uint SDL_PIXELFORMAT_RGB555 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XRGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_1555,
				15, 2
			);
		public static readonly uint SDL_PIXELFORMAT_BGR555 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_INDEX1,
				(uint) SDL_BitmapOrder.SDL_BITMAPORDER_4321,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_1555,
				15, 2
			);
		public static readonly uint SDL_PIXELFORMAT_ARGB4444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ARGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_RGBA4444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_RGBA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_ABGR4444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ABGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_BGRA4444 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_BGRA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_4444,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_ARGB1555 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ARGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_1555,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_RGBA5551 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_RGBA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_5551,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_ABGR1555 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ABGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_1555,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_BGRA5551 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_BGRA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_5551,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_RGB565 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XRGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_565,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_BGR565 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED16,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XBGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_565,
				16, 2
			);
		public static readonly uint SDL_PIXELFORMAT_RGB24 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_ARRAYU8,
				(uint) SDL_ArrayOrder.SDL_ARRAYORDER_RGB,
				0,
				24, 3
			);
		public static readonly uint SDL_PIXELFORMAT_BGR24 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_ARRAYU8,
				(uint) SDL_ArrayOrder.SDL_ARRAYORDER_BGR,
				0,
				24, 3
			);
		public static readonly uint SDL_PIXELFORMAT_RGB888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XRGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				24, 4
			);
		public static readonly uint SDL_PIXELFORMAT_RGBX8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_RGBX,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				24, 4
			);
		public static readonly uint SDL_PIXELFORMAT_BGR888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_XBGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				24, 4
			);
		public static readonly uint SDL_PIXELFORMAT_BGRX8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_BGRX,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				24, 4
			);
		public static readonly uint SDL_PIXELFORMAT_ARGB8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ARGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				32, 4
			);
		public static readonly uint SDL_PIXELFORMAT_RGBA8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_RGBA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				32, 4
			);
		public static readonly uint SDL_PIXELFORMAT_ABGR8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ABGR,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				32, 4
			);
		public static readonly uint SDL_PIXELFORMAT_BGRA8888 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_BGRA,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_8888,
				32, 4
			);
		public static readonly uint SDL_PIXELFORMAT_ARGB2101010 =
			SDL_DEFINE_PIXELFORMAT(
				SDL_PixelType.SDL_PIXELTYPE_PACKED32,
				(uint) SDL_PackedOrder.SDL_PACKEDORDER_ARGB,
				SDL_PackedLayout.SDL_PACKEDLAYOUT_2101010,
				32, 4
			);
		public static readonly uint SDL_PIXELFORMAT_YV12 =
			SDL_DEFINE_PIXELFOURCC(
				(byte) 'Y', (byte) 'V', (byte) '1', (byte) '2'
			);
		public static readonly uint SDL_PIXELFORMAT_IYUV =
			SDL_DEFINE_PIXELFOURCC(
				(byte) 'I', (byte) 'Y', (byte) 'U', (byte) 'V'
			);
		public static readonly uint SDL_PIXELFORMAT_YUY2 =
			SDL_DEFINE_PIXELFOURCC(
				(byte) 'Y', (byte) 'U', (byte) 'Y', (byte) '2'
			);
		public static readonly uint SDL_PIXELFORMAT_UYVY =
			SDL_DEFINE_PIXELFOURCC(
				(byte) 'U', (byte) 'Y', (byte) 'V', (byte) 'Y'
			);
		public static readonly uint SDL_PIXELFORMAT_YVYU =
			SDL_DEFINE_PIXELFOURCC(
				(byte) 'Y', (byte) 'V', (byte) 'Y', (byte) 'U'
			);

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_Color
		{
			public byte r;
			public byte g;
			public byte b;
			public byte a;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_Palette
		{
			public int ncolors;
			public IntPtr colors;
			public int version;
			public int refcount;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_PixelFormat
		{
			public uint format;
			public IntPtr palette; // SDL_Palette*
			public byte BitsPerPixel;
			public byte BytesPerPixel;
			public uint Rmask;
			public uint Gmask;
			public uint Bmask;
			public uint Amask;
			public byte Rloss;
			public byte Gloss;
			public byte Bloss;
			public byte Aloss;
			public byte Rshift;
			public byte Gshift;
			public byte Bshift;
			public byte Ashift;
			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, EntryPoint = "SDL_GetPixelFormatName", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetPixelFormatName(
			uint format
		);
		public static string SDL_GetPixelFormatName(uint format)
		{
			return UTF8_ToManaged(
				INTERNAL_SDL_GetPixelFormatName(format)
			);
		}

		/* format refers to an SDL_PixelFormat* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetRGB(
			uint pixel,
			IntPtr format,
			out byte r,
			out byte g,
			out byte b
		);

		/* format refers to an SDL_PixelFormat* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern void SDL_GetRGBA(
			uint pixel,
			IntPtr format,
			out byte r,
			out byte g,
			out byte b,
			out byte a
		);

		/* format refers to an SDL_PixelFormat* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_MapRGB(
			IntPtr format,
			byte r,
			byte g,
			byte b
		);

		/* format refers to an SDL_PixelFormat* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_MapRGBA(
			IntPtr format,
			byte r,
			byte g,
			byte b,
			byte a
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern uint SDL_MasksToPixelFormatEnum(
			int bpp,
			uint Rmask,
			uint Gmask,
			uint Bmask,
			uint Amask
		);

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_PixelFormatEnumToMasks(
			uint format,
			out int bpp,
			out uint Rmask,
			out uint Gmask,
			out uint Bmask,
			out uint Amask
		);

		/* palette refers to an SDL_Palette* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_SetPaletteColors(
			IntPtr palette,
			[In] SDL_Color[] colors,
			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
		{
			public int x;
			public int y;
			public int w;
			public int h;
		}

		/* Only available in 2.0.10 or higher. */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_FPoint
		{
			public float x;
			public float y;
		}

		/* Only available in 2.0.10 or higher. */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_FRect
		{
			public float x;
			public float y;
			public float w;
			public float h;
		}

		/* Only available in 2.0.4 or higher. */
		public static SDL_bool SDL_PointInRect(ref SDL_Point p, ref SDL_Rect r)
		{
			return (	(p.x >= r.x) &&
					(p.x < (r.x + r.w)) &&
					(p.y >= r.y) &&
					(p.y < (r.y + r.h))	) ?
				SDL_bool.SDL_TRUE :
				SDL_bool.SDL_FALSE;
		}

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_EnclosePoints(
			[In] SDL_Point[] points,
			int count,
			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,
			ref int X1,
			ref int Y1,
			ref int X2,
			ref int Y2
		);

		public static SDL_bool SDL_RectEmpty(ref SDL_Rect r)
		{
			return ((r.w <= 0) || (r.h <= 0)) ?
				SDL_bool.SDL_TRUE :
				SDL_bool.SDL_FALSE;
		}

		public static SDL_bool SDL_RectEquals(
			ref SDL_Rect a,
			ref SDL_Rect b
		) {
			return (	(a.x == b.x) &&
					(a.y == b.y) &&
					(a.w == b.w) &&
					(a.h == b.h)	) ?
				SDL_bool.SDL_TRUE :
				SDL_bool.SDL_FALSE;
		}

		[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
		{
			public uint flags;
			public IntPtr format; // SDL_PixelFormat*
			public int w;
			public int h;
			public int pitch;
			public IntPtr pixels; // void*
			public IntPtr userdata; // void*
			public int locked;
			public IntPtr lock_data; // void*
			public SDL_Rect clip_rect;
			public IntPtr map; // SDL_BlitMap*
			public int refcount;
		}

		/* surface refers to an SDL_Surface* */
		public static bool SDL_MUSTLOCK(IntPtr surface)
		{
			SDL_Surface sur;
			sur = (SDL_Surface) Marshal.PtrToStructure(
				surface,
				typeof(SDL_Surface)
			);
			return (sur.flags & SDL_RLEACCEL) != 0;
		}

		/* src and dst refer to an SDL_Surface* */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitSurface(
			IntPtr src,
			ref SDL_Rect srcrect,
			IntPtr dst,
			ref SDL_Rect dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitSurface(
			IntPtr src,
			IntPtr srcrect,
			IntPtr dst,
			ref SDL_Rect dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitSurface(
			IntPtr src,
			ref SDL_Rect srcrect,
			IntPtr dst,
			IntPtr dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitSurface(
			IntPtr src,
			IntPtr srcrect,
			IntPtr dst,
			IntPtr dstrect
		);

		/* src and dst refer to an SDL_Surface* */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitScaled(
			IntPtr src,
			ref SDL_Rect srcrect,
			IntPtr dst,
			ref SDL_Rect dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for srcrect.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitScaled(
			IntPtr src,
			IntPtr srcrect,
			IntPtr dst,
			ref SDL_Rect dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for dstrect.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitScaled(
			IntPtr src,
			ref SDL_Rect srcrect,
			IntPtr dst,
			IntPtr dstrect
		);

		/* src and dst refer to an SDL_Surface*
		 * Internally, this function contains logic to use default values when
		 * source and destination rectangles are passed as NULL.
		 * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects.
		 */
		[DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_BlitScaled(
			IntPtr src,
			IntPtr srcrect,
			IntPtr dst,
			IntPtr dstrect
		);

		/* src and dst are void* pointers */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_ConvertPixels(
			int width,
			int height,
			uint src_format,
			IntPtr src,
			int src_pitch,
			uint dst_format,
			IntPtr dst,
			int dst_pitch
		);

		/* IntPtr refers to an SDL_Surface*
		 * src refers to an SDL_Surface*
		 * fmt refers to an SDL_PixelFormat*
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_ConvertSurface(
			IntPtr src,
			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(
			IntPtr src,
			uint pixel_format,
			uint flags
		);

		/* IntPtr refers to an SDL_Surface* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateRGBSurface(
			uint flags,
			int width,
			int height,
			int depth,
			uint Rmask,
			uint Gmask,
			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(
			IntPtr pixels,
			int width,
			int height,
			int depth,
			int pitch,
			uint Rmask,
			uint Gmask,
			uint Bmask,
			uint Amask
		);

		/* IntPtr refers to an SDL_Surface*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateRGBSurfaceWithFormat(
			uint flags,
			int width,
			int height,
			int depth,
			uint format
		);

		/* IntPtr refers to an SDL_Surface*, pixels to a void*
		 * Only available in 2.0.5 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_CreateRGBSurfaceWithFormatFrom(
			IntPtr pixels,
			int width,
			int height,
			int depth,
			int pitch,
			uint format
		);

		/* dst refers to an SDL_Surface* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_FillRect(
			IntPtr dst,
			ref SDL_Rect rect,
			uint color
		);

		/* dst refers to an SDL_Surface*.
		 * This overload allows passing NULL to rect.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_FillRect(
			IntPtr dst,
			IntPtr rect,
			uint color
		);

		/* dst refers to an SDL_Surface* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern int SDL_FillRects(
			IntPtr dst,
			[In] SDL_Rect[] rects,
			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*.
		 * Only available in 2.0.9 or higher.
		 */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_HasColorKey(IntPtr surface);

		/* 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(
			IntPtr surface,
			out byte r,
			out byte g,
			out byte b
		);

		/* These are for SDL_LoadBMP, which is a macro in the SDL headers. */
		/* IntPtr refers to an SDL_Surface* */
		/* THIS IS AN RWops FUNCTION! */
		[DllImport(nativeLibName, EntryPoint = "SDL_LoadBMP_RW", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_LoadBMP_RW(
			IntPtr src,
			int freesrc
		);
		public static IntPtr SDL_LoadBMP(string file)
		{
			IntPtr rwops = 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(
			IntPtr src,
			ref SDL_Rect srcrect,
			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(
			IntPtr src,
			ref SDL_Rect srcrect,
			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! */
		[DllImport(nativeLibName, EntryPoint = "SDL_SaveBMP_RW", CallingConvention = CallingConvention.Cdecl)]
		private static extern int INTERNAL_SDL_SaveBMP_RW(
			IntPtr surface,
			IntPtr src,
			int freesrc
		);
		public static int SDL_SaveBMP(IntPtr surface, string file)
		{
			IntPtr rwops = 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(
			IntPtr surface,
			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(
			IntPtr surface,
			byte r,
			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(
			IntPtr src,
			ref SDL_Rect srcrect,
			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(
			IntPtr src,
			ref SDL_Rect srcrect,
			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(
			IntPtr src,
			ref SDL_Rect srcrect,
			IntPtr dst,
			ref SDL_Rect dstrect
		);

		/* surface and IntPtr refer to an SDL_Surface* */
		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern IntPtr SDL_DuplicateSurface(IntPtr surface);

		#endregion

		#region SDL_clipboard.h

		[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
		public static extern SDL_bool SDL_HasClipboardText();

		[DllImport(nativeLibName, EntryPoint = "SDL_GetClipboardText", CallingConvention = CallingConvention.Cdecl)]
		private static extern IntPtr INTERNAL_SDL_GetClipboardText();
		public static string SDL_GetClipboardText()
		{
			return UTF8_ToManaged(INTERNAL_SDL_GetClipboardText(), true);
		}

		[DllImport(nativeLibName, EntryPoint = "SDL_SetClipboardText", CallingConvention = CallingConvention.Cdecl)]
		private static extern unsafe int INTERNAL_SDL_SetClipboardText(
			byte* text
		);
		public static unsafe int SDL_SetClipboardText(
			string text
		) {
			byte* utf8Text = Utf8Encode(text);
			int result = INTERNAL_SDL_SetClipboardText(
				utf8Text
			);
			Marshal.FreeHGlobal((IntPtr) utf8Text);
			return result;
		}

		#endregion

		#region SDL_events.h

		/* General keyboard/mouse state definitions. */
		public const byte SDL_PRESSED =		1;
		public const byte SDL_RELEASED =	0;

		/* Default size is according to SDL2 default. */
		public const int SDL_TEXTEDITINGEVENT_TEXT_SIZE = 32;
		public const int SDL_TEXTINPUTEVENT_TEXT_SIZE = 32;

		/* The types of events that can be delivered. */
		public enum SDL_EventType : uint
		{
			SDL_FIRSTEVENT =		0,

			/* Application events */
			SDL_QUIT = 			0x100,

			/* iOS/Android/WinRT app events */
			SDL_APP_TERMINATING,
			SDL_APP_LOWMEMORY,
			SDL_APP_WILLENTERBACKGROUND,
			SDL_APP_DIDENTERBACKGROUND,
			SDL_APP_WILLENTERFOREGROUND,
			SDL_APP_DIDENTERFOREGROUND,

			/* Display events */
			/* Only available in SDL 2.0.9 or higher. */
			SDL_DISPLAYEVENT =		0x150,

			/* Window events */
			SDL_WINDOWEVENT = 		0x200,
			SDL_SYSWMEVENT,

			/* Keyboard events */
			SDL_KEYDOWN = 			0x300,
			SDL_KEYUP,
			SDL_TEXTEDITING,
			SDL_TEXTINPUT,
			SDL_KEYMAPCHANGED,

			/* Mouse events */
			SDL_MOUSEMOTION = 		0x400,
			SDL_MOUSEBUTTONDOWN,
			SDL_MOUSEBUTTONUP,
			SDL_MOUSEWHEEL,

			/* Joystick events */
			SDL_JOYAXISMOTION =		0x600,
			SDL_JOYBALLMOTION,
			SDL_JOYHATMOTION,
			SDL_JOYBUTTONDOWN,
			SDL_JOYBUTTONUP,
			SDL_JOYDEVICEADDED,
			SDL_JOYDEVICEREMOVED,

			/* Game controller events */
			SDL_CONTROLLERAXISMOTION = 	0x650,
			SDL_CONTROLLERBUTTONDOWN,
			SDL_CONTROLLERBUTTONUP,
			SDL_CONTROLLERDEVICEADDED,
			SDL_CONTROLLERDEVICEREMOVED,
			SDL_CONTROLLERDEVICEREMAPPED,

			/* Touch events */
			SDL_FINGERDOWN = 		0x700,
			SDL_FINGERUP,
			SDL_FINGERMOTION,

			/* Gesture events */
			SDL_DOLLARGESTURE =		0x800,
			SDL_DOLLARRECORD,
			SDL_MULTIGESTURE,

			/* Clipboard events */
			SDL_CLIPBOARDUPDATE =		0x900,

			/* Drag and drop events */
			SDL_DROPFILE =			0x1000,
			/* Only available in 2.0.4 or higher. */
			SDL_DROPTEXT,
			SDL_DROPBEGIN,
			SDL_DROPCOMPLETE,

			/* Audio hotplug events */
			/* Only available in SDL 2.0.4 or higher. */
			SDL_AUDIODEVICEADDED =		0x1100,
			SDL_AUDIODEVICEREMOVED,

			/* Sensor events */
			/* Only available in SDL 2.0.9 or higher. */
			SDL_SENSORUPDATE =		0x1200,

			/* Render events */
			/* Only available in SDL 2.0.2 or higher. */
			SDL_RENDER_TARGETS_RESET =	0x2000,
			/* Only available in SDL 2.0.4 or higher. */
			SDL_RENDER_DEVICE_RESET,

			/* Events SDL_USEREVENT through SDL_LASTEVENT are for
			 * your use, and should be allocated with
			 * SDL_RegisterEvents()
			 */
			SDL_USEREVENT =			0x8000,

			/* The last event, used for bouding arrays. */
			SDL_LASTEVENT =			0xFFFF
		}

		/* Only available in 2.0.4 or higher. */
		public enum SDL_MouseWheelDirection : uint
		{
			SDL_MOUSEWHEEL_NORMAL,
			SDL_MOUSEWHEEL_FLIPPED
		}

		/* Fields shared by every event */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_GenericEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
		}

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_DisplayEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 display;
			public SDL_DisplayEventID displayEvent; // event, lolC#
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int32 data1;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Window state change event data (event.window.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_WindowEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public SDL_WindowEventID windowEvent; // event, lolC#
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int32 data1;
			public Int32 data2;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Keyboard button event structure (event.key.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_KeyboardEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public byte state;
			public byte repeat; /* non-zero if this is a repeat */
			private byte padding2;
			private byte padding3;
			public SDL_Keysym keysym;
		}
#pragma warning restore 0169

		[StructLayout(LayoutKind.Sequential)]
		public unsafe struct SDL_TextEditingEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public fixed byte text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
			public Int32 start;
			public Int32 length;
		}

		[StructLayout(LayoutKind.Sequential)]
		public unsafe struct SDL_TextInputEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public fixed byte text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
		}

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Mouse motion event structure (event.motion.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MouseMotionEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public UInt32 which;
			public byte state; /* bitmask of buttons */
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int32 x;
			public Int32 y;
			public Int32 xrel;
			public Int32 yrel;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Mouse button event structure (event.button.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MouseButtonEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public UInt32 which;
			public byte button; /* button id */
			public byte state; /* SDL_PRESSED or SDL_RELEASED */
			public byte clicks; /* 1 for single-click, 2 for double-click, etc. */
			private byte padding1;
			public Int32 x;
			public Int32 y;
		}
#pragma warning restore 0169

		/* Mouse wheel event structure (event.wheel.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MouseWheelEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public UInt32 which;
			public Int32 x; /* amount scrolled horizontally */
			public Int32 y; /* amount scrolled vertically */
			public UInt32 direction; /* Set to one of the SDL_MOUSEWHEEL_* defines */
		}

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Joystick axis motion event structure (event.jaxis.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_JoyAxisEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte axis;
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int16 axisValue; /* value, lolC# */
			public UInt16 padding4;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Joystick trackball motion event structure (event.jball.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_JoyBallEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte ball;
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int16 xrel;
			public Int16 yrel;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Joystick hat position change event struct (event.jhat.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_JoyHatEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte hat; /* index of the hat */
			public byte hatValue; /* value, lolC# */
			private byte padding1;
			private byte padding2;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Joystick button event structure (event.jbutton.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_JoyButtonEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte button;
			public byte state; /* SDL_PRESSED or SDL_RELEASED */
			private byte padding1;
			private byte padding2;
		}
#pragma warning restore 0169

		/* Joystick device event structure (event.jdevice.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_JoyDeviceEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
		}

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Game controller axis motion event (event.caxis.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_ControllerAxisEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte axis;
			private byte padding1;
			private byte padding2;
			private byte padding3;
			public Int16 axisValue; /* value, lolC# */
			private UInt16 padding4;
		}
#pragma warning restore 0169

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Game controller button event (event.cbutton.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_ControllerButtonEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which; /* SDL_JoystickID */
			public byte button;
			public byte state;
			private byte padding1;
			private byte padding2;
		}
#pragma warning restore 0169

		/* Game controller device event (event.cdevice.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_ControllerDeviceEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which;	/* joystick id for ADDED,
						 * else instance id
						 */
		}

// Ignore private members used for padding in this struct
#pragma warning disable 0169
		/* Audio device event (event.adevice.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_AudioDeviceEvent
		{
			public UInt32 type;
			public UInt32 timestamp;
			public UInt32 which;
			public byte iscapture;
			private byte padding1;
			private byte padding2;
			private byte padding3;
		}
#pragma warning restore 0169

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_TouchFingerEvent
		{
			public UInt32 type;
			public UInt32 timestamp;
			public Int64 touchId; // SDL_TouchID
			public Int64 fingerId; // SDL_GestureID
			public float x;
			public float y;
			public float dx;
			public float dy;
			public float pressure;
			public uint windowID;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_MultiGestureEvent
		{
			public UInt32 type;
			public UInt32 timestamp;
			public Int64 touchId; // SDL_TouchID
			public float dTheta;
			public float dDist;
			public float x;
			public float y;
			public UInt16 numFingers;
			public UInt16 padding;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_DollarGestureEvent
		{
			public UInt32 type;
			public UInt32 timestamp;
			public Int64 touchId; // SDL_TouchID
			public Int64 gestureId; // SDL_GestureID
			public UInt32 numFingers;
			public float error;
			public float x;
			public float y;
		}

		/* File open request by system (event.drop.*), enabled by
		 * default
		 */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_DropEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;

			/* char* filename, to be freed.
			 * Access the variable EXACTLY ONCE like this:
			 * string s = SDL.UTF8_ToManaged(evt.drop.file, true);
			 */
			public IntPtr file;
			public UInt32 windowID;
		}

		[StructLayout(LayoutKind.Sequential)]
		public unsafe struct SDL_SensorEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public Int32 which;
			public fixed float data[6];
		}

		/* The "quit requested" event */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_QuitEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
		}

		/* A user defined event (event.user.*) */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_UserEvent
		{
			public UInt32 type;
			public UInt32 timestamp;
			public UInt32 windowID;
			public Int32 code;
			public IntPtr data1; /* user-defined */
			public IntPtr data2; /* user-defined */
		}

		/* A video driver dependent event (event.syswm.*), disabled */
		[StructLayout(LayoutKind.Sequential)]
		public struct SDL_SysWMEvent
		{
			public SDL_EventType type;
			public UInt32 timestamp;
			public IntPtr msg; /* SDL_SysWMmsg*, system-dependent*/
		}

		/* General event structure */
		// C# doesn't do unions, so we do this ugly thing. */
		[StructLayout(LayoutKind.Explicit)]
		public unsafe struct SDL_Event
		{
			[FieldOffset(0)]
			public SDL_EventType type;
			[FieldOffset(0)]
			public SDL_EventType typeFSharp;
			[FieldOffset(0)]
			public SDL_DisplayEvent display;
			[FieldOffset(0)]
			public SDL_WindowEvent window;
			[FieldOffset(0)]
			public SDL_KeyboardEvent key;
			[FieldOffset(0)]
			public SDL_TextEditingEvent edit;
			[FieldOffset(0)]
Download .txt
gitextract__c256kt2/

├── .gitignore
├── Assets/
│   └── INSTRUCTIONS.txt
├── Engine/
│   ├── Audio.cs
│   ├── Content.cs
│   ├── Engine.cs
│   ├── Graphics.cs
│   ├── Input.cs
│   ├── SDL2/
│   │   ├── SDL2.cs
│   │   ├── SDL2_image.cs
│   │   ├── SDL2_mixer.cs
│   │   └── SDL2_ttf.cs
│   └── Utility/
│       ├── Bounds2.cs
│       ├── Color.cs
│       └── Vector2.cs
├── Game/
│   └── Game.cs
├── Game.csproj
├── Game.sln
├── LICENSE.md
└── README.md
Download .txt
SYMBOL INDEX (1122 symbols across 13 files)

FILE: Engine/Audio.cs
  class Engine (line 5) | static partial class Engine
    method GetFadeTimeMs (line 11) | private static int GetFadeTimeMs(float fadeTime)
    method PlaySound (line 22) | public static SoundInstance PlaySound(Sound sound, bool repeat = false...
    method StopSound (line 54) | public static void StopSound(SoundInstance instance, float fadeTime = 0)
    method PlayMusic (line 69) | public static void PlayMusic(Music music, bool looping = true, float f...
    method StopMusic (line 78) | public static void StopMusic(float fadeTime = 0)
  class SoundInstance (line 84) | class SoundInstance

FILE: Engine/Content.cs
  class Engine (line 6) | static partial class Engine
    method GetAssetPath (line 8) | private static string GetAssetPath(string path)
    method LoadTexture (line 17) | public static Texture LoadTexture(string path)
    method LoadResizableTexture (line 41) | public static ResizableTexture LoadResizableTexture(string path, int l...
    method LoadFont (line 70) | public static Font LoadFont(string path, int pointSize)
    method LoadSound (line 85) | public static Sound LoadSound(string path)
    method LoadMusic (line 100) | public static Music LoadMusic(string path)
  class Texture (line 115) | class Texture
    method Texture (line 122) | public Texture(IntPtr handle, int width, int height)
  class ResizableTexture (line 134) | class ResizableTexture
    method ResizableTexture (line 144) | public ResizableTexture(IntPtr handle, int width, int height, int left...
  class Font (line 159) | class Font
    method Font (line 163) | public Font(IntPtr handle)
  class Sound (line 172) | class Sound
    method Sound (line 176) | public Sound(IntPtr handle)
  class Music (line 185) | class Music
    method Music (line 189) | public Music(IntPtr handle)

FILE: Engine/Engine.cs
  class Engine (line 5) | static partial class Engine
    method Main (line 17) | private static void Main(string[] args)
    method Start (line 23) | private static void Start()
    method Run (line 82) | private static void Run()

FILE: Engine/Graphics.cs
  class Engine (line 5) | static partial class Engine
    method DrawPrimitiveSetup (line 14) | private static void DrawPrimitiveSetup(Color color)
    method DrawLine (line 26) | public static void DrawLine(Vector2 start, Vector2 end, Color color)
    method DrawRectEmpty (line 38) | public static void DrawRectEmpty(Bounds2 bounds, Color color)
    method DrawRectSolid (line 55) | public static void DrawRectSolid(Bounds2 bounds, Color color)
    method DrawTextureSetup (line 71) | private static void DrawTextureSetup(IntPtr textureHandle, Color? colo...
    method DrawTexture (line 93) | public static void DrawTexture(Texture texture, Vector2 position, Colo...
    method DrawResizableTexture (line 156) | public static void DrawResizableTexture(ResizableTexture texture, Boun...
    method DrawResizableTextureSegment (line 201) | private static void DrawResizableTextureSegment(ResizableTexture textu...
    method DrawString (line 237) | public static Bounds2 DrawString(string text, Vector2 position, Color ...
    method FreeUnusedTextCacheEntries (line 286) | private static void FreeUnusedTextCacheEntries()
    class TextCacheEntry (line 307) | private class TextCacheEntry
      method TextCacheEntry (line 312) | public TextCacheEntry(IntPtr handle)
  type TextAlignment (line 320) | enum TextAlignment
  type TextureMirror (line 338) | [Flags]
  type TextureBlendMode (line 362) | enum TextureBlendMode
  type TextureScaleMode (line 375) | enum TextureScaleMode

FILE: Engine/Input.cs
  class Engine (line 7) | static partial class Engine
    method PollEvents (line 39) | private static void PollEvents()
    method SetMouseMode (line 210) | public static void SetMouseMode(MouseMode mode)
    method GetMouseButtonDown (line 232) | public static bool GetMouseButtonDown(MouseButton button)
    method GetMouseButtonHeld (line 241) | public static bool GetMouseButtonHeld(MouseButton button)
    method GetMouseButtonUp (line 250) | public static bool GetMouseButtonUp(MouseButton button)
    method GetKeyDown (line 264) | public static bool GetKeyDown(Key key, bool allowAutorepeat = false)
    method GetKeyHeld (line 278) | public static bool GetKeyHeld(Key key)
    method GetKeyUp (line 287) | public static bool GetKeyUp(Key key)
    method GetGamepadConnected (line 300) | public static bool GetGamepadConnected(int player)
    method GetGamepadAxis (line 310) | public static Vector2 GetGamepadAxis(int player, GamepadAxis axis)
    method GetGamepadButtonDown (line 334) | public static bool GetGamepadButtonDown(int player, GamepadButton button)
    method GetGamepadButtonHeld (line 352) | public static bool GetGamepadButtonHeld(int player, GamepadButton button)
    method GetGamepadButtonUp (line 370) | public static bool GetGamepadButtonUp(int player, GamepadButton button)
    class Gamepad (line 382) | private class Gamepad
      method Gamepad (line 392) | public Gamepad(IntPtr handle)
  type Key (line 399) | public enum Key
  type MouseMode (line 520) | public enum MouseMode
  type MouseButton (line 538) | public enum MouseButton
  type GamepadButton (line 545) | public enum GamepadButton
  type GamepadAxis (line 564) | public enum GamepadAxis

FILE: Engine/SDL2/SDL2.cs
  class SDL (line 38) | public static class SDL
    method Utf8Size (line 49) | internal static int Utf8Size(string str)
    method Utf8SizeNullable (line 54) | internal static int Utf8SizeNullable(string str)
    method Utf8Encode (line 58) | internal static unsafe byte* Utf8Encode(string str, byte* buffer, int ...
    method Utf8EncodeNullable (line 67) | internal static unsafe byte* Utf8EncodeNullable(string str, byte* buff...
    method Utf8Encode (line 83) | internal static unsafe byte* Utf8Encode(string str)
    method Utf8EncodeNullable (line 94) | internal static unsafe byte* Utf8EncodeNullable(string str)
    method UTF8_ToManaged (line 115) | public static unsafe string UTF8_ToManaged(IntPtr s, bool freePtr = fa...
    method SDL_FOURCC (line 172) | public static uint SDL_FOURCC(byte A, byte B, byte C, byte D)
    type SDL_bool (line 177) | public enum SDL_bool
    method SDL_malloc (line 185) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_free (line 188) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_memcpy (line 196) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_RWops (line 245) | [StructLayout(LayoutKind.Sequential)]
    method INTERNAL_SDL_RWFromFile (line 264) | [DllImport(nativeLibName, EntryPoint = "SDL_RWFromFile", CallingConven...
    method SDL_RWFromFile (line 269) | public static unsafe IntPtr SDL_RWFromFile(
    method SDL_AllocRW (line 285) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeRW (line 289) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWFromFP (line 293) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWFromMem (line 297) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWFromConstMem (line 301) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWsize (line 307) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWseek (line 313) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWtell (line 323) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWread (line 329) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWwrite (line 340) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadU8 (line 350) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadLE16 (line 353) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadBE16 (line 356) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadLE32 (line 359) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadBE32 (line 362) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadLE64 (line 365) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ReadBE64 (line 368) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteU8 (line 373) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteLE16 (line 376) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteBE16 (line 379) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteLE32 (line 382) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteBE32 (line 385) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteLE64 (line 388) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WriteBE64 (line 391) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RWclose (line 397) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LoadFile (line 404) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetMainReady (line 411) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WinRTRunApp (line 418) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UIKitRunApp (line 427) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Init (line 453) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_InitSubSystem (line 456) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Quit (line 459) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_QuitSubSystem (line 462) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WasInit (line 465) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetPlatform (line 472) | [DllImport(nativeLibName, EntryPoint = "SDL_GetPlatform", CallingConve...
    method SDL_GetPlatform (line 474) | public static string SDL_GetPlatform()
    type SDL_HintPriority (line 664) | public enum SDL_HintPriority
    method SDL_ClearHints (line 671) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetHint (line 674) | [DllImport(nativeLibName, EntryPoint = "SDL_GetHint", CallingConventio...
    method SDL_GetHint (line 676) | public static unsafe string SDL_GetHint(string name)
    method INTERNAL_SDL_SetHint (line 687) | [DllImport(nativeLibName, EntryPoint = "SDL_SetHint", CallingConventio...
    method SDL_SetHint (line 692) | public static unsafe SDL_bool SDL_SetHint(string name, string value)
    method INTERNAL_SDL_SetHintWithPriority (line 706) | [DllImport(nativeLibName, EntryPoint = "SDL_SetHintWithPriority", Call...
    method SDL_SetHintWithPriority (line 712) | public static unsafe SDL_bool SDL_SetHintWithPriority(
    method INTERNAL_SDL_GetHintBoolean (line 731) | [DllImport(nativeLibName, EntryPoint = "SDL_GetHintBoolean", CallingCo...
    method SDL_GetHintBoolean (line 736) | public static unsafe SDL_bool SDL_GetHintBoolean(
    method SDL_ClearError (line 752) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetError (line 755) | [DllImport(nativeLibName, EntryPoint = "SDL_GetError", CallingConventi...
    method SDL_GetError (line 757) | public static string SDL_GetError()
    method INTERNAL_SDL_SetError (line 763) | [DllImport(nativeLibName, EntryPoint = "SDL_SetError", CallingConventi...
    method SDL_SetError (line 765) | public static unsafe void SDL_SetError(string fmtAndArglist)
    type SDL_LogCategory (line 778) | public enum SDL_LogCategory
    type SDL_LogPriority (line 813) | public enum SDL_LogPriority
    method INTERNAL_SDL_Log (line 834) | [DllImport(nativeLibName, EntryPoint = "SDL_Log", CallingConvention = ...
    method SDL_Log (line 836) | public static unsafe void SDL_Log(string fmtAndArglist)
    method INTERNAL_SDL_LogVerbose (line 846) | [DllImport(nativeLibName, EntryPoint = "SDL_LogVerbose", CallingConven...
    method SDL_LogVerbose (line 851) | public static unsafe void SDL_LogVerbose(
    method INTERNAL_SDL_LogDebug (line 864) | [DllImport(nativeLibName, EntryPoint = "SDL_LogDebug", CallingConventi...
    method SDL_LogDebug (line 869) | public static unsafe void SDL_LogDebug(
    method INTERNAL_SDL_LogInfo (line 882) | [DllImport(nativeLibName, EntryPoint = "SDL_LogInfo", CallingConventio...
    method SDL_LogInfo (line 887) | public static unsafe void SDL_LogInfo(
    method INTERNAL_SDL_LogWarn (line 900) | [DllImport(nativeLibName, EntryPoint = "SDL_LogWarn", CallingConventio...
    method SDL_LogWarn (line 905) | public static unsafe void SDL_LogWarn(
    method INTERNAL_SDL_LogError (line 918) | [DllImport(nativeLibName, EntryPoint = "SDL_LogError", CallingConventi...
    method SDL_LogError (line 923) | public static unsafe void SDL_LogError(
    method INTERNAL_SDL_LogCritical (line 936) | [DllImport(nativeLibName, EntryPoint = "SDL_LogCritical", CallingConve...
    method SDL_LogCritical (line 941) | public static unsafe void SDL_LogCritical(
    method INTERNAL_SDL_LogMessage (line 954) | [DllImport(nativeLibName, EntryPoint = "SDL_LogMessage", CallingConven...
    method SDL_LogMessage (line 960) | public static unsafe void SDL_LogMessage(
    method INTERNAL_SDL_LogMessageV (line 975) | [DllImport(nativeLibName, EntryPoint = "SDL_LogMessageV", CallingConve...
    method SDL_LogMessageV (line 981) | public static unsafe void SDL_LogMessageV(
    method SDL_LogGetPriority (line 995) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LogSetPriority (line 1000) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LogSetAllPriority (line 1006) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LogResetPriorities (line 1011) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LogGetOutputFunction (line 1015) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LogGetOutputFunction (line 1020) | public static void SDL_LogGetOutputFunction(
    method SDL_LogSetOutputFunction (line 1043) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_MessageBoxFlags (line 1053) | [Flags]
    type SDL_MessageBoxButtonFlags (line 1061) | [Flags]
    type INTERNAL_SDL_MessageBoxButtonData (line 1068) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MessageBoxButtonData (line 1076) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MessageBoxColor (line 1084) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MessageBoxColorType (line 1090) | public enum SDL_MessageBoxColorType
    type SDL_MessageBoxColorScheme (line 1100) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_SDL_MessageBoxData (line 1107) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MessageBoxData (line 1119) | [StructLayout(LayoutKind.Sequential)]
    method INTERNAL_SDL_ShowMessageBox (line 1131) | [DllImport(nativeLibName, EntryPoint = "SDL_ShowMessageBox", CallingCo...
    method INTERNAL_AllocUTF8 (line 1135) | private static IntPtr INTERNAL_AllocUTF8(string str)
    method SDL_ShowMessageBox (line 1147) | public static unsafe int SDL_ShowMessageBox([In()] ref SDL_MessageBoxD...
    method INTERNAL_SDL_ShowSimpleMessageBox (line 1194) | [DllImport(nativeLibName, EntryPoint = "SDL_ShowSimpleMessageBox", Cal...
    method SDL_ShowSimpleMessageBox (line 1201) | public static unsafe int SDL_ShowSimpleMessageBox(
    type SDL_version (line 1239) | [StructLayout(LayoutKind.Sequential)]
    method SDL_VERSION (line 1247) | public static void SDL_VERSION(out SDL_version x)
    method SDL_VERSIONNUM (line 1254) | public static int SDL_VERSIONNUM(int X, int Y, int Z)
    method SDL_VERSION_ATLEAST (line 1259) | public static bool SDL_VERSION_ATLEAST(int X, int Y, int Z)
    method SDL_GetVersion (line 1264) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetRevision (line 1267) | [DllImport(nativeLibName, EntryPoint = "SDL_GetRevision", CallingConve...
    method SDL_GetRevision (line 1269) | public static string SDL_GetRevision()
    method SDL_GetRevisionNumber (line 1274) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_GLattr (line 1281) | public enum SDL_GLattr
    type SDL_GLprofile (line 1312) | [Flags]
    type SDL_GLcontext (line 1320) | [Flags]
    type SDL_WindowEventID (line 1329) | public enum SDL_WindowEventID : byte
    type SDL_DisplayEventID (line 1351) | public enum SDL_DisplayEventID : byte
    type SDL_DisplayOrientation (line 1357) | public enum SDL_DisplayOrientation
    type SDL_WindowFlags (line 1366) | [Flags]
    type SDL_HitTestResult (line 1394) | public enum SDL_HitTestResult
    method SDL_WINDOWPOS_UNDEFINED_DISPLAY (line 1413) | public static int SDL_WINDOWPOS_UNDEFINED_DISPLAY(int X)
    method SDL_WINDOWPOS_ISUNDEFINED (line 1418) | public static bool SDL_WINDOWPOS_ISUNDEFINED(int X)
    method SDL_WINDOWPOS_CENTERED_DISPLAY (line 1423) | public static int SDL_WINDOWPOS_CENTERED_DISPLAY(int X)
    method SDL_WINDOWPOS_ISCENTERED (line 1428) | public static bool SDL_WINDOWPOS_ISCENTERED(int X)
    type SDL_DisplayMode (line 1433) | [StructLayout(LayoutKind.Sequential)]
    method INTERNAL_SDL_CreateWindow (line 1450) | [DllImport(nativeLibName, EntryPoint = "SDL_CreateWindow", CallingConv...
    method SDL_CreateWindow (line 1459) | public static unsafe IntPtr SDL_CreateWindow(
    method SDL_CreateWindowAndRenderer (line 1477) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateWindowFrom (line 1487) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DestroyWindow (line 1491) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DisableScreenSaver (line 1494) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_EnableScreenSaver (line 1497) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetClosestDisplayMode (line 1501) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetCurrentDisplayMode (line 1508) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetCurrentVideoDriver (line 1514) | [DllImport(nativeLibName, EntryPoint = "SDL_GetCurrentVideoDriver", Ca...
    method SDL_GetCurrentVideoDriver (line 1516) | public static string SDL_GetCurrentVideoDriver()
    method SDL_GetDesktopDisplayMode (line 1521) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetDisplayName (line 1527) | [DllImport(nativeLibName, EntryPoint = "SDL_GetDisplayName", CallingCo...
    method SDL_GetDisplayName (line 1529) | public static string SDL_GetDisplayName(int index)
    method SDL_GetDisplayBounds (line 1534) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetDisplayDPI (line 1541) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetDisplayOrientation (line 1550) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetDisplayMode (line 1555) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetDisplayUsableBounds (line 1563) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumDisplayModes (line 1569) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumVideoDisplays (line 1574) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumVideoDrivers (line 1577) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetVideoDriver (line 1580) | [DllImport(nativeLibName, EntryPoint = "SDL_GetVideoDriver", CallingCo...
    method SDL_GetVideoDriver (line 1584) | public static string SDL_GetVideoDriver(int index)
    method SDL_GetWindowBrightness (line 1590) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowOpacity (line 1598) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowOpacity (line 1607) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowModalFor (line 1616) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowInputFocus (line 1625) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetWindowData (line 1629) | [DllImport(nativeLibName, EntryPoint = "SDL_GetWindowData", CallingCon...
    method SDL_GetWindowData (line 1634) | public static unsafe IntPtr SDL_GetWindowData(
    method SDL_GetWindowDisplayIndex (line 1647) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowDisplayMode (line 1653) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowFlags (line 1660) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowFromID (line 1664) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowGammaRamp (line 1668) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowGrab (line 1680) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowID (line 1684) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowPixelFormat (line 1688) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowMaximumSize (line 1694) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowMinimumSize (line 1702) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowPosition (line 1710) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowSize (line 1718) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowSurface (line 1726) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetWindowTitle (line 1730) | [DllImport(nativeLibName, EntryPoint = "SDL_GetWindowTitle", CallingCo...
    method SDL_GetWindowTitle (line 1734) | public static string SDL_GetWindowTitle(IntPtr window)
    method SDL_GL_BindTexture (line 1742) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_CreateContext (line 1750) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_DeleteContext (line 1754) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GL_LoadLibrary (line 1757) | [DllImport(nativeLibName, EntryPoint = "SDL_GL_LoadLibrary", CallingCo...
    method SDL_GL_LoadLibrary (line 1759) | public static unsafe int SDL_GL_LoadLibrary(string path)
    method SDL_GL_GetProcAddress (line 1770) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetProcAddress (line 1774) | public static unsafe IntPtr SDL_GL_GetProcAddress(string proc)
    method SDL_GL_UnloadLibrary (line 1783) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GL_ExtensionSupported (line 1786) | [DllImport(nativeLibName, EntryPoint = "SDL_GL_ExtensionSupported", Ca...
    method SDL_GL_ExtensionSupported (line 1790) | public static unsafe SDL_bool SDL_GL_ExtensionSupported(string extension)
    method SDL_GL_ResetAttributes (line 1800) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetAttribute (line 1803) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetSwapInterval (line 1809) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_MakeCurrent (line 1813) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetCurrentWindow (line 1820) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetCurrentContext (line 1824) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_GetDrawableSize (line 1830) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_SetAttribute (line 1837) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_SetAttribute (line 1843) | public static int SDL_GL_SetAttribute(
    method SDL_GL_SetSwapInterval (line 1850) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_SwapWindow (line 1854) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GL_UnbindTexture (line 1858) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HideWindow (line 1862) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsScreenSaverEnabled (line 1865) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MaximizeWindow (line 1869) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MinimizeWindow (line 1873) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RaiseWindow (line 1877) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RestoreWindow (line 1881) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowBrightness (line 1885) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_SetWindowData (line 1892) | [DllImport(nativeLibName, EntryPoint = "SDL_SetWindowData", CallingCon...
    method SDL_SetWindowData (line 1898) | public static unsafe IntPtr SDL_SetWindowData(
    method SDL_SetWindowDisplayMode (line 1913) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowFullscreen (line 1920) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowGammaRamp (line 1927) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowGrab (line 1939) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowIcon (line 1946) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowMaximumSize (line 1953) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowMinimumSize (line 1961) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowPosition (line 1969) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowSize (line 1977) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowBordered (line 1985) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetWindowBordersSize (line 1992) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowResizable (line 2004) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_SetWindowTitle (line 2011) | [DllImport(nativeLibName, EntryPoint = "SDL_SetWindowTitle", CallingCo...
    method SDL_SetWindowTitle (line 2016) | public static unsafe void SDL_SetWindowTitle(
    method SDL_ShowWindow (line 2029) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpdateWindowSurface (line 2033) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpdateWindowSurfaceRects (line 2037) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_VideoInit (line 2044) | [DllImport(nativeLibName, EntryPoint = "SDL_VideoInit", CallingConvent...
    method SDL_VideoInit (line 2048) | public static unsafe int SDL_VideoInit(string driver_name)
    method SDL_VideoQuit (line 2057) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowHitTest (line 2063) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetGrabbedWindow (line 2073) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_BlendMode (line 2080) | [Flags]
    type SDL_BlendOperation (line 2091) | public enum SDL_BlendOperation
    type SDL_BlendFactor (line 2100) | public enum SDL_BlendFactor
    method SDL_ComposeCustomBlendMode (line 2115) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_Vulkan_LoadLibrary (line 2130) | [DllImport(nativeLibName, EntryPoint = "SDL_Vulkan_LoadLibrary", Calli...
    method SDL_Vulkan_LoadLibrary (line 2134) | public static unsafe int SDL_Vulkan_LoadLibrary(string path)
    method SDL_Vulkan_GetVkGetInstanceProcAddr (line 2145) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Vulkan_UnloadLibrary (line 2149) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Vulkan_GetInstanceExtensions (line 2155) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Vulkan_CreateSurface (line 2167) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Vulkan_GetDrawableSize (line 2177) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Metal_CreateView (line 2189) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Metal_DestroyView (line 2195) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_RendererFlags (line 2204) | [Flags]
    type SDL_RendererFlip (line 2213) | [Flags]
    type SDL_TextureAccess (line 2221) | public enum SDL_TextureAccess
    type SDL_TextureModulate (line 2228) | [Flags]
    type SDL_RendererInfo (line 2236) | [StructLayout(LayoutKind.Sequential)]
    type SDL_ScaleMode (line 2248) | public enum SDL_ScaleMode
    method SDL_CreateRenderer (line 2256) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateSoftwareRenderer (line 2264) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateTexture (line 2268) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateTextureFromSurface (line 2281) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DestroyRenderer (line 2288) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DestroyTexture (line 2292) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumRenderDrivers (line 2295) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRenderDrawBlendMode (line 2299) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetTextureScaleMode (line 2308) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTextureScaleMode (line 2317) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRenderDrawColor (line 2324) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRenderDriverInfo (line 2333) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRenderer (line 2340) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRendererInfo (line 2344) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRendererOutputSize (line 2351) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTextureAlphaMod (line 2359) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTextureBlendMode (line 2366) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTextureColorMod (line 2373) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockTexture (line 2382) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockTexture (line 2395) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockTextureToSurface (line 2406) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockTextureToSurface (line 2419) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_QueryTexture (line 2427) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderClear (line 2437) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopy (line 2441) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopy (line 2454) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopy (line 2467) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopy (line 2480) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2489) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2505) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2521) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2537) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2554) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2571) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2588) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2605) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawLine (line 2617) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawLines (line 2627) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawPoint (line 2635) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawPoints (line 2643) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRect (line 2651) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRect (line 2660) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRects (line 2667) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRect (line 2675) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRect (line 2684) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRects (line 2691) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyF (line 2703) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyF (line 2716) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyF (line 2729) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyF (line 2742) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2751) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyEx (line 2767) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2783) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2799) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2816) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2833) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2850) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderCopyExF (line 2867) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawPointF (line 2879) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawPointsF (line 2887) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawLineF (line 2895) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawLinesF (line 2905) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRectF (line 2913) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRectF (line 2922) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderDrawRectsF (line 2929) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRectF (line 2937) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRectF (line 2946) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFillRectsF (line 2953) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetClipRect (line 2963) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetLogicalSize (line 2970) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetScale (line 2978) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetViewport (line 2986) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderPresent (line 2993) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderReadPixels (line 2997) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetClipRect (line 3007) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetClipRect (line 3016) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetLogicalSize (line 3023) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetScale (line 3031) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetIntegerScale (line 3041) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderSetViewport (line 3048) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetRenderDrawBlendMode (line 3055) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetRenderDrawColor (line 3062) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetRenderTarget (line 3072) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetTextureAlphaMod (line 3079) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetTextureBlendMode (line 3086) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetTextureColorMod (line 3093) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UnlockTexture (line 3102) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpdateTexture (line 3106) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpdateTexture (line 3115) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpdateYUVTexture (line 3126) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderTargetSupported (line 3139) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRenderTarget (line 3145) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetMetalLayer (line 3151) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderGetMetalCommandEncoder (line 3159) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderIsClipEnabled (line 3167) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RenderFlush (line 3173) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DEFINE_PIXELFOURCC (line 3180) | public static uint SDL_DEFINE_PIXELFOURCC(byte A, byte B, byte C, byte D)
    method SDL_DEFINE_PIXELFORMAT (line 3185) | public static uint SDL_DEFINE_PIXELFORMAT(
    method SDL_PIXELFLAG (line 3202) | public static byte SDL_PIXELFLAG(uint X)
    method SDL_PIXELTYPE (line 3207) | public static byte SDL_PIXELTYPE(uint X)
    method SDL_PIXELORDER (line 3212) | public static byte SDL_PIXELORDER(uint X)
    method SDL_PIXELLAYOUT (line 3217) | public static byte SDL_PIXELLAYOUT(uint X)
    method SDL_BITSPERPIXEL (line 3222) | public static byte SDL_BITSPERPIXEL(uint X)
    method SDL_BYTESPERPIXEL (line 3227) | public static byte SDL_BYTESPERPIXEL(uint X)
    method SDL_ISPIXELFORMAT_INDEXED (line 3242) | public static bool SDL_ISPIXELFORMAT_INDEXED(uint format)
    method SDL_ISPIXELFORMAT_PACKED (line 3257) | public static bool SDL_ISPIXELFORMAT_PACKED(uint format)
    method SDL_ISPIXELFORMAT_ARRAY (line 3272) | public static bool SDL_ISPIXELFORMAT_ARRAY(uint format)
    method SDL_ISPIXELFORMAT_ALPHA (line 3289) | public static bool SDL_ISPIXELFORMAT_ALPHA(uint format)
    method SDL_ISPIXELFORMAT_FOURCC (line 3316) | public static bool SDL_ISPIXELFORMAT_FOURCC(uint format)
    type SDL_PixelType (line 3321) | public enum SDL_PixelType
    type SDL_BitmapOrder (line 3337) | public enum SDL_BitmapOrder
    type SDL_PackedOrder (line 3344) | public enum SDL_PackedOrder
    type SDL_ArrayOrder (line 3357) | public enum SDL_ArrayOrder
    type SDL_PackedLayout (line 3368) | public enum SDL_PackedLayout
    type SDL_Color (line 3620) | [StructLayout(LayoutKind.Sequential)]
    type SDL_Palette (line 3629) | [StructLayout(LayoutKind.Sequential)]
    type SDL_PixelFormat (line 3638) | [StructLayout(LayoutKind.Sequential)]
    method SDL_AllocFormat (line 3662) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AllocPalette (line 3666) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CalculateGammaRamp (line 3669) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeFormat (line 3677) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreePalette (line 3681) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetPixelFormatName (line 3684) | [DllImport(nativeLibName, EntryPoint = "SDL_GetPixelFormatName", Calli...
    method SDL_GetPixelFormatName (line 3688) | public static string SDL_GetPixelFormatName(uint format)
    method SDL_GetRGB (line 3696) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRGBA (line 3706) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MapRGB (line 3717) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MapRGBA (line 3726) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MasksToPixelFormatEnum (line 3735) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_PixelFormatEnumToMasks (line 3744) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetPaletteColors (line 3755) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetPixelFormatPalette (line 3764) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_Point (line 3774) | [StructLayout(LayoutKind.Sequential)]
    type SDL_Rect (line 3781) | [StructLayout(LayoutKind.Sequential)]
    type SDL_FPoint (line 3791) | [StructLayout(LayoutKind.Sequential)]
    type SDL_FRect (line 3799) | [StructLayout(LayoutKind.Sequential)]
    method SDL_PointInRect (line 3809) | public static SDL_bool SDL_PointInRect(ref SDL_Point p, ref SDL_Rect r)
    method SDL_EnclosePoints (line 3819) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasIntersection (line 3827) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IntersectRect (line 3833) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IntersectRectAndLine (line 3840) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RectEmpty (line 3849) | public static SDL_bool SDL_RectEmpty(ref SDL_Rect r)
    method SDL_RectEquals (line 3856) | public static SDL_bool SDL_RectEquals(
    method SDL_UnionRect (line 3868) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_Surface (line 3884) | [StructLayout(LayoutKind.Sequential)]
    method SDL_MUSTLOCK (line 3902) | public static bool SDL_MUSTLOCK(IntPtr surface)
    method SDL_BlitSurface (line 3913) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvent...
    method SDL_BlitSurface (line 3926) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvent...
    method SDL_BlitSurface (line 3939) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvent...
    method SDL_BlitSurface (line 3952) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvent...
    method SDL_BlitScaled (line 3961) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingC...
    method SDL_BlitScaled (line 3974) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingC...
    method SDL_BlitScaled (line 3987) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingC...
    method SDL_BlitScaled (line 4000) | [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingC...
    method SDL_ConvertPixels (line 4009) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ConvertSurface (line 4025) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ConvertSurfaceFormat (line 4033) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateRGBSurface (line 4041) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateRGBSurfaceFrom (line 4054) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateRGBSurfaceWithFormat (line 4070) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateRGBSurfaceWithFormatFrom (line 4082) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FillRect (line 4093) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FillRect (line 4103) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FillRects (line 4111) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeSurface (line 4120) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetClipRect (line 4124) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasColorKey (line 4133) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetColorKey (line 4137) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetSurfaceAlphaMod (line 4144) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetSurfaceBlendMode (line 4151) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetSurfaceColorMod (line 4158) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_LoadBMP_RW (line 4169) | [DllImport(nativeLibName, EntryPoint = "SDL_LoadBMP_RW", CallingConven...
    method SDL_LoadBMP (line 4174) | public static IntPtr SDL_LoadBMP(string file)
    method SDL_LockSurface (line 4181) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LowerBlit (line 4185) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LowerBlitScaled (line 4194) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_SaveBMP_RW (line 4205) | [DllImport(nativeLibName, EntryPoint = "SDL_SaveBMP_RW", CallingConven...
    method SDL_SaveBMP (line 4211) | public static int SDL_SaveBMP(IntPtr surface, string file)
    method SDL_SetClipRect (line 4218) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetColorKey (line 4225) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetSurfaceAlphaMod (line 4233) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetSurfaceBlendMode (line 4240) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetSurfaceColorMod (line 4247) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetSurfacePalette (line 4256) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetSurfaceRLE (line 4263) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SoftStretch (line 4270) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UnlockSurface (line 4279) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpperBlit (line 4283) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UpperBlitScaled (line 4292) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DuplicateSurface (line 4301) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasClipboardText (line 4308) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetClipboardText (line 4311) | [DllImport(nativeLibName, EntryPoint = "SDL_GetClipboardText", Calling...
    method SDL_GetClipboardText (line 4313) | public static string SDL_GetClipboardText()
    method INTERNAL_SDL_SetClipboardText (line 4318) | [DllImport(nativeLibName, EntryPoint = "SDL_SetClipboardText", Calling...
    method SDL_SetClipboardText (line 4322) | public static unsafe int SDL_SetClipboardText(
    type SDL_EventType (line 4346) | public enum SDL_EventType : uint
    type SDL_MouseWheelDirection (line 4445) | public enum SDL_MouseWheelDirection : uint
    type SDL_GenericEvent (line 4452) | [StructLayout(LayoutKind.Sequential)]
    type SDL_DisplayEvent (line 4461) | [StructLayout(LayoutKind.Sequential)]
    type SDL_WindowEvent (line 4478) | [StructLayout(LayoutKind.Sequential)]
    type SDL_KeyboardEvent (line 4496) | [StructLayout(LayoutKind.Sequential)]
    type SDL_TextEditingEvent (line 4510) | [StructLayout(LayoutKind.Sequential)]
    type SDL_TextInputEvent (line 4521) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MouseMotionEvent (line 4533) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MouseButtonEvent (line 4554) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MouseWheelEvent (line 4571) | [StructLayout(LayoutKind.Sequential)]
    type SDL_JoyAxisEvent (line 4586) | [StructLayout(LayoutKind.Sequential)]
    type SDL_JoyBallEvent (line 4604) | [StructLayout(LayoutKind.Sequential)]
    type SDL_JoyHatEvent (line 4622) | [StructLayout(LayoutKind.Sequential)]
    type SDL_JoyButtonEvent (line 4638) | [StructLayout(LayoutKind.Sequential)]
    type SDL_JoyDeviceEvent (line 4652) | [StructLayout(LayoutKind.Sequential)]
    type SDL_ControllerAxisEvent (line 4663) | [StructLayout(LayoutKind.Sequential)]
    type SDL_ControllerButtonEvent (line 4681) | [StructLayout(LayoutKind.Sequential)]
    type SDL_ControllerDeviceEvent (line 4695) | [StructLayout(LayoutKind.Sequential)]
    type SDL_AudioDeviceEvent (line 4708) | [StructLayout(LayoutKind.Sequential)]
    type SDL_TouchFingerEvent (line 4721) | [StructLayout(LayoutKind.Sequential)]
    type SDL_MultiGestureEvent (line 4736) | [StructLayout(LayoutKind.Sequential)]
    type SDL_DollarGestureEvent (line 4750) | [StructLayout(LayoutKind.Sequential)]
    type SDL_DropEvent (line 4766) | [StructLayout(LayoutKind.Sequential)]
    type SDL_SensorEvent (line 4780) | [StructLayout(LayoutKind.Sequential)]
    type SDL_QuitEvent (line 4790) | [StructLayout(LayoutKind.Sequential)]
    type SDL_UserEvent (line 4798) | [StructLayout(LayoutKind.Sequential)]
    type SDL_SysWMEvent (line 4810) | [StructLayout(LayoutKind.Sequential)]
    type SDL_Event (line 4820) | [StructLayout(LayoutKind.Explicit)]
    method SDL_PumpEvents (line 4888) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_eventaction (line 4891) | public enum SDL_eventaction
    method SDL_PeepEvents (line 4898) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasEvent (line 4908) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasEvents (line 4911) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FlushEvent (line 4918) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FlushEvents (line 4921) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_PollEvent (line 4928) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WaitEvent (line 4932) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WaitEventTimeout (line 4937) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_PushEvent (line 4941) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetEventFilter (line 4945) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetEventFilter (line 4952) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetEventFilter (line 4957) | public static SDL_bool SDL_GetEventFilter(
    method SDL_AddEventWatch (line 4978) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DelEventWatch (line 4985) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FilterEvents (line 4992) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_EventState (line 5005) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetEventState (line 5009) | public static byte SDL_GetEventState(SDL_EventType type)
    method SDL_RegisterEvents (line 5015) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_Scancode (line 5022) | public enum SDL_Scancode
    method SDL_SCANCODE_TO_KEYCODE (line 5303) | public static SDL_Keycode SDL_SCANCODE_TO_KEYCODE(SDL_Scancode X)
    type SDL_Keycode (line 5308) | public enum SDL_Keycode
    type SDL_Keymod (line 5581) | [Flags]
    type SDL_Keysym (line 5609) | [StructLayout(LayoutKind.Sequential)]
    method SDL_GetKeyboardFocus (line 5620) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetKeyboardState (line 5626) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetModState (line 5630) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetModState (line 5634) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetKeyFromScancode (line 5640) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetScancodeFromKey (line 5644) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetScancodeName (line 5648) | [DllImport(nativeLibName, EntryPoint = "SDL_GetScancodeName", CallingC...
    method SDL_GetScancodeName (line 5650) | public static string SDL_GetScancodeName(SDL_Scancode scancode)
    method INTERNAL_SDL_GetScancodeFromName (line 5658) | [DllImport(nativeLibName, EntryPoint = "SDL_GetScancodeFromName", Call...
    method SDL_GetScancodeFromName (line 5662) | public static unsafe SDL_Scancode SDL_GetScancodeFromName(string name)
    method INTERNAL_SDL_GetKeyName (line 5672) | [DllImport(nativeLibName, EntryPoint = "SDL_GetKeyName", CallingConven...
    method SDL_GetKeyName (line 5674) | public static string SDL_GetKeyName(SDL_Keycode key)
    method INTERNAL_SDL_GetKeyFromName (line 5680) | [DllImport(nativeLibName, EntryPoint = "SDL_GetKeyFromName", CallingCo...
    method SDL_GetKeyFromName (line 5684) | public static unsafe SDL_Keycode SDL_GetKeyFromName(string name)
    method SDL_StartTextInput (line 5694) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsTextInputActive (line 5698) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_StopTextInput (line 5702) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetTextInputRect (line 5706) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasScreenKeyboardSupport (line 5710) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsScreenKeyboardShown (line 5715) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_SystemCursor (line 5727) | public enum SDL_SystemCursor
    method SDL_GetMouseFocus (line 5746) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetMouseState (line 5750) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetMouseState (line 5755) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetMouseState (line 5760) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetMouseState (line 5765) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetGlobalMouseState (line 5771) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetGlobalMouseState (line 5778) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetGlobalMouseState (line 5785) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetGlobalMouseState (line 5792) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRelativeMouseState (line 5796) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WarpMouseInWindow (line 5801) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_WarpMouseGlobal (line 5807) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetRelativeMouseMode (line 5811) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CaptureMouse (line 5817) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetRelativeMouseMode (line 5821) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateCursor (line 5828) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateColorCursor (line 5841) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CreateSystemCursor (line 5851) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetCursor (line 5857) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetCursor (line 5863) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeCursor (line 5869) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ShowCursor (line 5873) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_BUTTON (line 5876) | public static uint SDL_BUTTON(uint X)
    type SDL_Finger (line 5899) | public struct SDL_Finger
    type SDL_TouchDeviceType (line 5908) | public enum SDL_TouchDeviceType
    method SDL_GetNumTouchDevices (line 5919) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTouchDevice (line 5925) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumTouchFingers (line 5931) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTouchFinger (line 5938) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTouchDeviceType (line 5942) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_JoystickPowerLevel (line 5959) | public enum SDL_JoystickPowerLevel
    type SDL_JoystickType (line 5970) | public enum SDL_JoystickType
    method SDL_JoystickRumble (line 5986) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickClose (line 5995) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickEventState (line 5998) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetAxis (line 6002) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetAxisInitialState (line 6011) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetBall (line 6019) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetButton (line 6028) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetHat (line 6035) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_JoystickName (line 6042) | [DllImport(nativeLibName, EntryPoint = "SDL_JoystickName", CallingConv...
    method SDL_JoystickName (line 6046) | public static string SDL_JoystickName(IntPtr joystick)
    method INTERNAL_SDL_JoystickNameForIndex (line 6053) | [DllImport(nativeLibName, EntryPoint = "SDL_JoystickNameForIndex", Cal...
    method SDL_JoystickNameForIndex (line 6057) | public static string SDL_JoystickNameForIndex(int device_index)
    method SDL_JoystickNumAxes (line 6065) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickNumBalls (line 6069) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickNumButtons (line 6073) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickNumHats (line 6077) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickOpen (line 6081) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickUpdate (line 6085) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_NumJoysticks (line 6089) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetDeviceGUID (line 6092) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetGUID (line 6098) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetGUIDString (line 6103) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_JoystickGetGUIDFromString (line 6110) | [DllImport(nativeLibName, EntryPoint = "SDL_JoystickGetGUIDFromString"...
    method SDL_JoystickGetGUIDFromString (line 6114) | public static unsafe Guid SDL_JoystickGetGUIDFromString(string pchGuid)
    method SDL_JoystickGetDeviceVendor (line 6124) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetDeviceProduct (line 6128) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetDeviceProductVersion (line 6132) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetDeviceType (line 6136) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetDeviceInstanceID (line 6142) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetVendor (line 6148) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetProduct (line 6154) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetProductVersion (line 6160) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetType (line 6166) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickGetAttached (line 6170) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickInstanceID (line 6174) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickCurrentPowerLevel (line 6180) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickFromInstanceID (line 6188) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockJoysticks (line 6192) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UnlockJoysticks (line 6196) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickFromPlayerIndex (line 6202) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickSetPlayerIndex (line 6208) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_GameControllerBindType (line 6218) | public enum SDL_GameControllerBindType
    type SDL_GameControllerAxis (line 6226) | public enum SDL_GameControllerAxis
    type SDL_GameControllerButton (line 6238) | public enum SDL_GameControllerButton
    type SDL_GameControllerType (line 6259) | public enum SDL_GameControllerType
    type INTERNAL_GameControllerButtonBind_hat (line 6270) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_GameControllerButtonBind_union (line 6278) | [StructLayout(LayoutKind.Explicit)]
    type SDL_GameControllerButtonBind (line 6289) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_SDL_GameControllerButtonBind (line 6297) | [StructLayout(LayoutKind.Sequential)]
    method INTERNAL_SDL_GameControllerAddMapping (line 6306) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerAddMapping",...
    method SDL_GameControllerAddMapping (line 6310) | public static unsafe int SDL_GameControllerAddMapping(
    method SDL_GameControllerNumMappings (line 6322) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GameControllerMappingForIndex (line 6326) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForIn...
    method SDL_GameControllerMappingForIndex (line 6328) | public static string SDL_GameControllerMappingForIndex(int mapping_index)
    method INTERNAL_SDL_GameControllerAddMappingsFromRW (line 6338) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerAddMappingsF...
    method SDL_GameControllerAddMappingsFromFile (line 6343) | public static int SDL_GameControllerAddMappingsFromFile(string file)
    method INTERNAL_SDL_GameControllerMappingForGUID (line 6349) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForGU...
    method SDL_GameControllerMappingForGUID (line 6353) | public static string SDL_GameControllerMappingForGUID(Guid guid)
    method INTERNAL_SDL_GameControllerMapping (line 6361) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMapping", Ca...
    method SDL_GameControllerMapping (line 6365) | public static string SDL_GameControllerMapping(
    method SDL_IsGameController (line 6375) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GameControllerNameForIndex (line 6378) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerNameForIndex...
    method SDL_GameControllerNameForIndex (line 6382) | public static string SDL_GameControllerNameForIndex(
    method INTERNAL_SDL_GameControllerMappingForDeviceIndex (line 6391) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerMappingForDe...
    method SDL_GameControllerMappingForDeviceIndex (line 6395) | public static string SDL_GameControllerMappingForDeviceIndex(
    method SDL_GameControllerOpen (line 6404) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GameControllerName (line 6408) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerName", Calli...
    method SDL_GameControllerName (line 6412) | public static string SDL_GameControllerName(
    method SDL_GameControllerGetVendor (line 6423) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerGetProduct (line 6431) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerGetProductVersion (line 6439) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerGetAttached (line 6445) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerGetJoystick (line 6453) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerEventState (line 6458) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerUpdate (line 6461) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GameControllerGetAxisFromString (line 6464) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetAxisFromS...
    method SDL_GameControllerGetAxisFromString (line 6468) | public static unsafe SDL_GameControllerAxis SDL_GameControllerGetAxisF...
    method INTERNAL_SDL_GameControllerGetStringForAxis (line 6478) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetStringFor...
    method SDL_GameControllerGetStringForAxis (line 6482) | public static string SDL_GameControllerGetStringForAxis(
    method INTERNAL_SDL_GameControllerGetBindForAxis (line 6493) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetBindForAx...
    method SDL_GameControllerGetBindForAxis (line 6498) | public static SDL_GameControllerButtonBind SDL_GameControllerGetBindFo...
    method SDL_GameControllerGetAxis (line 6515) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GameControllerGetButtonFromString (line 6521) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetButtonFro...
    method SDL_GameControllerGetButtonFromString (line 6525) | public static unsafe SDL_GameControllerButton SDL_GameControllerGetBut...
    method INTERNAL_SDL_GameControllerGetStringForButton (line 6535) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetStringFor...
    method SDL_GameControllerGetStringForButton (line 6539) | public static string SDL_GameControllerGetStringForButton(
    method INTERNAL_SDL_GameControllerGetBindForButton (line 6548) | [DllImport(nativeLibName, EntryPoint = "SDL_GameControllerGetBindForBu...
    method SDL_GameControllerGetBindForButton (line 6553) | public static SDL_GameControllerButtonBind SDL_GameControllerGetBindFo...
    method SDL_GameControllerGetButton (line 6570) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerRumble (line 6579) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerClose (line 6588) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerFromInstanceID (line 6596) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerTypeForIndex (line 6600) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerGetType (line 6608) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerFromPlayerIndex (line 6616) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GameControllerSetPlayerIndex (line 6624) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_HapticDirection (line 6659) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticConstant (line 6666) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticPeriodic (line 6687) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticCondition (line 6711) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticRamp (line 6732) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticLeftRight (line 6754) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticCustom (line 6766) | [StructLayout(LayoutKind.Sequential)]
    type SDL_HapticEffect (line 6790) | [StructLayout(LayoutKind.Explicit)]
    method SDL_HapticClose (line 6810) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticDestroyEffect (line 6814) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticEffectSupported (line 6821) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticGetEffectStatus (line 6828) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticIndex (line 6835) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_HapticName (line 6839) | [DllImport(nativeLibName, EntryPoint = "SDL_HapticName", CallingConven...
    method SDL_HapticName (line 6841) | public static string SDL_HapticName(int device_index)
    method SDL_HapticNewEffect (line 6847) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticNumAxes (line 6854) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticNumEffects (line 6858) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticNumEffectsPlaying (line 6862) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticOpen (line 6866) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticOpened (line 6869) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticOpenFromJoystick (line 6873) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticOpenFromMouse (line 6879) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticPause (line 6883) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticQuery (line 6887) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticRumbleInit (line 6891) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticRumblePlay (line 6895) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticRumbleStop (line 6903) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticRumbleSupported (line 6907) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticRunEffect (line 6911) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticSetAutocenter (line 6919) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticSetGain (line 6926) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticStopAll (line 6933) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticStopEffect (line 6937) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticUnpause (line 6944) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HapticUpdateEffect (line 6948) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_JoystickIsHaptic (line 6956) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MouseIsHaptic (line 6959) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_NumHaptics (line 6962) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_SensorType (line 6971) | public enum SDL_SensorType
    method SDL_NumSensors (line 6981) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_SensorGetDeviceName (line 6984) | [DllImport(nativeLibName, EntryPoint = "SDL_SensorGetDeviceName", Call...
    method SDL_SensorGetDeviceName (line 6986) | public static string SDL_SensorGetDeviceName(int device_index)
    method SDL_SensorGetDeviceType (line 6991) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorGetDeviceNonPortableType (line 6994) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorGetDeviceInstanceID (line 6997) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorOpen (line 7001) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorFromInstanceID (line 7005) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_SensorGetName (line 7011) | [DllImport(nativeLibName, EntryPoint = "SDL_SensorGetName", CallingCon...
    method SDL_SensorGetName (line 7013) | public static string SDL_SensorGetName(IntPtr sensor)
    method SDL_SensorGetType (line 7019) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorGetNonPortableType (line 7023) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorGetInstanceID (line 7027) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorGetData (line 7031) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorClose (line 7039) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SensorUpdate (line 7042) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AUDIO_BITSIZE (line 7054) | public static ushort SDL_AUDIO_BITSIZE(ushort x)
    method SDL_AUDIO_ISFLOAT (line 7059) | public static bool SDL_AUDIO_ISFLOAT(ushort x)
    method SDL_AUDIO_ISBIGENDIAN (line 7064) | public static bool SDL_AUDIO_ISBIGENDIAN(ushort x)
    method SDL_AUDIO_ISSIGNED (line 7069) | public static bool SDL_AUDIO_ISSIGNED(ushort x)
    method SDL_AUDIO_ISINT (line 7074) | public static bool SDL_AUDIO_ISINT(ushort x)
    method SDL_AUDIO_ISLITTLEENDIAN (line 7079) | public static bool SDL_AUDIO_ISLITTLEENDIAN(ushort x)
    method SDL_AUDIO_ISUNSIGNED (line 7084) | public static bool SDL_AUDIO_ISUNSIGNED(ushort x)
    type SDL_AudioStatus (line 7126) | public enum SDL_AudioStatus
    type SDL_AudioSpec (line 7133) | [StructLayout(LayoutKind.Sequential)]
    method INTERNAL_SDL_AudioInit (line 7154) | [DllImport(nativeLibName, EntryPoint = "SDL_AudioInit", CallingConvent...
    method SDL_AudioInit (line 7158) | public static unsafe int SDL_AudioInit(string driver_name)
    method SDL_AudioQuit (line 7167) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CloseAudio (line 7170) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_CloseAudioDevice (line 7174) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeWAV (line 7178) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetAudioDeviceName (line 7181) | [DllImport(nativeLibName, EntryPoint = "SDL_GetAudioDeviceName", Calli...
    method SDL_GetAudioDeviceName (line 7186) | public static string SDL_GetAudioDeviceName(
    method SDL_GetAudioDeviceStatus (line 7196) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetAudioDriver (line 7201) | [DllImport(nativeLibName, EntryPoint = "SDL_GetAudioDriver", CallingCo...
    method SDL_GetAudioDriver (line 7203) | public static string SDL_GetAudioDriver(int index)
    method SDL_GetAudioStatus (line 7210) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetCurrentAudioDriver (line 7213) | [DllImport(nativeLibName, EntryPoint = "SDL_GetCurrentAudioDriver", Ca...
    method SDL_GetCurrentAudioDriver (line 7215) | public static string SDL_GetCurrentAudioDriver()
    method SDL_GetNumAudioDevices (line 7220) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetNumAudioDrivers (line 7223) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_LoadWAV_RW (line 7228) | [DllImport(nativeLibName, EntryPoint = "SDL_LoadWAV_RW", CallingConven...
    method SDL_LoadWAV (line 7236) | public static SDL_AudioSpec SDL_LoadWAV(
    method SDL_LockAudio (line 7258) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_LockAudioDevice (line 7262) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MixAudio (line 7265) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_MixAudioFormat (line 7276) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_OpenAudio (line 7287) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_OpenAudio (line 7293) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_OpenAudioDevice (line 7300) | [DllImport(nativeLibName, EntryPoint = "SDL_OpenAudioDevice", CallingC...
    method SDL_OpenAudioDevice (line 7308) | public static unsafe uint SDL_OpenAudioDevice(
    method SDL_PauseAudio (line 7326) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_PauseAudioDevice (line 7330) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UnlockAudio (line 7336) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_UnlockAudioDevice (line 7340) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_QueueAudio (line 7346) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_DequeueAudio (line 7356) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetQueuedAudioSize (line 7366) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_ClearQueuedAudio (line 7372) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_NewAudioStream (line 7379) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AudioStreamPut (line 7392) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AudioStreamGet (line 7402) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AudioStreamAvailable (line 7412) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AudioStreamClear (line 7418) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_FreeAudioStream (line 7424) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_TICKS_PASSED (line 7438) | public static bool SDL_TICKS_PASSED(UInt32 A, UInt32 B)
    method SDL_Delay (line 7444) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetTicks (line 7448) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetPerformanceCounter (line 7452) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetPerformanceFrequency (line 7456) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AddTimer (line 7464) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_RemoveTimer (line 7472) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SetWindowsMessageHook (line 7490) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_iPhoneSetAnimationCallback (line 7501) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_iPhoneSetEventPump (line 7509) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AndroidGetJNIEnv (line 7518) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AndroidGetActivity (line 7522) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsAndroidTV (line 7525) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsChromebook (line 7528) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsDeXMode (line 7531) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_AndroidBackButton (line 7534) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_AndroidGetInternalStoragePath (line 7537) | [DllImport(nativeLibName, EntryPoint = "SDL_AndroidGetInternalStorageP...
    method SDL_AndroidGetInternalStoragePath (line 7540) | public static string SDL_AndroidGetInternalStoragePath()
    method SDL_AndroidGetExternalStorageState (line 7547) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_AndroidGetExternalStoragePath (line 7550) | [DllImport(nativeLibName, EntryPoint = "SDL_AndroidGetExternalStorageP...
    method SDL_AndroidGetExternalStoragePath (line 7553) | public static string SDL_AndroidGetExternalStoragePath()
    method SDL_GetAndroidSDKVersion (line 7560) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_WinRT_DeviceFamily (line 7565) | public enum SDL_WinRT_DeviceFamily
    method SDL_WinRTGetDeviceFamily (line 7573) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_IsTablet (line 7576) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    type SDL_SYSWM_TYPE (line 7583) | public enum SDL_SYSWM_TYPE
    type INTERNAL_windows_wminfo (line 7601) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_winrt_wminfo (line 7609) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_x11_wminfo (line 7615) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_directfb_wminfo (line 7622) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_cocoa_wminfo (line 7630) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_uikit_wminfo (line 7636) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_wayland_wminfo (line 7645) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_mir_wminfo (line 7653) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_android_wminfo (line 7660) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_vivante_wminfo (line 7667) | [StructLayout(LayoutKind.Sequential)]
    type INTERNAL_SysWMDriverUnion (line 7674) | [StructLayout(LayoutKind.Explicit)]
    type SDL_SysWMinfo (line 7700) | [StructLayout(LayoutKind.Sequential)]
    method SDL_GetWindowWMInfo (line 7709) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_SDL_GetBasePath (line 7720) | [DllImport(nativeLibName, EntryPoint = "SDL_GetBasePath", CallingConve...
    method SDL_GetBasePath (line 7722) | public static string SDL_GetBasePath()
    method INTERNAL_SDL_GetPrefPath (line 7728) | [DllImport(nativeLibName, EntryPoint = "SDL_GetPrefPath", CallingConve...
    method SDL_GetPrefPath (line 7733) | public static unsafe string SDL_GetPrefPath(string org, string app)
    type SDL_PowerState (line 7754) | public enum SDL_PowerState
    method SDL_GetPowerInfo (line 7763) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetCPUCount (line 7773) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetCPUCacheLineSize (line 7776) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasRDTSC (line 7779) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasAltiVec (line 7782) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasMMX (line 7785) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_Has3DNow (line 7788) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasSSE (line 7791) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasSSE2 (line 7794) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasSSE3 (line 7797) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasSSE41 (line 7800) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasSSE42 (line 7803) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasAVX (line 7806) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasAVX2 (line 7809) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasAVX512F (line 7812) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasNEON (line 7815) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetSystemRAM (line 7819) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SIMDGetAlignment (line 7823) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SIMDAlloc (line 7827) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_SIMDFree (line 7831) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_HasARMSIMD (line 7835) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

FILE: Engine/SDL2/SDL2_image.cs
  class SDL_image (line 36) | public static class SDL_image
    type IMG_InitFlags (line 55) | [Flags]
    method SDL_IMAGE_VERSION (line 64) | public static void SDL_IMAGE_VERSION(out SDL.SDL_version X)
    method INTERNAL_IMG_Linked_Version (line 71) | [DllImport(nativeLibName, EntryPoint = "IMG_Linked_Version", CallingCo...
    method IMG_Linked_Version (line 73) | public static SDL.SDL_version IMG_Linked_Version()
    method IMG_Init (line 84) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_Quit (line 87) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_IMG_Load (line 91) | [DllImport(nativeLibName, EntryPoint = "IMG_Load", CallingConvention =...
    method IMG_Load (line 95) | public static unsafe IntPtr IMG_Load(string file)
    method IMG_Load_RW (line 107) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_IMG_LoadTyped_RW (line 115) | [DllImport(nativeLibName, EntryPoint = "IMG_LoadTyped_RW", CallingConv...
    method IMG_LoadTyped_RW (line 121) | public static unsafe IntPtr IMG_LoadTyped_RW(
    method INTERNAL_IMG_LoadTexture (line 136) | [DllImport(nativeLibName, EntryPoint = "IMG_LoadTexture", CallingConve...
    method IMG_LoadTexture (line 141) | public static unsafe IntPtr IMG_LoadTexture(
    method IMG_LoadTexture_RW (line 159) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_IMG_LoadTextureTyped_RW (line 171) | [DllImport(nativeLibName, EntryPoint = "IMG_LoadTextureTyped_RW", Call...
    method IMG_LoadTextureTyped_RW (line 178) | public static unsafe IntPtr IMG_LoadTextureTyped_RW(
    method IMG_ReadXPMFromArray (line 196) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_IMG_SavePNG (line 203) | [DllImport(nativeLibName, EntryPoint = "IMG_SavePNG", CallingConventio...
    method IMG_SavePNG (line 208) | public static unsafe int IMG_SavePNG(IntPtr surface, string file)
    method IMG_SavePNG_RW (line 221) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_IMG_SaveJPG (line 229) | [DllImport(nativeLibName, EntryPoint = "IMG_SaveJPG", CallingConventio...
    method IMG_SaveJPG (line 235) | public static unsafe int IMG_SaveJPG(IntPtr surface, string file, int ...
    method IMG_SaveJPG_RW (line 249) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_GetError (line 257) | public static string IMG_GetError()
    method IMG_SetError (line 262) | public static void IMG_SetError(string fmtAndArglist)
    type IMG_Animation (line 271) | public struct IMG_Animation
    method IMG_LoadAnimation (line 280) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_LoadAnimation_RW (line 288) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_LoadAnimationTyped_RW (line 296) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_FreeAnimation (line 305) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method IMG_LoadGIFAnimation_RW (line 310) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

FILE: Engine/SDL2/SDL2_mixer.cs
  class SDL_mixer (line 36) | public static class SDL_mixer
    type MIX_InitFlags (line 67) | [Flags]
    type MIX_Chunk (line 78) | public struct MIX_Chunk
    type Mix_Fading (line 86) | public enum Mix_Fading
    type Mix_MusicType (line 93) | public enum Mix_MusicType
    method SDL_MIXER_VERSION (line 141) | public static void SDL_MIXER_VERSION(out SDL.SDL_version X)
    method INTERNAL_MIX_Linked_Version (line 148) | [DllImport(nativeLibName, EntryPoint = "MIX_Linked_Version", CallingCo...
    method MIX_Linked_Version (line 150) | public static SDL.SDL_version MIX_Linked_Version()
    method Mix_Init (line 161) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Quit (line 164) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_OpenAudio (line 167) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_AllocateChannels (line 175) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_QuerySpec (line 178) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_LoadWAV_RW (line 187) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_LoadWAV (line 195) | public static IntPtr Mix_LoadWAV(string file)
    method INTERNAL_Mix_LoadMUS (line 202) | [DllImport(nativeLibName, EntryPoint = "Mix_LoadMUS", CallingConventio...
    method Mix_LoadMUS (line 206) | public static unsafe IntPtr Mix_LoadMUS(string file)
    method Mix_QuickLoad_WAV (line 217) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_QuickLoad_RAW (line 224) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FreeChunk (line 232) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FreeMusic (line 236) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetNumChunkDecoders (line 239) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_GetChunkDecoder (line 242) | [DllImport(nativeLibName, EntryPoint = "Mix_GetChunkDecoder", CallingC...
    method Mix_GetChunkDecoder (line 244) | public static string Mix_GetChunkDecoder(int index)
    method Mix_GetNumMusicDecoders (line 251) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_GetMusicDecoder (line 254) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicDecoder", CallingC...
    method Mix_GetMusicDecoder (line 256) | public static string Mix_GetMusicDecoder(int index)
    method Mix_GetMusicType (line 264) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_GetMusicTitle (line 270) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicTitle", CallingCon...
    method Mix_GetMusicTitle (line 272) | public static string Mix_GetMusicTitle(IntPtr music)
    method INTERNAL_Mix_GetMusicTitleTag (line 282) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicTitleTag", Calling...
    method Mix_GetMusicTitleTag (line 284) | public static string Mix_GetMusicTitleTag(IntPtr music)
    method INTERNAL_Mix_GetMusicArtistTag (line 294) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicArtistTag", Callin...
    method Mix_GetMusicArtistTag (line 296) | public static string Mix_GetMusicArtistTag(IntPtr music)
    method INTERNAL_Mix_GetMusicAlbumTag (line 306) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicAlbumTag", Calling...
    method Mix_GetMusicAlbumTag (line 308) | public static string Mix_GetMusicAlbumTag(IntPtr music)
    method INTERNAL_Mix_GetMusicCopyrightTag (line 318) | [DllImport(nativeLibName, EntryPoint = "Mix_GetMusicCopyrightTag", Cal...
    method Mix_GetMusicCopyrightTag (line 320) | public static string Mix_GetMusicCopyrightTag(IntPtr music)
    method Mix_SetPostMix (line 327) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_HookMusic (line 333) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_HookMusicFinished (line 339) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetMusicHookData (line 345) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_ChannelFinished (line 348) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_RegisterEffect (line 353) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_UnregisterEffect (line 361) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_UnregisterAllEffects (line 367) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetPanning (line 370) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetPosition (line 377) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetDistance (line 384) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetReverseStereo (line 387) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_ReserveChannels (line 390) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupChannel (line 393) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupChannels (line 396) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupAvailable (line 399) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupCount (line 402) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupOldest (line 405) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GroupNewer (line 408) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_PlayChannel (line 412) | public static int Mix_PlayChannel(
    method Mix_PlayChannelTimed (line 421) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_PlayMusic (line 430) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeInMusic (line 434) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeInMusicPos (line 442) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeInChannel (line 451) | public static int Mix_FadeInChannel(
    method Mix_FadeInChannelTimed (line 461) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Volume (line 470) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_VolumeChunk (line 474) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_VolumeMusic (line 480) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetVolumeMusicStream (line 486) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_HaltChannel (line 489) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_HaltGroup (line 492) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_HaltMusic (line 495) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_ExpireChannel (line 498) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeOutChannel (line 501) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeOutGroup (line 504) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadeOutMusic (line 507) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadingMusic (line 510) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_FadingChannel (line 513) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Pause (line 516) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Resume (line 519) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Paused (line 522) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_PauseMusic (line 525) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_ResumeMusic (line 528) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_RewindMusic (line 531) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_PausedMusic (line 534) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetMusicPosition (line 537) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetMusicPosition (line 543) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_MusicDuration (line 549) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetMusicLoopStartTime (line 555) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetMusicLoopEndTime (line 561) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetMusicLoopLengthTime (line 567) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_Playing (line 570) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_PlayingMusic (line 573) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_SetMusicCMD (line 576) | [DllImport(nativeLibName, EntryPoint = "Mix_SetMusicCMD", CallingConve...
    method Mix_SetMusicCMD (line 580) | public static unsafe int Mix_SetMusicCMD(string command)
    method Mix_SetSynchroValue (line 590) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_GetSynchroValue (line 593) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_SetSoundFonts (line 596) | [DllImport(nativeLibName, EntryPoint = "Mix_SetSoundFonts", CallingCon...
    method Mix_SetSoundFonts (line 600) | public static unsafe int Mix_SetSoundFonts(string paths)
    method INTERNAL_Mix_GetSoundFonts (line 610) | [DllImport(nativeLibName, EntryPoint = "Mix_GetSoundFonts", CallingCon...
    method Mix_GetSoundFonts (line 612) | public static string Mix_GetSoundFonts()
    method Mix_EachSoundFont (line 619) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_SetTimidityCfg (line 626) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_Mix_GetTimidityCfg (line 633) | [DllImport(nativeLibName, EntryPoint = "Mix_GetTimidityCfg", CallingCo...
    method Mix_GetTimidityCfg (line 635) | public static string Mix_GetTimidityCfg()
    method Mix_GetChunk (line 643) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method Mix_CloseAudio (line 646) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

FILE: Engine/SDL2/SDL2_ttf.cs
  class SDL_ttf (line 36) | public static class SDL_ttf
    method SDL_TTF_VERSION (line 70) | public static void SDL_TTF_VERSION(out SDL.SDL_version X)
    method INTERNAL_TTF_LinkedVersion (line 77) | [DllImport(nativeLibName, EntryPoint = "TTF_LinkedVersion", CallingCon...
    method TTF_LinkedVersion (line 79) | public static SDL.SDL_version TTF_LinkedVersion()
    method TTF_ByteSwappedUNICODE (line 90) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_Init (line 93) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_OpenFont (line 97) | [DllImport(nativeLibName, EntryPoint = "TTF_OpenFont", CallingConventi...
    method TTF_OpenFont (line 102) | public static unsafe IntPtr TTF_OpenFont(string file, int ptsize)
    method TTF_OpenFontRW (line 115) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_OpenFontIndex (line 123) | [DllImport(nativeLibName, EntryPoint = "TTF_OpenFontIndex", CallingCon...
    method TTF_OpenFontIndex (line 129) | public static unsafe IntPtr TTF_OpenFontIndex(
    method TTF_OpenFontIndexRW (line 146) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetFontSize (line 157) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontStyle (line 164) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetFontStyle (line 168) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontOutline (line 172) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetFontOutline (line 176) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontHinting (line 180) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetFontHinting (line 184) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontHeight (line 188) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontAscent (line 192) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontDescent (line 196) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontLineSkip (line 200) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontKerning (line 204) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetFontKerning (line 208) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontFaces (line 212) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_FontFaceIsFixedWidth (line 216) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_FontFaceFamilyName (line 220) | [DllImport(nativeLibName, EntryPoint = "TTF_FontFaceFamilyName", Calli...
    method TTF_FontFaceFamilyName (line 224) | public static string TTF_FontFaceFamilyName(IntPtr font)
    method INTERNAL_TTF_FontFaceStyleName (line 232) | [DllImport(nativeLibName, EntryPoint = "TTF_FontFaceStyleName", Callin...
    method TTF_FontFaceStyleName (line 236) | public static string TTF_FontFaceStyleName(IntPtr font)
    method TTF_GlyphIsProvided (line 244) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GlyphIsProvided32 (line 250) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GlyphMetrics (line 254) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GlyphMetrics32 (line 268) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SizeText (line 280) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_SizeUTF8 (line 290) | [DllImport(nativeLibName, EntryPoint = "TTF_SizeUTF8", CallingConventi...
    method TTF_SizeUTF8 (line 297) | public static unsafe int TTF_SizeUTF8(
    method TTF_SizeUNICODE (line 315) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_MeasureText (line 327) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_MeasureUTF8 (line 340) | [DllImport(nativeLibName, EntryPoint = "TTF_MeasureUTF8", CallingConve...
    method TTF_MeasureUTF8 (line 348) | public static unsafe int TTF_MeasureUTF8(
    method TTF_MeasureUNICODE (line 370) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Solid (line 381) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Solid (line 390) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Solid", Calling...
    method TTF_RenderUTF8_Solid (line 396) | public static unsafe IntPtr TTF_RenderUTF8_Solid(
    method TTF_RenderUNICODE_Solid (line 412) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Solid_Wrapped (line 423) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Solid_Wrapped (line 435) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Solid_Wrapped",...
    method TTF_RenderUTF8_Solid_Wrapped (line 442) | public static unsafe IntPtr TTF_RenderUTF8_Solid_Wrapped(
    method TTF_RenderUNICODE_Solid_Wrapped (line 462) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph_Solid (line 472) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph32_Solid (line 482) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Shaded (line 490) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Shaded (line 500) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Shaded", Callin...
    method TTF_RenderUTF8_Shaded (line 507) | public static unsafe IntPtr TTF_RenderUTF8_Shaded(
    method TTF_RenderUNICODE_Shaded (line 525) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Shaded_Wrapped (line 535) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Shaded_Wrapped (line 548) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Shaded_Wrapped"...
    method TTF_RenderUTF8_Shaded_Wrapped (line 556) | public static unsafe IntPtr TTF_RenderUTF8_Shaded_Wrapped(
    method TTF_RenderUNICODE_Shaded_Wrapped (line 576) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph_Shaded (line 587) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph32_Shaded (line 598) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Blended (line 607) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Blended (line 616) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended", Calli...
    method TTF_RenderUTF8_Blended (line 622) | public static unsafe IntPtr TTF_RenderUTF8_Blended(
    method TTF_RenderUNICODE_Blended (line 638) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderText_Blended_Wrapped (line 647) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method INTERNAL_TTF_RenderUTF8_Blended_Wrapped (line 657) | [DllImport(nativeLibName, EntryPoint = "TTF_RenderUTF8_Blended_Wrapped...
    method TTF_RenderUTF8_Blended_Wrapped (line 664) | public static unsafe IntPtr TTF_RenderUTF8_Blended_Wrapped(
    method TTF_RenderUNICODE_Blended_Wrapped (line 682) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph_Blended (line 692) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_RenderGlyph32_Blended (line 702) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetDirection (line 710) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_SetScript (line 714) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_CloseFont (line 718) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_Quit (line 721) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_WasInit (line 724) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method SDL_GetFontKerningSize (line 728) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontKerningSizeGlyphs (line 738) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
    method TTF_GetFontKerningSizeGlyphs32 (line 748) | [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]

FILE: Engine/Utility/Bounds2.cs
  type Bounds2 (line 4) | struct Bounds2
    method Bounds2 (line 17) | public Bounds2(Vector2 position, Vector2 size)
    method Bounds2 (line 30) | public Bounds2(float x, float y, float width, float height)
    method ToString (line 36) | public override string ToString()
    method Contains (line 45) | public bool Contains(Vector2 point)
    method Overlaps (line 54) | public bool Overlaps(Bounds2 bounds)

FILE: Engine/Utility/Color.cs
  type Color (line 4) | struct Color
    method Color (line 17) | public Color(byte r, byte g, byte b)
    method Color (line 32) | public Color(byte r, byte g, byte b, byte a)
    method ToString (line 40) | public override string ToString()
    method WithAlpha (line 49) | public Color WithAlpha(float a)

FILE: Engine/Utility/Vector2.cs
  type Vector2 (line 4) | struct Vector2
    method Vector2 (line 15) | public Vector2(float x, float y)
    method ToString (line 21) | public override string ToString()
    method Length (line 29) | public float Length()
    method Rotated (line 38) | public Vector2 Rotated(float degrees)
    method Normalized (line 51) | public Vector2 Normalized()
    method Dot (line 69) | public static float Dot(Vector2 a, Vector2 b)
    method Cross (line 79) | public static float Cross(Vector2 a, Vector2 b)

FILE: Game/Game.cs
  class Game (line 4) | class Game
    method Game (line 22) | public Game()
    method Update (line 26) | public void Update()
Condensed preview — 19 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (427K chars).
[
  {
    "path": ".gitignore",
    "chars": 13,
    "preview": ".vs/\nBuilds/\n"
  },
  {
    "path": "Assets/INSTRUCTIONS.txt",
    "chars": 123,
    "preview": "Place your assets (textures, sounds, and fonts) in this directory and they will be automatically copied when making buil"
  },
  {
    "path": "Engine/Audio.cs",
    "chars": 3054,
    "preview": "using SDL2;\nusing System;\nusing System.Collections.Generic;\n\nstatic partial class Engine\n{\n    private static readonly "
  },
  {
    "path": "Engine/Content.cs",
    "chars": 6303,
    "preview": "using SDL2;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nstatic partial class Engine\n{\n    private"
  },
  {
    "path": "Engine/Engine.cs",
    "chars": 5150,
    "preview": "using SDL2;\nusing System;\nusing System.Collections.Generic;\n\nstatic partial class Engine\n{\n    private static IntPtr Wi"
  },
  {
    "path": "Engine/Graphics.cs",
    "chars": 16029,
    "preview": "using SDL2;\nusing System;\nusing System.Collections.Generic;\n\nstatic partial class Engine\n{\n    private static IntPtr Re"
  },
  {
    "path": "Engine/Input.cs",
    "chars": 21003,
    "preview": "using SDL2;\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\ns"
  },
  {
    "path": "Engine/SDL2/SDL2.cs",
    "chars": 252742,
    "preview": "#region License\n/* SDL2# - C# Wrapper for SDL2\n *\n * Copyright (c) 2013-2020 Ethan Lee.\n *\n * This software is provided "
  },
  {
    "path": "Engine/SDL2/SDL2_image.cs",
    "chars": 9240,
    "preview": "#region License\n/* SDL2# - C# Wrapper for SDL2\n *\n * Copyright (c) 2013-2020 Ethan Lee.\n *\n * This software is provided "
  },
  {
    "path": "Engine/SDL2/SDL2_mixer.cs",
    "chars": 21163,
    "preview": "#region License\n/* SDL2# - C# Wrapper for SDL2\n *\n * Copyright (c) 2013-2020 Ethan Lee.\n *\n * This software is provided "
  },
  {
    "path": "Engine/SDL2/SDL2_ttf.cs",
    "chars": 22658,
    "preview": "#region License\n/* SDL2# - C# Wrapper for SDL2\n *\n * Copyright (c) 2013-2020 Ethan Lee.\n *\n * This software is provided "
  },
  {
    "path": "Engine/Utility/Bounds2.cs",
    "chars": 1776,
    "preview": "using System;\nusing System.Collections.Generic;\n\nstruct Bounds2\n{\n    public Vector2 Position;\n    public Vector2 Size;"
  },
  {
    "path": "Engine/Utility/Color.cs",
    "chars": 11915,
    "preview": "using System;\nusing System.Collections.Generic;\n\nstruct Color\n{\n    public byte R;\n    public byte G;\n    public byte B"
  },
  {
    "path": "Engine/Utility/Vector2.cs",
    "chars": 3162,
    "preview": "using System;\nusing System.Collections.Generic;\n\nstruct Vector2\n{\n    public float X, Y;\n\n    public static readonly Ve"
  },
  {
    "path": "Game/Game.cs",
    "chars": 2135,
    "preview": "using System;\r\nusing System.Collections.Generic;\r\n\r\nclass Game\r\n{\r\n    public static readonly string Title = \"Minimalis"
  },
  {
    "path": "Game.csproj",
    "chars": 3783,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "Game.sln",
    "chars": 1038,
    "preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.2990"
  },
  {
    "path": "LICENSE.md",
    "chars": 1071,
    "preview": "Copyright (c) 2020 Zach Barth and Keith Holman\n\nPermission is hereby granted, free of charge, to any person obtaining a "
  },
  {
    "path": "README.md",
    "chars": 9467,
    "preview": "# Minimalist Game Framework #\n\nThis is a minimalist game framework in the style of the \"game engine\" we use at [Zachtron"
  }
]

About this extraction

This page contains the full source code of the zachbarth/minimalist-game-framework GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 19 files (382.6 KB), approximately 106.6k tokens, and a symbol index with 1122 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!