https://github.com/denosaurs/pane
🖼️ A deno module providing bindings for cross-platform windowing
https://github.com/denosaurs/pane
deno deno-plugin deno-plugins gui pane webgpu winit
Last synced: 4 months ago
JSON representation
🖼️ A deno module providing bindings for cross-platform windowing
- Host: GitHub
- URL: https://github.com/denosaurs/pane
- Owner: denosaurs
- License: mit
- Archived: true
- Created: 2020-11-16T01:41:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-21T11:55:07.000Z (almost 4 years ago)
- Last Synced: 2024-03-26T01:27:27.603Z (about 1 year ago)
- Topics: deno, deno-plugin, deno-plugins, gui, pane, webgpu, winit
- Language: Rust
- Homepage: https://deno.land/x/pane
- Size: 214 KB
- Stars: 65
- Watchers: 7
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pane
[](https://github.com/denosaurs/pane/releases)
[](https://doc.deno.land/https/deno.land/x/pane/mod.ts)
[](https://github.com/denosaurs/pane/actions/workflows/deno.yml)
[](https://github.com/denosaurs/pane/actions/workflows/release.yml)
[](https://github.com/denosaurs/pane/actions/workflows/rust.yml)
[](https://github.com/denosaurs/pane/blob/master/LICENSE)
[](https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/pane/mod.ts)
[](https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/pane/mod.ts)---
> ⚠️ Work in progress. Expect breaking changes.
---
Pane provides bindings for rust crate
[winit](https://github.com/rust-windowing/winit) in preparation for
[webgpu](https://github.com/denoland/deno/pull/7977) integration in deno. This
module will provide a way of getting a
[`raw_window_handle` resource](https://github.com/denoland/deno/issues/7863#issuecomment-706897139)
to provide to deno and interaction with the window. Pane no longer provides
bindings to [pixels](https://github.com/parasyte/pixels) as a way of drawing
framebuffers onto the window, instead use WebGPU.## Example
### Singe window
```typescript
import { PaneEventLoop, PaneWindow } from "https://deno.land/x/pane/mod.ts";const eventLoop = new PaneEventLoop();
const _pane = new PaneWindow(eventLoop);setInterval(() => {
for (const event of eventLoop.step()) {
if (
event.type === "windowEvent" &&
event.value.event.type === "closeRequested"
) {
Deno.exit();
}
}
}, 0);
```### Multiple windows
```typescript
import { PaneEventLoop, PaneWindow } from "https://deno.land/x/pane/mod.ts";const eventLoop = new PaneEventLoop();
const _pane1 = new PaneWindow(eventLoop);
const _pane2 = new PaneWindow(eventLoop);setInterval(() => {
for (const event of eventLoop.step()) {
if (
event.type === "windowEvent" &&
event.value.event.type === "closeRequested"
) {
Deno.exit();
}
}
}, 0);
```## Maintainers
- Elias Sjögreen ([@eliassjogreen](https://github.com/eliassjogreen))
## Permission Table
| Permission Needed | Required | Reason |
| ----------------- | -------- | ------------------------------------- |
| `--allow-env` | yes | For development variables. |
| `--allow-net` | yes | For getting the prebuild binaries. |
| `--allow-read` | yes | For reading the library. |
| `--allow-plugin` | yes | It's a plugin, what do you expect. |
| `--unstable` | yes | It's unstable because it is a plugin. |## Other
### Related
- [winit](https://github.com/rust-windowing/winit)
### Contribution
Pull request, issues and feedback are very welcome. Code style is formatted with
`deno fmt` and commit messages are done following Conventional Commits spec.### Licence
Copyright 2020-2021, the denosaurs team. All rights reserved. MIT license.