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

Add missing ImGui.TableGetSortSpecs API (and related objects) #246

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

ultraq
Copy link
Contributor

@ultraq ultraq commented Aug 11, 2024

Description

This PR adds the missing binding for the ImGui::TableGetSortSpecs API, which includes structs to describe table and column sorting with ImGuiTableSortSpecs and ImGuiTableColumnSortSpecs respectively.

I had a workaround for the missing binding for a prior version which I posted about in #114, but with the recent release and seeing the binding generator being merged to main, I thought I'd try to understand the generator work and complete the API properly. I still had to write some custom JNI code for ImGuiTableSortSpecs.Specs which holds a ImGuiTableColumnSortSpecs array as I couldn't find anything yet built to handle object arrays that weren't the ImVec types. (Happy to be proven wrong on that point though!)

I also added a commit to add a binding for an ImGui::TreeNodeEx overload which seems to have gone missing with the generator work (maybe? 🤷‍♂️) and that I happen to be using in a project that I used to test these changes.

Type of change

  • Minor changes or tweaks (quality of life stuff)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@SpaiR SpaiR added feat New feature or request api labels Aug 11, 2024
@SpaiR SpaiR linked an issue Aug 11, 2024 that may be closed by this pull request
@SpaiR
Copy link
Owner

SpaiR commented Aug 11, 2024

This looks great! I'm really pleased to see such a quick adaptation and usage of the new API (even without documentation 🫠).

As for the code itself - I don't have any issues with it; everything seems to be in order at first glance. Writing your own JNI is perfectly normal. Auto-generation currently (hopefully only for now) doesn't cover such scenarios, so the main thing is that it works.

However, there's one last step you need to complete - to generate the API itself 🙃. This is precisely where documentation would be helpful, but all generated API code should be committed to the repository along with the rest of the code. So, you need to run the command ./gradlew :imgui-binding:generateApi, which will generate the corresponding code in the generated folder. The content of the generated folder should not be modified, but if something doesn't seem alright - definitions or generator code can be adjusted. (At least, that is the point right now.)

@ultraq
Copy link
Contributor Author

ultraq commented Aug 11, 2024

Cool, I was running that step to get an artifact to test with but didn't know what the story was with built/generated files. Thanks for pointing that out - I'll get it sorted shortly!

ultraq and others added 2 commits August 12, 2024 19:25
Co-authored-by: SpaiR <klimbetoo@gmail.com>
Co-authored-by: SpaiR <klimbetoo@gmail.com>
@SpaiR SpaiR merged commit 9ca6d97 into SpaiR:main Aug 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImGui::TableGetSortSpecs() missing
2 participants