Spectere.SdlKit 0.2.4-alpha

This is a prerelease version of Spectere.SdlKit.
dotnet add package Spectere.SdlKit --version 0.2.4-alpha
                    
NuGet\Install-Package Spectere.SdlKit -Version 0.2.4-alpha
                    
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="Spectere.SdlKit" Version="0.2.4-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Spectere.SdlKit" Version="0.2.4-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Spectere.SdlKit" />
                    
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 Spectere.SdlKit --version 0.2.4-alpha
                    
#r "nuget: Spectere.SdlKit, 0.2.4-alpha"
                    
#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.
#:package Spectere.SdlKit@0.2.4-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Spectere.SdlKit&version=0.2.4-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Spectere.SdlKit&version=0.2.4-alpha&prerelease
                    
Install as a Cake Tool

SDLKit

A kinda high-ish level bridge between SDL2 and .NET.

But why, though?

I like SDL and I like C#, but whenever I do a project where I mash the two of them together it feels like I always end up having to spend a bunch of time writing interop definitions and setting up SDL. Rather than maintaining a template or anything like that, I figured I'd write a library that I could easily pull down from NuGet whenever I need to plot any fancy pixels or play beeps and/or boops.

What does this provide?

Window

  • Plops a window on your desktop. Nothing special here!

Video

  • Pixel plotting
  • Image loading (via SDL_image)
  • Support for an arbitrary number of render targets

Timer

  • Callback-based

Audio

  • Callback-based
  • Audio in SDLKit currently accepts floats and will convert it to whatever data type the OS demands
  • Both big- and little-endian systems should be supported, if you happen to be a PPC user running modern .NET stuff 😃

Events

  • Window/WM
  • Keyboard
  • Mouse
  • Gamepad

"Renderables"

Higher level surfaces that might come in handy.

  • TextConsole: a console that allows you to load a file and easily Write text to (or plot characters onto it)
  • TileGrid: a multi-layer graphical surface that lets you scatter tiles from a tile sheet around

How do I do the thing?

Documentation is fairly sparse at the moment, as I'm sure there's still a lot of tweaking I'll have to do to make this useful for my purposes, let alone a general audience. The demo project is going to be your best source of documentation for the time being.

I've also taken a lot of time to write XMLDocs across the board, so simply poking around with your IDE should give you quite a bit of information to work with.

I have an idea!

Feel free to open an issue and we can discuss it.

You did XYZ wrong!

Maybe! Feel free to open an issue to let me know, or show me how it's done by opening a pull request.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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
0.2.4-alpha 82 5/7/2024