samizdatco / skia-canvas

A GPU-accelerated 2D graphics environment for Node.js
MIT License
1.73k stars 69 forks source link

node REPL is not working after let win = new Window(800, 600) #148

Open rkompass opened 1 year ago

rkompass commented 1 year ago

The title says it basically.

I'm a beginner with node. I installed skia-canvas to have a way to explore drawing on a canvas/window outside a browser. I use Manjaro Linux, installed with npm install skia-canvas

After starting node in a terminal I typed:

const {Window} = require('skia-canvas')
let win = new Window(800, 600)

after that I can see my typing no longer...., seems the node REPL is gone.

Any help is appreciated.

rkompass commented 1 year ago

I saved the third example in the Readme.md that described drawing on a window in a file and started it with node. That worked, so I conclude that skia-canvas is working.

Do I need some kind of asynchronous setup (and an async REPL) to achieve interactivity? Help on this is welcome, thank you.

kugimiya commented 1 year ago

Seems like setTimeout stop working too. It starts to work only when skia-canvas window close called.

samizdatco commented 1 week ago

For more detail about the event-loop behavior you're describing, take a look at the Window docs: Responding to Events.