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

Insufficient documentation for sfVulkan_getGraphicsRequiredInstanceExtensions? #227

Closed
mgrojo opened this issue Feb 10, 2024 · 4 comments · Fixed by #229
Closed

Insufficient documentation for sfVulkan_getGraphicsRequiredInstanceExtensions? #227

mgrojo opened this issue Feb 10, 2024 · 4 comments · Fixed by #229
Labels
Milestone

Comments

@mgrojo
Copy link
Contributor

mgrojo commented Feb 10, 2024

I'm working on updating the Ada binding to version 2.6.0. There's a particular function that I don't know how to interface to. Forgive me if it's due to a lack of C/C++ knowledge on my part, but in any case, better documentation on how to use this function would be appreciated:

////////////////////////////////////////////////////////////
/// \brief Get Vulkan instance extensions required for graphics
///
/// \return Vulkan instance extensions required for graphics
///
////////////////////////////////////////////////////////////
CSFML_WINDOW_API const char* const* sfVulkan_getGraphicsRequiredInstanceExtensions(void);

I suppose that it returns a list of strings, but how is the caller aware of how many of them are available? For v2.5 I had to interface to a similar case, and the number of strings was returned through a count parameter. Compare with this case:

////////////////////////////////////////////////////////////
/// \brief Get a list of the names of all availabe audio capture devices
///
/// This function returns an array of strings (null terminated),
/// containing the names of all availabe audio capture devices.
/// If no devices are available then NULL is returned.
///
/// \param count Pointer to a variable that will be filled with the number of modes in the array
///
/// \return An array of strings containing the names
///
////////////////////////////////////////////////////////////
CSFML_AUDIO_API const char** sfSoundRecorder_getAvailableDevices(size_t* count);
@kimci86
Copy link
Contributor

kimci86 commented Feb 11, 2024

It looks like an oversight in CSFML API rather than a documentation problem.
The function returning a pointer is not enough. There is no way to get the number of items.

@ChrisThrasher
Copy link
Member

That’s plausibly an oversight on my part. Not sure how to fix this without an API break but I’m not necessarily opposed to doing that. The API in its current form isn’t particularly useable so what does it matter to break usages of an unusable API?

Damned C APIs…

@mgrojo
Copy link
Contributor Author

mgrojo commented Feb 11, 2024

I guess I'm the first one trying to use it. If there are no current users of this Vulkan API, there's no reason to keep it as is; it'd better to fix it and release it as soon as possible.

@eXpl0it3r
Copy link
Member

That’s plausibly an oversight on my part. Not sure how to fix this without an API break

You're not really breaking APIs when fixing broken APIs, at least in my book 😄

mgrojo added a commit to mgrojo/CSFML that referenced this issue Feb 11, 2024
…s()`

Based on `sfSoundRecorder_getAvailableDevices()`

Fixes SFML#227
ChrisThrasher pushed a commit that referenced this issue Feb 14, 2024
Based on `sfSoundRecorder_getAvailableDevices()`

Fixes #227

Co-authored-by: kimci86 <kimci86@hotmail.fr>
mgrojo added a commit to mgrojo/ASFML that referenced this issue Feb 14, 2024
@eXpl0it3r eXpl0it3r added the Bug label Sep 3, 2024
@eXpl0it3r eXpl0it3r added this to the 2.6.1 milestone Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants