MiniFB 0.7.0-alpha1
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
<PackageReference Include="MiniFB" Version="0.7.0-alpha1" />
paket add MiniFB --version 0.7.0-alpha1
#r "nuget: MiniFB, 0.7.0-alpha1"
// 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 | Versions 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. |
-
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 | 57 | 9/19/2024 |
0.7.0-alpha1 | 64 | 9/9/2024 |