All Projects β†’ DjDeveloperr β†’ deno_desktop

DjDeveloperr / deno_desktop

Licence: MIT license
Windowing support for Deno WebGPU.

Programming Languages

rust
11053 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to deno desktop

eseed-window
A minimal cross-platform C++17 window management library for rendering (deprecated)
Stars: ✭ 18 (-63.27%)
Mutual labels:  window, surface
deno-x-ranking
πŸ¦• Deno Third Party Modules Ranking πŸ‘‘
Stars: ✭ 28 (-42.86%)
Mutual labels:  deno
carol
A Deno port of carlo
Stars: ✭ 63 (+28.57%)
Mutual labels:  deno
hatcher
🐣 Registries toolbox & update notifications for your CLI
Stars: ✭ 14 (-71.43%)
Mutual labels:  deno
drash
A microframework for Deno's HTTP server with zero third-party dependencies
Stars: ✭ 1,013 (+1967.35%)
Mutual labels:  deno
slack-web-api
Simple, convenient, and configurable HTTP client for making requests to Slack’s Web API. Deno port of @slack/web-api
Stars: ✭ 16 (-67.35%)
Mutual labels:  deno
deno-dex
πŸ¦• A dexterous deno executor
Stars: ✭ 19 (-61.22%)
Mutual labels:  deno
sherlock
πŸ”Ž Find usernames across social networks
Stars: ✭ 52 (+6.12%)
Mutual labels:  window
scuttlesaurus
retog.github.io/scuttlesaurus/
Stars: ✭ 21 (-57.14%)
Mutual labels:  deno
now-deno-example
A demo application of now-deno and deno-postgres.
Stars: ✭ 30 (-38.78%)
Mutual labels:  deno
azure-webapps-deno-deploy
A GitHub Action for deploying Deno πŸ¦• web apps to Azure ☁️
Stars: ✭ 27 (-44.9%)
Mutual labels:  deno
EventSource
EventSource in Deno
Stars: ✭ 18 (-63.27%)
Mutual labels:  deno
plain-modal
The simple library for customizable modal window.
Stars: ✭ 21 (-57.14%)
Mutual labels:  window
THREE.WebGPURenderer
Experimental Three.js WebGPU renderer
Stars: ✭ 117 (+138.78%)
Mutual labels:  webgpu
deno deploy versailles
凑尔衛语录(ιƒ¨η½²εœ¨ Deno Deploy)
Stars: ✭ 18 (-63.27%)
Mutual labels:  deno
YdarWallpaper
openglζΈ²ζŸ“ηš„εŠ¨ζ€ζ‘Œι’ε£ηΊΈ
Stars: ✭ 65 (+32.65%)
Mutual labels:  window
prettyBenching
πŸ¦• A small lib to make your Deno benchmarking progress and results look pretty
Stars: ✭ 23 (-53.06%)
Mutual labels:  deno
wonnx
A GPU-accelerated ONNX inference run-time written 100% in Rust, ready for the web
Stars: ✭ 160 (+226.53%)
Mutual labels:  webgpu
webgpu-seed
πŸ”ΊπŸŒ± An example on how to render a hello triangle with WebGPU.
Stars: ✭ 178 (+263.27%)
Mutual labels:  webgpu
ssvm-deno-starter
A template project to run Rust functions in Deno through the Second State WebAssembly engine.
Stars: ✭ 50 (+2.04%)
Mutual labels:  deno

deno_desktop

Windowing support for Deno WebGPU. In very early stages at the moment.

demo

Usage

const win = Deno.createWindow({
  title: "Deno Desktop",
  width: 800,
  height: 600,
  resizable: false,
  // ...
});

const surface = win.createSurface(device);

The surface object maps to the WebGPU GPUCanvasContext object. So you first configure it then render to the texture returned for each frame by getCurrentTexture. Do note that unlike web implementations, you need to call surface.present() after rendering it.

You also need to go through the event loop in order to render. Deno.eventLoop() returns Async Iterator yielding events. Mostly you'd do something like this:

for await (const event of Deno.eventLoop()) {
  if (event.type === "windowEvent" && event.windowID === win.id) {
    if (event.event.type === "closeRequested") {
      // Do any cleanup stuff before this.
      // There is an unverified bug that causes panic if we do not 
      // exit manually.
      Deno.exit(0);
    }
  } else if (event.type === "redrawRequested" && event.windowID === win.id) {
    // Render things and then present them on Window.
    renderStuff();
    surface.present();
  }
}

And finally, in order to receive redrawRequested events, call win.requestRedraw in your program's main loop.

TODO

  • Try to match Web API. Such as not having to call present.
  • Complete the winit bindings.

Notes

  • I'm currently using a fork of Deno in this. It is to export some private structs in order to extend WebGPU API. Also, the fork uses an updated version of wgpu as of now.
  • Debug builds seem to be locked at 30 fps usually, while release builds are 60 fps in same test.

License

Check LICENSE for more info.

Copyright 2021 @ DjDeveloperr

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].