About β’ Documentation β’ Installation β’ Examples β’ Readiness
Mobile platform support β’ Feedback and Contributions β’ Authors β’ License
β Star us on GitHub β it motivates us a lot!
SDL3 is still under active development, and the shell is currently under development as of this commit. For convenience, you can use this branch.
Once all the features are ready, I plan to bring the wrapper up to date with the original SDL and keep it up to date.
For more information about SDL3, visit the SDL wiki.
git clone https://github.com/edwardgushchin/SDL3-CS
cd SDL3-CS
dotnet build -c Release
using SDL3;
namespace SDL3Test;
public static class Program
{
private static void Main()
{
if (SDL.Init(SDL.InitFlags.Video) < 0)
{
Console.WriteLine($"SDL could not initialize! SDL Error: {SDL.GetError()}");
return;
}
var window = SDL.CreateWindow("SDL3 Create Window", 800, 600, 0);
if (window == null)
{
Console.WriteLine($"Window could not be created! SDL Error: {SDL.GetError()}");
return;
}
var renderer = SDL.CreateRenderer(window, null);
if (renderer == null)
{
Console.WriteLine($"Renderer could not be created! SDL Error: {SDL.GetError()}");
return;
}
SDL.SetRenderDrawColor(renderer, 100, 149, 237, 0);
var loop = true;
while (loop)
{
while (SDL.PollEvent(out var sdlEvent))
{
if (sdlEvent.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.
View information and functions related to... | View the header | Stage |
---|---|---|
Application entry points | SDL_main.h | |
Initialization and Shutdown | SDL_init.h | |
Configuration Variables | SDL_hints.h | |
Object Properties | SDL_properties.h | |
Error Handling | SDL_error.h | |
Log Handling | SDL_log.h | |
Assertions | SDL_assert.h | |
Querying SDL Version | SDL_version.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Display and Window Management | SDL_video.h | |
2D Accelerated Rendering | SDL_render.h | |
Pixel Formats and Conversion Routines | SDL_pixels.h | |
Blend modes | SDL_blendmode.h | |
Rectangle Functions | SDL_rect.h | |
Surface Creation and Simple Drawing | SDL_surface.h | |
Clipboard Handling | SDL_clipboard.h | |
Vulkan Support | SDL_vulkan.h | |
Metal Support | SDL_metal.h | |
Camera Support | SDL_camera.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Event Handling | SDL_events.h | |
Keyboard Support | SDL_keyboard.h | |
Keyboard Keycodes | SDL_keycode.h | |
Keyboard Scancodes | SDL_scancode.h | |
Mouse Support | SDL_mouse.h | |
Joystick Support | SDL_joystick.h | |
Gamepad Support | SDL_gamepad.h | |
Touch Support | SDL_touch.h | |
Pen Support | SDL_pen.h | |
Sensors | SDL_sensor.h | |
HIDAPI | SDL_hidapi.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Force Feedback Support | SDL_haptic.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Audio Playback, Recording, and Mixing | SDL_audio.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Thread Management | SDL_thread.h | |
Thread Synchronization Primitives | SDL_mutex.h | |
Atomic Operations | SDL_atomic.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Timer Support | SDL_timer.h | |
Date and Time | SDL_time.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Filesystem Access | SDL_filesystem.h | |
Storage Abstraction | SDL_storage.h | |
I/O Streams | SDL_iostream.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Platform Detection | SDL_platform.h | |
CPU Feature Detection | SDL_cpuinfo.h | |
Byte Order and Byte Swapping | SDL_endian.h | |
Bit Manipulation | SDL_bits.h |
View information and functions related to... | View the header | Stage |
---|---|---|
Shared Object/DLL Management | SDL_loadso.h | |
Power Management Status | SDL_power.h | |
Message Boxes | SDL_messagebox.h | |
File Dialogs | SDL_dialog.h | |
Locale Info | SDL_locale.h | |
Platform-specific Functionality | SDL_system.h | |
Standard Library Functionality | SDL_stdinc.h | |
GUIDs | SDL_guid.h | |
Miscellaneous | SDL_misc.h |
In theory, there is no reason why this shell cannot run on Android and iOS, but I have never worked with these platforms and cannot guarantee 100% work. If you can add support for mobile platforms, I look forward to your Pull requests!
Do you have an idea or found a bug? Please open an issue or start a discussion.
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 eduardgushchin@yandex.ru or https://t.me/eduardgushchin
- Eduard Gushchin - Initial work - edwardgushchin
See also the list of contributors who participated in this project.
SDL3 and SDL3# are released under the zlib license. See LICENSE for details.