MiniFB 0.7.0-alpha1

This is a prerelease version of MiniFB.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MiniFB --version 0.7.0-alpha1                
NuGet\Install-Package MiniFB -Version 0.7.0-alpha1                
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="MiniFB" Version="0.7.0-alpha1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MiniFB --version 0.7.0-alpha1                
#r "nuget: MiniFB, 0.7.0-alpha1"                
#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.
// Install MiniFB as a Cake Addin
#addin nuget:?package=MiniFB&version=0.7.0-alpha1&prerelease

// Install MiniFB as a Cake Tool
#tool nuget:?package=MiniFB&version=0.7.0-alpha1&prerelease                

MiniFB

TODO: ...

Requirements

  • .NET8 or above

  • currently Windows and Linux only, but you've got all relevant architectures there (x64, x86, arm64, arm)

    There's a plan to further expand the supported platforms in the future.

  • for additional usage dependencies per platform see USAGE.md

  • for building requirements see BUILD.md

Usage

See the quickstart guide.

Alternatively, you can see USAGE.md for a more in depth look on how to use MiniFB, or have a look at the sample applications.

Building

See BUILD.md.

Quickstart

Add a reference to your .NET8+ C#-project

In your .csproj file, add reference to the MiniFB package from NuGet:

<ItemGroup>
    <PackageReference Include="MiniFB" Version="0.7.0">
</ItemGroup>

Add a using directive to import from the MiniFB namespace

Add a using directive to the top a code file, where you want to reference parts of MiniFB:

using MiniFB;

Prepare your frame buffer

The frame buffer holds the data for each individual pixel for each frame:

var buffer = new Argb[800 * 600];

Create a window

You can create a new Window by simply calling it's constructor:

using var window = new Window("Hello World!", 800, 600);

Establish a main loop and redraw your frame buffer in each frame

In each frame, you'll most likely want to redraw the contents of your frame buffer:

do
{
    // your frame redraw logic goes here
}
while (...);

Update your window at the end of each frame

At the end of each frame, you want to update the window with the contents of your redrawn frame buffer and after that wait for frame synchronization.

Inside the tailing while statement from above, insert the following, so it looks like that:

while (
    // update the window with the contents of the frame buffer ...
    window.Update(buffer) is UpdateState.Ok

    // ... and then wait for frame synchronization
    && window.WaitForSync();
);
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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.7.0-alpha2 55 9/19/2024
0.7.0-alpha1 62 9/9/2024