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

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.
present.winit bindings.wgpu as of now.Check LICENSE for more info.
Copyright 2021 @ DjDeveloperr
$ claude mcp add deno_desktop \
-- python -m otcore.mcp_server <graph>