Deno wrapper around minifb, for making a framebuffer you can draw pixels to

Overview

deno minifb

This is a thin wrapper around minifb that you can use in deno. Combine it with canvas for native window that works like the canvas web API or webgpu for 3D stuff (note: it runs very slow webgpu, unusable for a game, as it's frame-by-frame.)

WIP

We are still working on it. The first goal is to get a basic window for canvas, but eventually we plan to add mouse, key, exit-handler, and loop-lifecycle stuff (for locking into a specific framerate.) The evenutal goal is to be a minimal piece to making performant native games in deno, using standardd web APIs.

deno support

Currently, you need to run deno from this PR.

I compiled it on linux, liek this:

git clone --recursive https://github.com/eliassjogreen/deno.git deno-pr-buffers
cd deno-pr-buffers
cargo build

Then set DENO in the Makefile.

usage

// TODO

development

You will need deno, make, and cargo (for rust) in your path. On mac or linux, run make setup to install everything you need.

Run make for some help.

You might also like...
Tool to draw low-resolution graphs in terminal
Tool to draw low-resolution graphs in terminal

lowcharts Tool to draw low-resolution graphs in terminal. lowcharts is meant to be used in those scenarios where we have numerical data in text files

Tiny Rust library to draw pretty line graphs using ascii characters.

rasciigraph Tiny Rust library to draw pretty line graphs using ascii characters. Usage Add this to your Cargo.toml [dependencies] rasciigraph = "0.1.1

Graphical Rust program that uses a fractal algorithm to draw a tree of sorts

rusty-vegetation Graphical Rust program that uses a fractal algorithm to draw a "tree" of sorts. To Build and Run On Linux: Install build-essentials o

Draw routes in MapLibre snapped to a street network using client-side routing
Draw routes in MapLibre snapped to a street network using client-side routing

MapLibre route snapper This plugin lets you draw routes in MapLibre GL that snap to some network (streets, usually). Unlike similar plugins that send

Rust WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain
Rust WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain

Limelight Limelight is a WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain. demo.mov live

A simple wrapper for the detour-rs library that makes making hooks much more concise

A simple wrapper for the detour-rs library that makes making hooks much more concise

Safe and rich Rust wrapper around the Vulkan API
Safe and rich Rust wrapper around the Vulkan API

Vulkano See also vulkano.rs. Vulkano is a Rust wrapper around the Vulkan graphics API. It follows the Rust philosophy, which is that as long as you do

Wrapper around Microsoft CNTK library

Bindings for CNTK library Simple low level bindings for CNTK library from Microsoft. API Documentation Status Currently exploring ways how to interact

Thin wrapper around starship.rs to format kakoune status line

kakship is just a thin wrapper around starship to format the status line of kakoune and is meant to be used with the included kakoune script kakship.kak.

Wrapper around Microsoft CNTK library

Bindings for CNTK library Simple low level bindings for CNTK library from Microsoft. API Documentation Status Currently exploring ways how to interact

📼 Wrapper around ffmpeg which simplifies merging of multiple videos
📼 Wrapper around ffmpeg which simplifies merging of multiple videos

Vidmerger A wrapper around ffmpeg which simplifies merging of multiple videos. 🙉 What is this exactly? Vidmerger is a command-line-tool which uses ff

A super minimal wrapper around unix sockets for IPC on top of tokio.

tokio-unix-ipc This crate implements a minimal abstraction over UNIX domain sockets for the purpose of IPC on top of tokio.

Wrapper around reqwest to allow for client middleware chains.

reqwest-middleware A crate implementing a wrapper around reqwest to allow for client middleware chains. Overview The reqwest-middleware client exposes

"A light wrapper around rr, the time-travelling debugger

cargo-rr A light wrapper around rr, the time-travelling debugger. Do you find yourself running the same test over and over in the debugger, trying to

A stupid wrapper around Meilisearch 🐻

Mieli 🐻 Usage 🧸 mieli 0.1.10 A stupid wrapper around meilisearch USAGE: mieli [OPTIONS] SUBCOMMAND FLAGS: -h, --help Prints help i

A wrapper around the Win32 API credential management functions.

wincredentials-rs A wrapper around the Win32 API credential management functions. Currently only supports generic credentials. Example use wincredenti

A wrapper around SDL2's game controller API.

fishsticks System for handling gamepad input, using SDL2's game controller API as the backend. License Fishsticks is dual-licensed under either Apache

Wrapper around atspi-code to provide higher-level at-spi Rust bindings

atspi Wrapper around atspi-codegen to provide higher-level at-spi Rust bindings. Contributions Take a look at our atspi-codegen crate, and try inpleme

FFI wrapper around cfitsio in Rust

rust-fitsio FFI wrapper around cfitsio in Rust Installation fitsio supports versions of cfitsio = 3.08. cfitsio must be compiled with reentrant suppo

Comments
  • rewrite: Move to MiniFB C-API

    rewrite: Move to MiniFB C-API

    no longer uses Rust, instead directly uses https://github.com/emoon/minifb

    However, there's some downsides...

    • Building is not trivial. At least on Windows.
    • It's apparently missing some (or quite a lot) features compared to rust_minifb (by same author).
    opened by DjDeveloperr 8
  • Canvas example

    Canvas example

    This is really a note for myself, but now that we have inline base64 images in deno-canvas, this demo would be nice to showcase using the same code on native or web.

    opened by konsumer 3
  • Distribution

    Distribution

    I'm not quite sure how to distribute the FFI DLL. Thinking a github action that builds DLLs for supported platforms, then put a download/cache in the import entry-point might do the trick. If Deno.dlopen understands relative URL, we could even check it into git.

    opened by konsumer 1
  • WebGPU Example

    WebGPU Example

    How should it work? I don't think it's possible to render WebGPU frames into window using minifb without a lot of copying going on, thought the output I got is pretty impressive, still runs like 11-12 FPS though:

    img

    SwapChain could be a better alternative (basically rendering directly onto raw window handle of minifb's Window), but that needs some work on Deno's side (which I could probably give a try, unlikely I'll be successful because neither I'm familiar with contributing to deno nor good with Rust). 🤔

    opened by DjDeveloperr 26
Owner
David Konsumer
Obsessed with code quality, education, and getting cool stuff done.
David Konsumer
A canvas on which you can draw anything with ease before drawing the pixels on your small hardware display.

embedded-canvas    canvas - a piece of cloth backed or framed as a surface for a painting NOTE: This crate is still in development and may have breaki

Lechev.space 13 Aug 31, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Transform your terminal into an art canvas where you can draw stuff!

Termdraw Turn your terminal into the drawing cavnas of your dream... or not! Installation To install this dream-come-true of a tool simply run cargo i

Enoki 5 Nov 23, 2022
Redirect Deno dependencies from semantic versions to the newest fitting version on deno.land/x

Deno Semver Redirect Redirect Deno dependencies from semantic versions to the newest fitting version on deno.land/x. See also this Deno Issue. How to

EdJoPaTo 8 Mar 12, 2022
Kit-kat clock utility rewritten in Rust using minifb

kitkat clock in Rust This is the plan9 cat clock utility rewritten in rust with minifb crate. $ kitkat --help Usage: kitkat [--hook|--crazy|--offset O

Manos Pitsidianakis 18 Oct 19, 2022
Example of a Baremetal program written for the Rasperry Pi 1 (BCM2845). Both the UART and the Framebuffer graphics working

This repository is aimed to provide a starting point to whoever is trying to build a BCM2835 program from scratch. This repository contains linker scr

Pietro 4 Nov 10, 2022
Generic framebuffer implementation in Rust for use with embedded-graphics library

Fraramebuffer implementation for Rust's Embedded-graphics Framebuffer approach helps to deal with display flickering when you update multiple parts of

Bernard Kobos 9 Nov 29, 2022
ePaperify: Framebuffer/image pre-processing library for e-Paper displays

ePaperify: Framebuffer/image pre-processing library for e-Paper displays

Jackson Ming Hu 5 Mar 15, 2022
A framebuffer that takes a `&[bool]` slice and returns 2x4 dot (pixel) braille `char`s

A framebuffer that takes a &[bool] slice and returns 2x4 "dot" (pixel) braille chars.

Odin Dutton 3 Mar 28, 2022
Cross platfrom window and framebuffer crate for Rust

minifb is a cross platform library written in Rust and that makes it easy to setup a window and to (optional) display a 32-bit pixel buffer. It also m

Daniel Collin 771 Jan 1, 2023