Skip to content

Conversation

@merlinND
Copy link
Contributor

@merlinND merlinND commented Jan 7, 2026

Small fixes for PR #62.
See: https://nanobind.readthedocs.io/en/latest/functions.html#none-arguments, specifically:

Note that passing values by pointer (including null pointers) is only supported for bound types. Type casters and wrappers cannot be used in such cases and will produce compile-time errors.

Alternatively, you can also use std::optional to pass an optional argument by value.

[](float fraction, const Vec2T& size_arg, std::string overlay) {
ImGui::ProgressBar(fraction, to_vec2(size_arg), overlay.empty() ? nullptr : overlay.c_str());
[](float fraction, const Vec2T& size_arg, std::optional<std::string> overlay) {
ImGui::ProgressBar(fraction, to_vec2(size_arg), to_char_ptr(overlay));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might slightly change the previous behavior, please check whether this is okay for you.
Same goes for TextLinkOpenURL.

For the return value of `get_texture_size()`.
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

Successfully merging this pull request may close these issues.

1 participant