VOOZH about

URL: https://www.nuget.org/packages/Irodori.Windowing.Sdl2/

⇱ NuGet Gallery | Irodori.Windowing.Sdl2 0.0.8




👁 Image
Irodori.Windowing.Sdl2 0.0.8

dotnet add package Irodori.Windowing.Sdl2 --version 0.0.8
 
 
NuGet\Install-Package Irodori.Windowing.Sdl2 -Version 0.0.8
 
 
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="Irodori.Windowing.Sdl2" Version="0.0.8" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Irodori.Windowing.Sdl2" Version="0.0.8" />
 
Directory.Packages.props
<PackageReference Include="Irodori.Windowing.Sdl2" />
 
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 Irodori.Windowing.Sdl2 --version 0.0.8
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Irodori.Windowing.Sdl2, 0.0.8"
 
 
#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 Irodori.Windowing.Sdl2@0.0.8
 
 
#: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=Irodori.Windowing.Sdl2&version=0.0.8
 
Install as a Cake Addin
#tool nuget:?package=Irodori.Windowing.Sdl2&version=0.0.8
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

👁 banner

irodori

means "to color" in Japanese

a rendering library written in C#

install

dotnet package add Irodori
dotnet package add Irodori.Backend.OpenGL
dotnet package add Irodori.Windowing.Sdl2

features

  • easy to use & simple
    • just a few lines to create a window and render something
  • null safety
    • no null reference exceptions!
  • type strict
    • minimum implicit conversions, most things are explicit.
  • zero throws
    • no exceptions thrown during runtime by the library. don't worry about unexpected crashes.
    • use IrodoriReturn to handle errors explicitly.
  • NativeAOT ready
    • zero reflection, works with NativeAOT

minimal example

window

using Irodori;
// ...

var gfx = Gfx<OpenGlBackend, SdlWindow>.Create()
 .WithBackend(new OpenGlBackend())
 .WithWindowing(new Sdl2Windowing())
 .WithWindowConfig(new Window.InitConfig
 {
 Title = "SampleDraw",
 Width = 1280,
 Height = 720,
 Resizable = false
 })
 .Init()
 .Unwrap();

while (!gfx.Window.ShouldClose)
{
 gfx.Window.PollEvents();
 gfx.Clear(Color.CornflowerBlue);
 gfx.Window.SwapBuffers();
}

triangle

string vshCode = @"
#version 330 core
layout(location = 0) in vec3 aPos;
layout(location = 1) in vec3 aColor;

out vec3 ourColor;

void main()
{
 gl_Position = vec4(aPos, 1.0);
 ourColor = aColor;
}
";

string fshCode = @"
#version 330 core
out vec4 FragColor;
in vec3 ourColor;

uniform float factor;

void main()
{
 FragColor = vec4(ourColor, 1.0) * factor;
}
";
 
var gfx = Gfx<OpenGlBackend, SdlWindow>.Create()
 .WithBackend(new OpenGlBackend())
 .WithWindowing(new Sdl2Windowing())
 .WithWindowConfig(new Window.InitConfig
 {
 Title = "SampleDraw",
 Width = 1280,
 Height = 720,
 Resizable = false
 })
 .Init()
 .Unwrap();

var vsh = gfx.CreateShader(EShaderType.Vertex, vshCode)
 .Compile()
 .Unwrap();
var fsh = gfx.CreateShader(EShaderType.Fragment, fshCode)
 .Compile()
 .Unwrap();
var prog = gfx.CreateShaderProgram()
 .AttachShader(vsh)
 .AttachShader(fsh)
 .Link()
 .Unwrap();

vsh.Dispose();
fsh.Dispose();

var vertexData = VertexData.Create<Vector3, Vector3>()
 .AddVertex(new Vector3(-0.5f, -0.5f, 0.0f), new Vector3(0.0f, 0.0f, 1.0f))
 .AddVertex(new Vector3(0.5f, -0.5f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f))
 .AddVertex(new Vector3(0.0f, 0.5f, 0.0f), new Vector3(1.0f, 0.0f, 0.0f));

var vertexBuffer = gfx.CreateVertexBuffer(VertexBufferFormat.Create()
 .AddAttrib(VertexBufferFormat.Attrib.Vector3())
 .AddAttrib(VertexBufferFormat.Attrib.Vector3()))
 .Upload(vertexData)
 .Unwrap();

float t = 0;

while (!gfx.Window.ShouldClose)
{
 gfx.Window.PollEvents();
 gfx.Clear(Color.CornflowerBlue);

 prog.SetFloat("factor", (MathF.Sin(t) + 1) / 2.0f); // Flicker effect
 vertexBuffer.Draw(prog);

 t += 0.1f;
 gfx.Window.SwapBuffers();
}

supported backends

  • opengl
  • vulkan
  • direct3d 11
  • direct3d 12
  • metal
  • webgl
  • webgpu
Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.8 238 9/28/2025
0.0.7 190 9/28/2025
0.0.6 150 9/27/2025
0.0.5 150 9/27/2025
0.0.4 153 9/27/2025
0.0.3 233 9/3/2025
0.0.2 239 8/31/2025
0.0.1 242 8/30/2025