![]() |
VOOZH | about |
dotnet add package Irodori.Windowing.Sdl2 --version 0.0.8
NuGet\Install-Package Irodori.Windowing.Sdl2 -Version 0.0.8
<PackageReference Include="Irodori.Windowing.Sdl2" Version="0.0.8" />
<PackageVersion Include="Irodori.Windowing.Sdl2" Version="0.0.8" />Directory.Packages.props
<PackageReference Include="Irodori.Windowing.Sdl2" />Project file
paket add Irodori.Windowing.Sdl2 --version 0.0.8
#r "nuget: Irodori.Windowing.Sdl2, 0.0.8"
#:package Irodori.Windowing.Sdl2@0.0.8
#addin nuget:?package=Irodori.Windowing.Sdl2&version=0.0.8Install as a Cake Addin
#tool nuget:?package=Irodori.Windowing.Sdl2&version=0.0.8Install as a Cake Tool
means "to color" in Japanese
a rendering library written in C#
dotnet package add Irodori
dotnet package add Irodori.Backend.OpenGL
dotnet package add Irodori.Windowing.Sdl2
IrodoriReturn to handle errors explicitly.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();
}
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();
}
| 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. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.