Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an attempt to address #241. A few things here:
I moved
ohmd_device_desc.driver
toohmd_driver.name
, which I feel makes more semantic sense than having it on every device. This is actually enough I think for users to be able to print a list of compiled drivers, as you could now iterate over the drivers inohmd_ctx
and print their names. You can still get the driver name from a device through the driver pointer.Next, I renamed
ohmd_device_desc.driver_ptr
toohmd_device_desc.driver
as there is no longer a naming conflict. It is not my intention to break any APIs here so I guess this is optional.Then, I added a function
ohmd_print_available_drivers
that prints the drivers inctx
. I figured this was more convenient that returning achar**
, because at that point a user could just do it themselves via the information inctx
. I also call this function from the simple example, so that we get:Lastly as you can see in the output I renamed the 'Deepon Driver' to 'OpenHMD Depoon Driver' to be more consistent, not sure if there was a reason for that or not.
Apologies in advance if I violated the conventions of the library, and I am more of a Ruby programmer than a C programmer ;) Feedback welcome.