SDL2Package 1.0.0

dotnet add package SDL2Package --version 1.0.0
                    
NuGet\Install-Package SDL2Package -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SDL2Package" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SDL2Package" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="SDL2Package" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SDL2Package --version 1.0.0
                    
#r "nuget: SDL2Package, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SDL2Package&version=1.0.0
                    
Install SDL2Package as a Cake Addin
#tool nuget:?package=SDL2Package&version=1.0.0
                    
Install SDL2Package as a Cake Tool

SDL2Package

SDL2Package is a native C++ NuGet package that bundles SDL2 and its main extensions (SDL2_image, SDL2_mixer, and SDL2_ttf). By installing this package, you get all the necessary headers, libraries, and DLLs automatically added to your project.

Features

  • Single-step integration of SDL2, SDL2_image, SDL2_mixer, and SDL2_ttf
  • Automatic library linking via .targets (no manual setup required)
  • Post-build copy of DLLs to your output folder, so you can run your application without missing DLL errors
  • Works for both x86 and x64 configurations on Windows

Installation

Using Visual Studio:

Open your C++ project and go to Project → Manage NuGet Packages… Select your feed source (e.g., nuget.org or a local feed), search for SDL2Package, and click Install

Using nuget.exe or dotnet CLI:

nuget install SDL2Package

or

dotnet add package SDL2Package

Usage

Include the headers:

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>

Initialize and use SDL:

#include <SDL2/SDL.h>
#include <iostream>

int main(int argc, char\* argv[])
{
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
std::cerr << "SDL_Init failed: " << SDL_GetError() << std::endl;
return 1;
}
std::cout << "SDL is initialized successfully!\n";

    // Your SDL code here...

    SDL_Quit();
    return 0;

}
Product Compatible and additional computed target framework versions.
native native is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • native 0.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 119 4/4/2025

This release includes new features for SDL2KitNuget.