11 #if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
19 #define IMGUI_VERSION "1.51"
29 #define IM_ASSERT(_EXPR) assert(_EXPR)
33 #if defined(__clang__) || defined(__GNUC__)
34 #define IM_PRINTFARGS(FMT) __attribute__((format(printf, FMT, (FMT+1))))
36 #define IM_PRINTFARGS(FMT)
39 #if defined(__clang__)
40 #pragma clang diagnostic push
41 #pragma clang diagnostic ignored "-Wold-style-cast"
66 typedef unsigned int ImU32;
84 typedef unsigned __int64
ImU64;
86 typedef unsigned long long ImU64;
98 #ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
107 ImVec4(
float _x,
float _y,
float _z,
float _w) {
x = _x;
y = _y;
z = _z;
w = _w; }
108 #ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4.
248 IMGUI_API void PushID(
const char* str_id_begin,
const char* str_id_end);
274 IMGUI_API void Image(
ImTextureID user_texture_id,
const ImVec2& size,
const ImVec2& uv0 =
ImVec2(0,0),
const ImVec2& uv1 =
ImVec2(1,1),
const ImVec4& tint_col =
ImVec4(1,1,1,1),
const ImVec4& border_col =
ImVec4(0,0,0,0));
275 IMGUI_API bool ImageButton(
ImTextureID user_texture_id,
const ImVec2& size,
const ImVec2& uv0 =
ImVec2(0,0),
const ImVec2& uv1 =
ImVec2(1,1),
int frame_padding = -1,
const ImVec4& bg_col =
ImVec4(0,0,0,0),
const ImVec4& tint_col =
ImVec4(1,1,1,1));
280 IMGUI_API bool Combo(
const char* label,
int* current_item,
const char*
const* items,
int items_count,
int height_in_items = -1);
281 IMGUI_API bool Combo(
const char* label,
int* current_item,
const char* items_separated_by_zeros,
int height_in_items = -1);
282 IMGUI_API bool Combo(
const char* label,
int* current_item,
bool (*items_getter)(
void*
data,
int idx,
const char** out_text),
void* data,
int items_count,
int height_in_items = -1);
283 IMGUI_API void PlotLines(
const char* label,
const float*
values,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0),
int stride =
sizeof(
float));
284 IMGUI_API void PlotLines(
const char* label,
float (*values_getter)(
void* data,
int idx),
void* data,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0));
285 IMGUI_API void PlotHistogram(
const char* label,
const float* values,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0),
int stride =
sizeof(
float));
286 IMGUI_API void PlotHistogram(
const char* label,
float (*values_getter)(
void* data,
int idx),
void* data,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0));
291 IMGUI_API bool DragFloat(
const char* label,
float* v,
float v_speed = 1.0
f,
float v_min = 0.0
f,
float v_max = 0.0
f,
const char* display_format =
"%.3f",
float power = 1.0
f);
292 IMGUI_API bool DragFloat2(
const char* label,
float v[2],
float v_speed = 1.0
f,
float v_min = 0.0
f,
float v_max = 0.0
f,
const char* display_format =
"%.3f",
float power = 1.0
f);
293 IMGUI_API bool DragFloat3(
const char* label,
float v[3],
float v_speed = 1.0
f,
float v_min = 0.0
f,
float v_max = 0.0
f,
const char* display_format =
"%.3f",
float power = 1.0
f);
294 IMGUI_API bool DragFloat4(
const char* label,
float v[4],
float v_speed = 1.0
f,
float v_min = 0.0
f,
float v_max = 0.0
f,
const char* display_format =
"%.3f",
float power = 1.0
f);
295 IMGUI_API bool DragFloatRange2(
const char* label,
float* v_current_min,
float* v_current_max,
float v_speed = 1.0
f,
float v_min = 0.0
f,
float v_max = 0.0
f,
const char* display_format =
"%.3f",
const char* display_format_max = NULL,
float power = 1.0
f);
296 IMGUI_API bool DragInt(
const char* label,
int* v,
float v_speed = 1.0
f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
297 IMGUI_API bool DragInt2(
const char* label,
int v[2],
float v_speed = 1.0
f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
298 IMGUI_API bool DragInt3(
const char* label,
int v[3],
float v_speed = 1.0
f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
299 IMGUI_API bool DragInt4(
const char* label,
int v[4],
float v_speed = 1.0
f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
300 IMGUI_API bool DragIntRange2(
const char* label,
int* v_current_min,
int* v_current_max,
float v_speed = 1.0
f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f",
const char* display_format_max = NULL);
315 IMGUI_API bool SliderFloat(
const char* label,
float* v,
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0
f);
316 IMGUI_API bool SliderFloat2(
const char* label,
float v[2],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0
f);
317 IMGUI_API bool SliderFloat3(
const char* label,
float v[3],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0
f);
318 IMGUI_API bool SliderFloat4(
const char* label,
float v[4],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0
f);
319 IMGUI_API bool SliderAngle(
const char* label,
float* v_rad,
float v_degrees_min = -360.0
f,
float v_degrees_max = +360.0
f);
320 IMGUI_API bool SliderInt(
const char* label,
int* v,
int v_min,
int v_max,
const char* display_format =
"%.0f");
321 IMGUI_API bool SliderInt2(
const char* label,
int v[2],
int v_min,
int v_max,
const char* display_format =
"%.0f");
322 IMGUI_API bool SliderInt3(
const char* label,
int v[3],
int v_min,
int v_max,
const char* display_format =
"%.0f");
323 IMGUI_API bool SliderInt4(
const char* label,
int v[4],
int v_min,
int v_max,
const char* display_format =
"%.0f");
324 IMGUI_API bool VSliderFloat(
const char* label,
const ImVec2& size,
float* v,
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0
f);
325 IMGUI_API bool VSliderInt(
const char* label,
const ImVec2& size,
int* v,
int v_min,
int v_max,
const char* display_format =
"%.0f");
359 IMGUI_API bool ListBox(
const char* label,
int* current_item,
const char*
const* items,
int items_count,
int height_in_items = -1);
360 IMGUI_API bool ListBox(
const char* label,
int* current_item,
bool (*items_getter)(
void* data,
int idx,
const char** out_text),
void* data,
int items_count,
int height_in_items = -1);
369 IMGUI_API void Value(
const char* prefix,
float v,
const char* float_format = NULL);
384 IMGUI_API bool MenuItem(
const char* label,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
435 IMGUI_API ImVec2 CalcTextSize(
const char* text,
const char* text_end = NULL,
bool hide_text_after_double_hash =
false,
float wrap_width = -1.0
f);
436 IMGUI_API void CalcListClipping(
int items_count,
float items_height,
int* out_items_display_start,
int* out_items_display_end);
481 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
651 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
731 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
809 const char* (*GetClipboardTextFn)(
void* user_data);
815 void* (*MemAllocFn)(
size_t sz);
921 if (new_capacity <=
Capacity)
return;
950 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS // Will obsolete
951 #define IMGUI_ONCE_UPON_A_FRAME static ImGuiOnceUponAFrame imgui_oaf; if (imgui_oaf)
965 const char*
end()
const {
return e; }
968 static bool is_blank(
char c) {
return c ==
' ' || c ==
'\t'; }
1016 union {
int val_i;
float val_f;
void*
val_p; };
1072 IMGUI_API void DeleteChars(
int pos,
int bytes_count);
1073 IMGUI_API void InsertChars(
int pos,
const char* text,
const char* text_end = NULL);
1088 #ifdef IMGUI_USE_BGRA_PACKED_COLOR
1089 #define IM_COL32_R_SHIFT 16
1090 #define IM_COL32_G_SHIFT 8
1091 #define IM_COL32_B_SHIFT 0
1092 #define IM_COL32_A_SHIFT 24
1093 #define IM_COL32_A_MASK 0xFF000000
1095 #define IM_COL32_R_SHIFT 0
1096 #define IM_COL32_G_SHIFT 8
1097 #define IM_COL32_B_SHIFT 16
1098 #define IM_COL32_A_SHIFT 24
1099 #define IM_COL32_A_MASK 0xFF000000
1101 #define IM_COL32(R,G,B,A) (((ImU32)(A)<<IM_COL32_A_SHIFT) | ((ImU32)(B)<<IM_COL32_B_SHIFT) | ((ImU32)(G)<<IM_COL32_G_SHIFT) | ((ImU32)(R)<<IM_COL32_R_SHIFT))
1102 #define IM_COL32_WHITE IM_COL32(255,255,255,255) // Opaque white = 0xFFFFFFFF
1103 #define IM_COL32_BLACK IM_COL32(0,0,0,255) // Opaque black
1104 #define IM_COL32_BLACK_TRANS IM_COL32(0,0,0,0) // Transparent black = 0x00000000
1124 static ImColor HSV(
float h,
float s,
float v,
float a = 1.0
f) {
float r,
g,
b;
ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b);
return ImColor(r,g,b,
a); }
1144 int ItemsCount,
StepNo, DisplayStart, DisplayEnd;
1177 ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = -8192.0f; ClipRect.z = ClipRect.w = +8192.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
1186 #ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT
1198 IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
1238 IMGUI_API void PushClipRectFullScreen();
1247 IMGUI_API void AddRect(
const ImVec2&
a,
const ImVec2&
b,
ImU32 col,
float rounding = 0.0
f,
int rounding_corners_flags = ~0,
float thickness = 1.0
f);
1254 IMGUI_API void AddCircle(
const ImVec2& centre,
float radius,
ImU32 col,
int num_segments = 12,
float thickness = 1.0
f);
1255 IMGUI_API void AddCircleFilled(
const ImVec2& centre,
float radius,
ImU32 col,
int num_segments = 12);
1256 IMGUI_API void AddText(
const ImVec2& pos,
ImU32 col,
const char* text_begin,
const char* text_end = NULL);
1257 IMGUI_API void AddText(
const ImFont* font,
float font_size,
const ImVec2& pos,
ImU32 col,
const char* text_begin,
const char* text_end = NULL,
float wrap_width = 0.0
f,
const ImVec4* cpu_fine_clip_rect = NULL);
1259 IMGUI_API void AddImageQuad(
ImTextureID user_texture_id,
const ImVec2& a,
const ImVec2& b,
const ImVec2&
c,
const ImVec2& d,
const ImVec2& uv_a =
ImVec2(0,0),
const ImVec2& uv_b =
ImVec2(1,0),
const ImVec2& uv_c =
ImVec2(1,1),
const ImVec2& uv_d =
ImVec2(0,1),
ImU32 col = 0xFFFFFFFF);
1260 IMGUI_API void AddPolyline(
const ImVec2*
points,
const int num_points,
ImU32 col,
bool closed,
float thickness,
bool anti_aliased);
1268 inline void PathFillConvex(
ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col,
true); PathClear(); }
1269 inline void PathStroke(
ImU32 col,
bool closed,
float thickness = 1.0
f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness,
true); PathClear(); }
1270 IMGUI_API void PathArcTo(
const ImVec2& centre,
float radius,
float a_min,
float a_max,
int num_segments = 10);
1271 IMGUI_API void PathArcToFast(
const ImVec2& centre,
float radius,
int a_min_of_12,
int a_max_of_12);
1273 IMGUI_API void PathRect(
const ImVec2& rect_min,
const ImVec2& rect_max,
float rounding = 0.0
f,
int rounding_corners_flags = ~0);
1278 IMGUI_API void ChannelsSplit(
int channels_count);
1280 IMGUI_API void ChannelsSetCurrent(
int channel_index);
1290 IMGUI_API void PrimReserve(
int idx_count,
int vtx_count);
1294 inline void PrimWriteVtx(
const ImVec2& pos,
const ImVec2& uv,
ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
1311 ImDrawData() { Valid =
false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
1353 IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(
const void* compressed_font_data,
int compressed_font_size,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1354 IMGUI_API ImFont* AddFontFromMemoryCompressedBase85TTF(
const char* compressed_font_data_base85,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1365 IMGUI_API void GetTexDataAsAlpha8(
unsigned char** out_pixels,
int* out_width,
int* out_height,
int* out_bytes_per_pixel = NULL);
1366 IMGUI_API void GetTexDataAsRGBA32(
unsigned char** out_pixels,
int* out_width,
int* out_height,
int* out_bytes_per_pixel = NULL);
1383 bool GetBit(
int n) {
return (UsedChars[n >> 3] & (1 << (n & 7))) != 0; }
1384 void SetBit(
int n) { UsedChars[n >> 3] |= 1 << (n & 7); }
1386 IMGUI_API void AddText(
const char* text,
const char* text_end = NULL);
1459 bool IsLoaded()
const {
return ContainerAtlas != NULL; }
1463 IMGUI_API ImVec2 CalcTextSizeA(
float size,
float max_width,
float wrap_width,
const char* text_begin,
const char* text_end = NULL,
const char** remaining = NULL)
const;
1464 IMGUI_API const char* CalcWordWrapPositionA(
float scale,
const char* text,
const char* text_end,
float wrap_width)
const;
1473 #if defined(__clang__)
1474 #pragma clang diagnostic pop
1478 #ifdef IMGUI_INCLUDE_IMGUI_USER_H
1479 #include "imgui_user.h"