Giter Site home page Giter Site logo

denosaurs / pane Goto Github PK

View Code? Open in Web Editor NEW
65.0 65.0 1.0 219 KB

🖼️ A deno module providing bindings for cross-platform windowing

Home Page: https://deno.land/x/pane

License: MIT License

TypeScript 47.96% Rust 52.04%
deno deno-plugin deno-plugins gui pane webgpu winit

pane's Introduction

pane

Tags deno doc deno release rust License Dependencies Dependency freshness


⚠️ Work in progress. Expect breaking changes.


Pane provides bindings for rust crate winit in preparation for webgpu integration in deno. This module will provide a way of getting a raw_window_handle resource to provide to deno and interaction with the window. Pane no longer provides bindings to pixels as a way of drawing framebuffers onto the window, instead use WebGPU.

Example

Singe window

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

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

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

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.

pane's People

Contributors

eliassjogreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

felipetesc

pane's Issues

Deno.openPlugin is not a function

In deno 1.13.2, I get Deno.openPlugin is not a function when I try to use pane:

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);
deno run --unstable --allow-all ./panetest.ts 

Sporadic Segfault/Access Violation

When testing this extension, I faced many segfaults errors. After some tests, I noticed that replacing the Vec<Event> to a () in the event_loop_step function fixes the segfault. So this issue is probably related to denoland/deno#10534

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.