MadbyesGameLibrary 0.5.7

dotnet add package MadbyesGameLibrary --version 0.5.7
                    
NuGet\Install-Package MadbyesGameLibrary -Version 0.5.7
                    
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="MadbyesGameLibrary" Version="0.5.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MadbyesGameLibrary" Version="0.5.7" />
                    
Directory.Packages.props
<PackageReference Include="MadbyesGameLibrary" />
                    
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 MadbyesGameLibrary --version 0.5.7
                    
#r "nuget: MadbyesGameLibrary, 0.5.7"
                    
#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 MadbyesGameLibrary@0.5.7
                    
#: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=MadbyesGameLibrary&version=0.5.7
                    
Install as a Cake Addin
#tool nuget:?package=MadbyesGameLibrary&version=0.5.7
                    
Install as a Cake Tool

MGL – Madbye's Game Library

MGL is a lightweight C# game development library built on top of OpenGL and Silk.NET. It provides a simple abstraction for 3D and 2D rendering, shader management, asset loading, input, and basic text rendering.


✨ Features

  • Modern OpenGL – leverages shader-based rendering (GLSL) for flexible graphics pipelines.
  • Built-in shaders – includes PBR, Phong, Unlit, and Blit shaders out of the box.
  • Model & texture loading – supports common formats through Assimp and StbImage.
  • Text rendering – font support with a built-in renderer.
  • Lighting system – directional, point, and spot lights.
  • Camera helpers – orthographic and perspective cameras.
  • Post‑processing effects – basic pipeline for screen-space effects.
  • Input - mouse and keyboard input processing.

🕹️ Example

using System.Numerics;
using System.Drawing;
using MGL;
using MGL.Graphics;
using MGL.Utils;

// 1. Initialize Window & Renderer
var window = new Window(1280u, 720u, "MGL Demo");
window.Initialize();

var renderer = window.CreateRenderer();
renderer.Enable(EnableCap.DepthTest);

// 2. Setup Camera
var camera = new PerspectiveCamera(
    position: new Vector3(3f, 3f, 3f),
    Quaternion.Identity,
    width: 1280,
    height: 720,
    fov: 60f,
    0.1f,
    100f
);
camera.LookAt(Vector3.Zero);

// 3. Load Resources (Mesh, Texture, Shader)
var shader = renderer.DefaultShaders.GetUnlit();
shader.Bind();
shader.SetUniform("model", Matrix4x4.Identity);

var vao = VertexArray.FromCommonMesh(renderer, MeshGenerator.GenCube());

var texture = Texture2D.FromImage(
    renderer, 
    CheckerboardGenerator.GenCheckerboard(Color.Magenta, Color.Black, 4), 
    TextureFilter.Nearest, 
    false
);
texture.Bind();

// 4. Handle Window Resize
window.OnResize += (newWidth, newHeight) =>
{
    renderer.Viewport(newWidth, newHeight);
    
    camera.Width = newWidth;
    camera.Height = newHeight;
    camera.SetVPMatricesToProgram(shader);
};

// 5. Main Render Loop
while (!window.ShouldClose())
{
    window.DoEvents();

    // Clear screen buffers
    renderer.ClearColor(Color.CornflowerBlue);
    renderer.ClearDepth();
    
    // Draw geometry
    vao.Draw();
    
    window.SwapBuffers();
}

// 6. Cleanup Resources
vao.Dispose();
texture.Dispose();
shader.Dispose();
renderer.Dispose();
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  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.5.7 70 11/7/2026
0.5.6 83 11/7/2026
0.5.5 86 11/4/2026
0.5.4 89 11/3/2026
0.5.3 92 11/2/2026
0.5.2 86 10/26/2026
0.5.1 85 10/26/2026
0.5.0 92 10/19/2026
0.4.2 96 10/17/2026
0.4.1 93 10/17/2026
0.4.0 92 10/17/2026
0.3.0 93 10/2/2026
0.2.0 116 8/25/2026
0.1.0 98 8/21/2026