Giter Club home page Giter Club logo

deno-minifb's Introduction

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.

deno-minifb's People

Contributors

djdeveloperr avatar konsumer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

djdeveloperr

deno-minifb's Issues

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.

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). ๐Ÿค”

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.