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

Use V strings for function args/return types #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

squidink7
Copy link

This PR changes the functions exposed by the library to take/return V strings rather than pointers to C strings. This means you don't need to use 'V string here'.str whenever you call a raylib function, and you don't need to convert back to a V string whenever you get a string result from raylib.

I also commented out some API functions to build with the newer raylib versions, which is unrelated to this PR and might cause issues, so I wouldn't recommend merging until I get that sorted out.

@irishgreencitrus
Copy link
Owner

Thanks for this, its something I've had on my todo list for a while. However I will need to put the merge on hold until I get raylib.v working with the latest raylib and V version.

@irishgreencitrus irishgreencitrus added enhancement New feature or request on-hold Other changes need to be made before this change can be merged breaking Breaking change labels Oct 9, 2023
@squidink7
Copy link
Author

Of course! It already seems to work fine with the latest V, but does need some changes for Raylib 4.5 as you say. I was also thinking of moving some functions into methods of various structs (e.g. image_resize(img Image, ...) becomes img.resize() where img is an instance of Image) or even using V's new static methods for grouping certain functions (e.g. Image.load(...)) but wanted to get your input first as that's a bit more of a drastic change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change enhancement New feature or request on-hold Other changes need to be made before this change can be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants