Mibo.Raylib 4.0.0-beta-001

This is a prerelease version of Mibo.Raylib.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Mibo.Raylib --version 4.0.0-beta-001
                    
NuGet\Install-Package Mibo.Raylib -Version 4.0.0-beta-001
                    
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="Mibo.Raylib" Version="4.0.0-beta-001" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mibo.Raylib" Version="4.0.0-beta-001" />
                    
Directory.Packages.props
<PackageReference Include="Mibo.Raylib" />
                    
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 Mibo.Raylib --version 4.0.0-beta-001
                    
#r "nuget: Mibo.Raylib, 4.0.0-beta-001"
                    
#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 Mibo.Raylib@4.0.0-beta-001
                    
#: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=Mibo.Raylib&version=4.0.0-beta-001&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Mibo.Raylib&version=4.0.0-beta-001&prerelease
                    
Install as a Cake Tool

Mibo

Install the templates:

dotnet new install Mibo.Templates
dotnet new mibo-2d -o MyGame
cd MyGame
dotnet run

NOTE for ADVENTURERS: raylib is a programming library to enjoy videogames programming; no fancy interface, no visual helpers, no debug button... just coding in the most pure spartan-programmers way.

Following that spirit, Mibo keeps it lean, just F# and the Elmish loop with a handful of commodities to get out of your way and let you enjoy the craft.

Mibo is an Elmish-based F# game framework with two interchangeable backends — raylib-cs and MonoGame (DesktopGL/OpenGL and WindowsDX/DirectX) — designed to allow developers to write games using familiar MVU patterns for all kinds of game genres and sizes.

Mibo aims to solve 80/20 of use cases for enabling developers to focus on game logic rather than boilerplate code, providing guidelines and architecture for structuring game code, handling input, rendering, asset management, and time management among others.

What's in the box?

  • Elmish runtime (MVU loop) with Cmd, Sub, optional fixed timestep, and frame-bounded dispatch
  • Input — raw input (Keyboard, Mouse) + semantic mapping via InputMap / ActionState
  • Assets — texture, font, sound, and model loading caches
  • Rendering — Command buffer based rendering:
    • 2D batch renderer with layers and multi-camera support
    • 3D batch renderer with opaque/transparent passes and custom shader switching
    • Escape hatches for custom GPU work
  • Camera helpers with screen-to-world, orbit, and ray casting
  • Layout — 2D procedural grid layout (CellGrid2D) with platformer, top-down, and geometric primitives
  • Layout3D — 3D voxel-style grid layout (CellGrid3D) with terrain, interior rooms, corridors, stairs, and procedural generation
  • Animation — sprite sheet slicing, AnimatedSprite state machines, and grid-based animation definitions
  • Input Mapper — Listen to raw input and map it to semantic actions

Getting started

Prerequisites:

  • .NET SDK 8 or later
  • A working OpenGL setup
dotnet --version
dotnet tool restore
dotnet restore
dotnet build
dotnet test

To build the docs site locally:

dotnet tool restore
dotnet fsdocs build
# or for live editing:
dotnet fsdocs watch

Samples

The samples are stored in a separate repository: Mibo.Samples.

You'll find examples of:

2D:

  • PlatformerSample - A 2D side-scrolling platformer with procedural world generation, sprite animation, lighting, particles, and sound. Uses Mibo's Elmish architecture with InputMap, AnimatedSprite, CellGrid2D, and LightContext2D.
    • Mibo.Raylib targeting Desktop OpenGL
    • Mibo.MonoGame targeting DesktopGL (cross-platform)
  • SpaceBattle - A turn-based tactical strategy game on a hex grid with fog of war, laser combat, particle effects, faction-based turns (Human + AI), and animated unit movement. Demonstrates complex game state management, hex grid spatial queries, and multi-phase turn resolution.
    • Mibo.Raylib targeting Desktop OpenGL
  • PingPong - A networked multiplayer Pong game with a client-server architecture over WebSockets. The server runs game logic and broadcasts state; the client renders locally and sends input.
    • Mibo.Raylib Client
    • Mibo.MonoGame Client
    • dotnet app acting as a server running Mibo.Core's headless support

3D:

  • ThreeDSample - A 3D platformer with procedurally generated voxel terrain, PBR lighting, shadow atlas, 3D character animation, minimap overlay, and physics. Showcases Mibo's Renderer3D, ForwardPbrPipeline, and Animation3DState.

    • Mibo.Raylib targeting Desktop OpenGL
    • Mibo.MonoGame targeting DesktopGL (cross-platform)
  • FPSSample - A first-person shooter featuring enemy AI, weapon systems, health management, and atmospheric lighting. Demonstrates Mibo's composable systems architecture with per-system sub-models, event-driven cross-system communication, and a System pipeline with snapshot barriers.

    • Mibo.Raylib targeting Desktop OpenGL
    • Mibo.MonoGame targeting DesktopGL (cross-platform)
    • Mibo.MonoGame targeting WindowsDX (Windows only, DirectX)

License

Mibo is distributed under the zlib/libpng License.

Built on

Mibo is built on top of:

  • raylib — the cross-platform graphics library that powers the raylib backend's rendering, input, and audio layers
  • raylib-cs — the C# bindings that make raylib accessible from .NET
  • MonoGame — the cross-platform framework that powers the MonoGame backend (DesktopGL/OpenGL and WindowsDX/DirectX)

Feedback

Issues and PRs are very welcome. If you're interested in using F# for game development beyond simple 2D games, Mibo aims to be a practical, batteries-included framework that scales with your ambition.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
4.5.0 32 8/19/2026
4.4.0 58 8/18/2026
4.3.0 75 8/16/2026
4.2.0 99 8/12/2026
4.1.0 82 8/10/2026
4.0.0 101 8/7/2026
4.0.0-rc-003 94 8/3/2026
4.0.0-rc-002 109 8/3/2026
4.0.0-rc-001 93 8/2/2026
4.0.0-beta-001 91 7/28/2026
3.3.0 103 7/26/2026
3.2.0 110 7/25/2026
3.1.1 105 7/23/2026
3.1.0 102 7/20/2026
3.0.0 98 7/18/2026
2.2.0 101 7/16/2026
2.1.0 107 7/11/2026
2.0.1 112 7/9/2026
2.0.0 114 7/9/2026
2.0.0-rc-003 98 7/7/2026
Loading failed

### Added

- **3D:** `RenderBuffer3D.CameraBlockCount` counts `BeginCamera`/`BeginCameraConfig` commands added since the last `Clear`, on both backends. The pipelines use it to skip the per-camera-block plan walk (and its per-frame allocations) for single-camera frames.

### Changed

- **MonoGame 3D:** **Breaking (behavioral):** in frames with more than one camera block, lights (ambient, directional, point, spot), the shadow origin, and shadow casting are now scoped per camera block. A block that sets its own lights starts from the frame defaults (lights emitted before the first camera block or between blocks) and applies them in order; a block that sets none inherits the running set. Each camera block renders its own shadow map, so multi-block frames cost one shadow pass per block. Single-camera frames are unchanged.
- **Raylib 3D:** **Breaking (behavioral):** the same per-camera-block scoping: lights no longer accumulate across blocks that set their own lights, and the shadow pass runs per camera block instead of once per frame. Single-camera frames are unchanged.
- **3D:** **Breaking (behavioral):** only the first directional light is shaded, and only it can cast shadows, on both backends. Previously a frame whose first directional light didn't cast could still be shadowed by a later casting light's shadow map, and a casting directional light could render a shadow map nothing sampled.
- **Raylib 3D:** the per-shadow-pass point/spot shadow-slot arrays are now grow-only pipeline scratch (matching the MonoGame backend) instead of fresh arrays per pass, and the pre-scan no longer gathers lights frame-globally in multi-camera-block frames (the per-block forward pass builds them).
- **MonoGame 3D:** the shadow/depth passes no longer allocate a `RenderTargetBinding[]` per pass to save the caller's render-target bindings; the bindings are saved into pooled scratch resized only when the bound count changes.

### Deprecated

- **3D:** `LightBuffers.defaults` is obsolete on both backends: it is a single shared mutable accumulator, so every consumer aliases the same light buffers. Use `LightBuffers.create` for per-instance state instead.

### Fixed

- **3D:** in multi-camera-block frames, live shading no longer diverges from the block plan: between-block lights were applied twice to blocks that set their own lights, blocks that set no lights were shaded by between-block and after-last-block lights the plan (and their shadow pass) didn't include, and after-last-block lights leaked into blocks that reset. The live light sets and frame defaults are now built in-order during the forward pass instead of seeded from the plan's frame defaults.
- **MonoGame 3D:** a camera block's `ClearColor` combined with a custom `Viewport` no longer clears the whole frame. The block clear is drawn as a viewport-covering triangle instead of `gd.Clear`, which ignores the viewport (D3D `ClearRenderTargetView` semantics) and wiped every previously rendered camera block (split-screen).
- **MonoGame:** the backbuffer is now created with `RenderTargetUsage.PreserveContents`. On the DX12-native backend, rebinding the backbuffer after a mid-frame render-target switch (the shadow atlas, the post-process scene RT) discarded everything drawn before the switch — in multi-camera-block frames, earlier camera blocks and the frame clear were wiped. Games can still override via a device-config callback.
- **MonoGame 3D:** two live 3D pipelines no longer bleed lights into each other; each pipeline now accumulates lights in its own buffers.
- **Raylib 3D:** a throw during a per-camera-block shadow pass no longer leaves the pipeline outside the scene render target's texture mode; the caller's texture mode is re-wrapped in a `finally`.