node-3d icon indicating copy to clipboard operation
node-3d copied to clipboard

Add support for wsl

Open ckir opened this issue 1 year ago • 2 comments

Nice project !!!

However if you try to start the example from wsl you get

/home/user/DEVELOPMENT/tests/my-project/node_modules/glfw-raub/core.js:16
                throw new Error('Failed to initialize GLFW');
                ^

Error: Failed to initialize GLFW
    at Object.<anonymous> (/home/user/DEVELOPMENT/tests/my-project/node_modules/glfw-raub/core.js:16:9)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
    at Module.load (node:internal/modules/cjs/loader:1125:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at Module.require (node:internal/modules/cjs/loader:1149:19)
    at require (node:internal/modules/helpers:121:18)
    at Object.<anonymous> (/home/user/DEVELOPMENT/tests/my-project/node_modules/glfw-raub/index.js:3:14)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)

Node.js v20.1.0

I suspect you need to enable wayland (cmake --GLFW_USE_WAYLAND -S . -B build) for this to work. I did some builds on glfw-3.3.8 and tried the examples before I post this.

ckir avatar Jun 03 '23 07:06 ckir

Thanks for the suggestion! Will it still work with X11 though?

raub avatar Jun 03 '23 15:06 raub

Hi @raub I just did a build as cmake -D GLFW_USE_WAYLAND=ON -S . -B build (sorry for the wrong command above) and I can confirm that the examples included in glfw-3.3.8 do work on my Ubuntu 22.04.2. I don't know if there are any distros not supporting wayland in nowdays so it's up to you do deside whether you want to go the wayland way or to provide different precompiled binaries. Cheers.

ckir avatar Jun 03 '23 17:06 ckir

@ckir the latest version seems to be working fine with WSL2 - I also updated GLFW to 3.4 and made sure it builds with WAYLADN=ON (but unsure what UI WSL uses here)

Screenshot_3

raub avatar Jun 02 '24 17:06 raub