node-raylib
node-raylib copied to clipboard
Potentially wrong type exports
Calling SetShaderVector4 gives a runtime error: SetShaderVector4 is not a function. The correct function is SetShaderVec4.
As provided in your type definitions:
Hmm, neither SetShaderVector4
or SetShaderVec4
are listed on cheatsheet, so the wrapping/typescript-generation code may be out-of-date that includes it, but it's not part of raylib 4.5. I think it has moved to SetShaderValue
see this example that used to have SetShaderVec4
There is no SetShaderValue function exposed.
Using this version:
I saw your other solution on #174 where you use SetShaderVec4
. Did you get it worked out? I think there may be a mismatch on the typescript generation and raylib version. @twuky does the typescript stuff, since @RobLoach and I mostly don't use it. The API we should shoot for is current 4.5 I think, which uses SetShaderValue
.
SetShaderVec4 works yes, but I need to override typescript (//@ts-ignore
). The type export isn't there.
SetShaderValue isn't supported because it's not as simple to handle in our C implementation (its a void pointer, but you provide an extra argument to detail what value is supposed to be at that pointer). so instead I implemented statically typed functions that handle individual types. but somewhere along the way wires got crossed and they are named improperly across the typescript defs and the actual JS functions - put together a branch that fixes that