Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially wrong type exports #175

Open
Triazic opened this issue Jun 29, 2023 · 5 comments
Open

Potentially wrong type exports #175

Triazic opened this issue Jun 29, 2023 · 5 comments

Comments

@Triazic
Copy link

Triazic commented Jun 29, 2023

image

Calling SetShaderVector4 gives a runtime error: SetShaderVector4 is not a function.
The correct function is SetShaderVec4.

As provided in your type definitions:
image

@konsumer
Copy link
Collaborator

konsumer commented Jun 29, 2023

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

@Triazic
Copy link
Author

Triazic commented Jul 1, 2023

There is no SetShaderValue function exposed.

image

Using this version:
image

@konsumer
Copy link
Collaborator

konsumer commented Jul 1, 2023

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.

@Triazic
Copy link
Author

Triazic commented Jul 2, 2023

SetShaderVec4 works yes, but I need to override typescript (//@ts-ignore). The type export isn't there.

@twuky
Copy link
Collaborator

twuky commented Jul 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants