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
Double precision support #1011
Comments
I've found this previous issue now after searching more deeply: #320 Apparently the preferred way to handle this is via string processing on the inputs, but that opens a whole can of worms (validation, fast and accurate string <=> double conversion, ...) and generally breaks the main nice thing about ImGui, that you can just drop it in to make your data editable. |
I'd like to solve this problem eventually. As you pointed out one of the problem is the explosion of API entry points.
Creating an |
This seems like a common enough thing to want to do to justify adding to ImGui proper. Through either templating or just creating those functions, it would be nice to see this. Our entire codebase uses |
…arsScientific to add 'e' 'E' to list of characters that can be input. (later useful for #1011)
…imal_precision parameter to also for "%e" and variants. (#1011) May transition the other InputXXX function to use format strings as well.
@lycium, @IsaacWoods Sorry I didn't get to react earlier and with more details on this.
|
That's awesome, thank you! |
FYI, I have added functions in a branch to work with float, double, 32/64 bits, signed and unsigned (and in a proper lossless manner, as previously some functions didn't work great with big integers). |
Sorry if this has been mentioned before (seems quite an obvious request, though I couldn't find any mention of it), but would it be possible to support double precision as well? For example, in addition to:
bool ImGui::SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format, float power)
there would also be:
bool ImGui::SliderDouble(const char* label, double* v, double v_min, double v_max, const char* display_format, double power)
I'm aware that it could potentially lead to lots of code duplication, though maybe this can be avoided by templating the code. On the other hand, without double precision support in imgui, it becomes extremely awkward to edit our double precision internal data / very frustrating to work around.
I'm also aware that games typically don't use much double precision, but sometimes they might, and for other applications it can also be useful.
It's pretty easy to hack up this support myself and submit the pull request, but I'm first curious to know if it would be considered at all.
Thanks for your awesome library!
The text was updated successfully, but these errors were encountered: