RobLoach / node-raylib

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

WARNING: Failed to get monitor #42

Open acklavidian opened 4 years ago

acklavidian commented 4 years ago

I'm on OSX:10.14.6. brew install raylib lets me install raylib and run the C examples without fail. However, after installing via npm and running the example in the Readme I get:

$ node main.js
INFO: Initializing raylib 2.5
WARNING: Failed to get monitor
INFO: Target time per frame: 16.667 milliseconds
[1]    55919 segmentation fault  node main.js
RobLoach commented 4 years ago

Interesting... Perhaps it needs an update to the latest Raylib.

acklavidian commented 4 years ago

I think Raylib is still at 2.5.0. However, I can get the C equivalent to the example program in the README to run with:

clang -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL -I./node_modules/raylib/build/_deps/raylib-src/src node_modules/raylib/build/_deps/raylib-build/src/libraylib.a main.c -o my_app

I assume this means the raylib built by npm is working.

On another note npm install node-raylib fails if you already have raylib installed via brew...

acklavidian commented 4 years ago

@RobLoach any ideas on where to start trying to fix this?

RobLoach commented 4 years ago

Possibly something like this? https://github.com/RobLoach/node-raylib/pull/43

acklavidian commented 4 years ago

~Nice!!! Thanks that branch works!!!~ Sorry got this confused with another raylib binding library that is also giving me trouble Vraylib. Unfortunately, there is no change when using the update branch from that PR. Same error message except it reports that it is using raylib2.6-dev in the beginning. What environment/system are you developing/running this on? Thanks for helping me on this!

acklavidian commented 4 years ago

@RobLoach I am thinking the error is generated here: https://github.com/raysan5/raylib/blob/b8246d8592dba4d1f0ee49831f86d99ce0c7dff1/src/core.c#L869

RobLoach commented 4 years ago

Alright... Went through and updated raylib. Hopefully it's working now. Mind testing again?

Also, mind sharing part of your main.js so I could test on my machine? THANKS!

acklavidian commented 4 years ago

Unfortunately not. I've moved on to your quickjs based lib. Hoping I can get it to work on OSX and build for a rasberrypi