node-raylib icon indicating copy to clipboard operation
node-raylib copied to clipboard

GuiTabBar binding has [potentially] incorrect value type for second argument

Open mordof opened this issue 5 months ago • 1 comments

I was trying to use GuiTabBar, and the second argument is using (in the bindings for it) pointerFromValue(info, 4) and casting to const char **. The cast (I think) makes sense, but the value collection there is expecting a number from the javascript function like this. It's supposed to be an array of strings for the tab names, is it not?

Looking through the Napi helpers that have been made at the top of node-raylib.cc, there doesn't appear to be anything that handles javascript arrays as arguments.

If I try and call GuiTabBar with the number (I just put the number 3.. not sure what else I would put 😆 ) as the second argument that it's asking for, I get this: Process exited with code 3221225477. which seems to be a memory access violation. That makes sense though passing 3, and then it's trying to use that as a pointer location.

Am I missing a step in how to call GuiTabBar? possibly how to provide an array to the bindings layer to give me back a pointer, and provide that to the function?

mordof avatar Aug 07 '25 22:08 mordof

Oh, on second inspection (after diving further into the details of this issue), I think this may actually effectively be a duplicate of this problem: https://github.com/RobLoach/node-raylib/issues/189

A function that expects an array of some type not being able to, and setting up the bindings for it incorrectly.

mordof avatar Aug 07 '25 22:08 mordof