https://github.com/edwardgushchin/sdl3-cs
This is SDL3#, a C# wrapper for SDL3.
https://github.com/edwardgushchin/sdl3-cs
csharp dotnet gamedev open-source sdl sdl3 wrapper
Last synced: 23 days ago
JSON representation
This is SDL3#, a C# wrapper for SDL3.
- Host: GitHub
- URL: https://github.com/edwardgushchin/sdl3-cs
- Owner: edwardgushchin
- License: zlib
- Created: 2024-07-06T08:19:38.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-04-08T21:46:47.000Z (25 days ago)
- Last Synced: 2025-04-10T02:19:13.448Z (23 days ago)
- Topics: csharp, dotnet, gamedev, open-source, sdl, sdl3, wrapper
- Language: C#
- Homepage:
- Size: 53.4 MB
- Stars: 40
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README-nuget.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## 🚀 About
This is SDL3#, a C# wrapper for SDL3.
## 📚 Documentation
For more information about SDL3, visit the [SDL wiki](https://wiki.libsdl.org/SDL3/FrontPage).
## 📝 Installation
```
git clone https://github.com/edwardgushchin/SDL3-CS
cd SDL3-CS
dotnet build -c Release
```or
```
dotnet add package SDL3-CS
```Optional:
```
dotnet add package SDL3-CS.Native
dotnet add package SDL3-CS.Native.Image
dotnet add package SDL3-CS.Native.TTF
dotnet add package SDL3-CS.Native.Mixer
```## 🎓 Examples
```C#
using SDL3;namespace Create_Window;
internal static class Program
{
[STAThread]
private static void Main()
{
if (!SDL.Init(SDL.InitFlags.Video))
{
SDL.LogError(SDL.LogCategory.System, $"SDL could not initialize: {SDL.GetError()}");
return;
}if (!SDL.CreateWindowAndRenderer("SDL3 Create Window", 800, 600, 0, out var window, out var renderer))
{
SDL.LogError(SDL.LogCategory.Application, $"Error creating window and rendering: {SDL.GetError()}");
return;
}SDL.SetRenderDrawColor(renderer, 100, 149, 237, 0);
var loop = true;
while (loop)
{while (SDL.PollEvent(out var e))
{
if ((SDL.EventType)e.Type == SDL.EventType.Quit)
{
loop = false;
}
}SDL.RenderClear(renderer);
SDL.RenderPresent(renderer);
}SDL.DestroyRenderer(renderer);
SDL.DestroyWindow(window);SDL.Quit();
}
}
```More examples can be found [here](https://github.com/edwardgushchin/SDL3-CS/tree/master/SDL3-CS.Examples).
## ✅ Readiness
| **Library** | **Stage** |
|----------------------------------------|-------------------------------------------------------|
| [SDL3](SDL3-CS/SDL) |  |
| [SDL_image](SDL3-CS/Image) |  |
| [SDL_mixer](SDL3-CS/Mixer) |  |
| [SDL_tff](SDL3-CS/TTF) |  |## 🤝 Feedback and Contributions
Do you have an idea or found a bug? Please open an [issue](https://github.com/edwardgushchin/SDL3-CS/issues) or start a [discussion](https://github.com/edwardgushchin/SDL3-CS/discussions).
Please note we have a code of conduct, please follow it in all your interactions with the project.
If you have any feedback, please reach out to us at [[email protected]](mailto://[email protected]).
We also have a [chat](https://t.me/sdl3cs) in Telegram, where I am ready to answer any of your questions.
## 💻 Authors
- Eduard Gushchin - Initial work - [edwardgushchin](https://github.com/edwardgushchin)
See also the list of [contributors](https://github.com/edwardgushchin/SDL3-CS/graphs/contributors) who participated in this project.
## 📃 License
SDL3 and SDL3# are released under the zlib license. See [LICENSE](LICENSE) for details.