mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Internals: wrapped used of g.TempBuffer into ImFormatStringToTempBuffer/ImFormatStringToTempBufferV helpers.
This leaves us room for growing the buffer if needed, and gives us a resizable buffer available for other work.
This commit is contained in:
@ -331,6 +331,8 @@ static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c =
|
||||
// Helpers: Formatting
|
||||
IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3);
|
||||
IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3);
|
||||
IMGUI_API void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...) IM_FMTARGS(3);
|
||||
IMGUI_API void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) IM_FMTLIST(3);
|
||||
IMGUI_API const char* ImParseFormatFindStart(const char* format);
|
||||
IMGUI_API const char* ImParseFormatFindEnd(const char* format);
|
||||
IMGUI_API const char* ImParseFormatTrimDecorations(const char* format, char* buf, size_t buf_size);
|
||||
@ -1809,7 +1811,7 @@ struct ImGuiContext
|
||||
int WantCaptureMouseNextFrame; // Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1.
|
||||
int WantCaptureKeyboardNextFrame; // "
|
||||
int WantTextInputNextFrame;
|
||||
char TempBuffer[1024 * 3 + 1]; // Temporary text buffer
|
||||
ImVector<char> TempBuffer; // Temporary text buffer
|
||||
|
||||
ImGuiContext(ImFontAtlas* shared_font_atlas)
|
||||
{
|
||||
@ -1958,7 +1960,6 @@ struct ImGuiContext
|
||||
FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
|
||||
FramerateSecPerFrameAccum = 0.0f;
|
||||
WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
|
||||
memset(TempBuffer, 0, sizeof(TempBuffer));
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user