Version
1.92.0
What part of the binding has gaps?
Dear ImGui
What is missing?
In Dear ImGui, Text and TextColored accept a format string and varargs - format string arguments. According to ImGui.java, these are hardcoded to NULL:
private static native void nText(String text); /*MANUAL
auto text = obj_text == NULL ? NULL : (char*)env->GetStringUTFChars(obj_text, JNI_FALSE);
ImGui::Text(text, NULL);
if (text != NULL) env->ReleaseStringUTFChars(obj_text, text);
*/
Use case: measuring text size to position it before rendering. calcTextSize expects a pre-formatted string. But text and textColored still expect format strings, even though it is not possible to pass format string arguments. So if the string contains, for example, a % character, it needs to be encoded as %% - and that cannot be directly passed to calcTextSize - it will return incorrect value.
I can think of 2 possible solutions, depending on how difficult it is to bind varargs methods:
- allow to pass varargs (
Object...) to text and textColored methods
- instead of
ImGui::Text(text, NULL), invoke ImGui::Text("%s", text)
Version
1.92.0
What part of the binding has gaps?
Dear ImGui
What is missing?
In Dear ImGui,
TextandTextColoredaccept a format string and varargs - format string arguments. According toImGui.java, these are hardcoded toNULL:Use case: measuring text size to position it before rendering.
calcTextSizeexpects a pre-formatted string. ButtextandtextColoredstill expect format strings, even though it is not possible to pass format string arguments. So if the string contains, for example, a%character, it needs to be encoded as%%- and that cannot be directly passed tocalcTextSize- it will return incorrect value.I can think of 2 possible solutions, depending on how difficult it is to bind varargs methods:
Object...) totextandtextColoredmethodsImGui::Text(text, NULL), invokeImGui::Text("%s", text)