RobLoach / node-raylib

Node.js bindings for Raylib
https://robloach.github.io/node-raylib/
Other
245 stars 20 forks source link

Error Running node.js script #89

Closed Zyphon-22 closed 2 years ago

Zyphon-22 commented 3 years ago

I was trying to test out the code example and when i ran it, i got this error

WARNING: GLFW: Error: 65543 Description: GLX: Failed to create context: GLXBadFBConfig WARNING: GLFW: Failed to initialize Window INFO: TIMER: Target time per frame: 16.667 milliseconds Segmentation fault I am trying to run this on a RPI 3 Model b with node version 14.17.0

RobLoach commented 2 years ago

This still an issue? There's been some updates, particularly in 0.9.*

konsumer commented 2 years ago

I have tested on pi02w (should be same setup as pi3, roughly) with new 9.x stuff, and it runs pretty fast, directly off of framebuffer (no X needed.)

I discovered that raylib (and several other game libraries) work best on buster (not current bullseye) pi os, and had issues getting it compiled for bullseye. I also tested on retropie buster, and it seemed to work basically the same way.

Here is the basic procedure I used (maybe we should add this to wiki/readme?)

wget -O - https://deb.nodesource.com/setup_current.x | sudo bash -
sudo apt install nodejs git cmake libasound2-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libgbm-dev libxrandr-dev

Now you can npm i raylib in your project, and it will use the prebuilt (faster install time) if we have one available, whcih I try to make a new one for each release.

Also, if you want to build it yourself and test with lib (good procedure for dev on node-raylib) you can do this:

git clone https://github.com/RobLoach/node-raylib.git
cd node-raylib
npm i
npm config set cmake_PLATFORM="Raspberry Pi"
npm run compile
./bin/node-raylib examples/core/core_basic_window.js