using SdlDotNet.Core; using SdlDotNet.Graphics; class Program { static void Main() { Video.SetVideoMode(640, 480); Video.WindowCaption = "My Game"; Video.WindowIcon(); Video.Screen.Fill(new Color(0, 0, 255)); Events.TargetFps = 60; Events.Run(); } }
using SdlDotNet.Audio; class Program { static void Main(string[] args) { Mix.OpenAudio(); var sound = new Sound("explosion_sound.wav"); Events.KeyboardDown += (sender, eventArgs) => { if (eventArgs.Key == Keyboard.Key.Space) { sound.Play(); } }; Events.Run(); Mix.CloseAudio(); } }Package library: SdlDotNet is available as a package on NuGet, a package manager used for installing and managing software libraries in the .NET ecosystem. NuGet provides a convenient way to add SdlDotNet to a C# project, along with its dependencies like SDL and SDL_mixer.