Cameron Hart
Cameron Hart
> Use std::string to produce your null terminated string: std::string(start, end).c_str() This will cause many many allocations and string copies, which can be avoided with this change.
@ocornut Yeah, I totally agree/understand your concern, so wouldn't be offended if the idea is ultimately rejected :) I'll have a look at converting the remaining char\* at some point,...
Good point about function call overhead in debug builds. I wonder if anything can be done about the function call overhead of the ImStr constructors themselves. I've committed some updates...
@ratchetfreak The intention is that ImStrdup and CalcEnd are only used internally by ImGui, which means it's easier to expect preconditions like ImStr.Begin being non-null before CalcEnd is called. This...
Yes that's true. I was intentionally leaving the format strings as char*, but as you point out the format copy is only required if End is actually set to something,...
A small update: I got a branch of the Rust imgui wrapper calling through my branch of imgui so that strings are passed from Rust to C++ without needed special...
@josiahmanson my goals with this change is to avoid breaking user code as much as possible, avoid greatly increase the size of the API (i.e. through overloads) and avoid impacting...
@ocornut I noticed 1.49 was out so I merged to latest, as it turns out I'd also missed 1.48. The PR I set up didn't do what I thought (was...
That would make merging imgui.h easier. It might pave the way for this change too I guess. There's a couple of caveats; printf format strings are still `const char*` and...
Thanks @bjadamson, you can always use my https://github.com/bitshifter/imgui-rs/tree/imstr branch to use this feature, however I haven't merged with imgui-rs or imgui in a long time so it's not very actively...