mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-13 21:28:30 +01:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3f0014b569 | ||
![]() |
49d62d30cf | ||
![]() |
2ea2b91ee1 | ||
![]() |
e75eaa7239 | ||
![]() |
fa1b93bea9 | ||
![]() |
511218914b | ||
![]() |
f60eb9a510 | ||
![]() |
9e52e73e9b | ||
![]() |
6a31578c1e | ||
![]() |
50bce34b67 | ||
![]() |
14b2c5cc58 | ||
![]() |
f12e74c20f | ||
![]() |
01578cb1bd | ||
![]() |
33679d6957 | ||
![]() |
b9cd7f2d83 | ||
![]() |
1df319b232 | ||
![]() |
516547dcd9 |
@@ -9,3 +9,4 @@ compiler:
|
||||
|
||||
script:
|
||||
- make -C cimgui
|
||||
- $CC cimgui/cimgui.h # Make sure we can include in a plain C compiler
|
||||
|
@@ -7,7 +7,7 @@ Most of the functions have wrapper counterparts now, missing stuff is added on a
|
||||
This library is intended as a intermediate layer to be able to use imgui from other languages that can interface with C (like D - see [D-binding](https://github.com/Extrawurst/DerelictImgui))
|
||||
|
||||
Notes:
|
||||
* currently this wrapper is based on version [1.50 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.50)
|
||||
* currently this wrapper is based on version [1.53 of imgui](https://github.com/ocornut/imgui/releases/tag/v1.53)
|
||||
* does not compile with pure C compiler yet (for writing bindings in languages that are able to use C-ABI it is enough though, see D-bindings)
|
||||
|
||||
# usage
|
||||
@@ -23,3 +23,4 @@ Notes:
|
||||
* [ImGui.NET](https://github.com/mellinoe/ImGui.NET)
|
||||
* [imgui-rs](https://github.com/Gekkio/imgui-rs)
|
||||
* [imgui-pas](https://github.com/dpethes/imgui-pas)
|
||||
* [odin-dear_imgui](https://github.com/ThisDrunkDane/odin-dear_imgui)
|
||||
|
@@ -2,6 +2,10 @@
|
||||
#include "../imgui/imgui.h"
|
||||
#include "cimgui.h"
|
||||
|
||||
// to use placement new
|
||||
#define IMGUI_DEFINE_PLACEMENT_NEW
|
||||
#include "../imgui/imgui_internal.h"
|
||||
|
||||
CIMGUI_API ImGuiIO *igGetIO()
|
||||
{
|
||||
return &ImGui::GetIO();
|
||||
@@ -27,6 +31,11 @@ CIMGUI_API void igRender()
|
||||
ImGui::Render();
|
||||
}
|
||||
|
||||
CIMGUI_API void igEndFrame()
|
||||
{
|
||||
ImGui::EndFrame();
|
||||
}
|
||||
|
||||
CIMGUI_API void igShutdown()
|
||||
{
|
||||
ImGui::Shutdown();
|
||||
@@ -42,9 +51,9 @@ CIMGUI_API void igShowStyleEditor(ImGuiStyle* ref)
|
||||
ImGui::ShowStyleEditor(ref);
|
||||
}
|
||||
|
||||
CIMGUI_API void igShowTestWindow(bool* opened)
|
||||
CIMGUI_API void igShowDemoWindow(bool *opened)
|
||||
{
|
||||
ImGui::ShowTestWindow(opened);
|
||||
ImGui::ShowDemoWindow(opened);
|
||||
}
|
||||
|
||||
IMGUI_API void igShowMetricsWindow(bool *opened)
|
||||
@@ -52,6 +61,16 @@ IMGUI_API void igShowMetricsWindow(bool* opened)
|
||||
ImGui::ShowMetricsWindow(opened);
|
||||
}
|
||||
|
||||
CIMGUI_API void igShowStyleSelector(CONST char *label)
|
||||
{
|
||||
ImGui::ShowStyleSelector(label);
|
||||
}
|
||||
|
||||
CIMGUI_API void igShowFontSelector(CONST char *label)
|
||||
{
|
||||
ImGui::ShowFontSelector(label);
|
||||
}
|
||||
|
||||
// Window
|
||||
|
||||
CIMGUI_API bool igBegin(CONST char *name, bool *p_opened, ImGuiWindowFlags flags)
|
||||
@@ -144,22 +163,22 @@ CIMGUI_API bool igIsWindowCollapsed()
|
||||
return ImGui::IsWindowCollapsed();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsWindowAppearing()
|
||||
{
|
||||
return ImGui::IsWindowAppearing();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowFontScale(float scale)
|
||||
{
|
||||
ImGui::SetWindowFontScale(scale);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextWindowPos(CONST ImVec2 pos, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetNextWindowPos(CONST struct ImVec2 pos, ImGuiCond cond, CONST struct ImVec2 pivot)
|
||||
{
|
||||
ImGui::SetNextWindowPos(pos, cond);
|
||||
ImGui::SetNextWindowPos(pos, cond, pivot);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextWindowPosCenter(ImGuiSetCond cond)
|
||||
{
|
||||
ImGui::SetNextWindowPosCenter(cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextWindowSize(CONST ImVec2 size, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetNextWindowSize(CONST ImVec2 size, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetNextWindowSize(size, cond);
|
||||
}
|
||||
@@ -174,12 +193,7 @@ CIMGUI_API void igSetNextWindowContentSize(CONST ImVec2 size)
|
||||
ImGui::SetNextWindowContentSize(size);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextWindowContentWidth(float width)
|
||||
{
|
||||
ImGui::SetNextWindowContentWidth(width);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextWindowCollapsed(bool collapsed, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetNextWindowCollapsed(bool collapsed, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetNextWindowCollapsed(collapsed, cond);
|
||||
}
|
||||
@@ -189,17 +203,17 @@ CIMGUI_API void igSetNextWindowFocus()
|
||||
ImGui::SetNextWindowFocus();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowPos(CONST ImVec2 pos, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowPos(CONST ImVec2 pos, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowPos(pos, cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowSize(CONST ImVec2 size, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowSize(CONST ImVec2 size, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowSize(size, cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowCollapsed(bool collapsed, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowCollapsed(bool collapsed, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowCollapsed(collapsed, cond);
|
||||
}
|
||||
@@ -209,17 +223,17 @@ CIMGUI_API void igSetWindowFocus()
|
||||
ImGui::SetWindowFocus();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowPosByName(CONST char* name, CONST ImVec2 pos, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowPosByName(CONST char *name, CONST ImVec2 pos, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowPos(name, pos, cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowSize2(CONST char* name, CONST ImVec2 size, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowSize2(CONST char *name, CONST ImVec2 size, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowSize(name, size, cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetWindowCollapsed2(CONST char* name, bool collapsed, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetWindowCollapsed2(CONST char *name, bool collapsed, ImGuiCond cond)
|
||||
{
|
||||
ImGui::SetWindowCollapsed(name, collapsed, cond);
|
||||
}
|
||||
@@ -269,11 +283,6 @@ CIMGUI_API void igSetScrollFromPosY(float pos_y, float center_y_ratio)
|
||||
return ImGui::SetScrollFromPosY(pos_y, center_y_ratio);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetKeyboardFocusHere(int offset)
|
||||
{
|
||||
ImGui::SetKeyboardFocusHere(offset);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetStateStorage(ImGuiStorage *tree)
|
||||
{
|
||||
ImGui::SetStateStorage(tree);
|
||||
@@ -295,6 +304,11 @@ CIMGUI_API void igPopFont()
|
||||
return ImGui::PopFont();
|
||||
}
|
||||
|
||||
CIMGUI_API void igPushStyleColorU32(ImGuiCol idx, ImU32 col)
|
||||
{
|
||||
return ImGui::PushStyleColor(idx, col);
|
||||
}
|
||||
|
||||
CIMGUI_API void igPushStyleColor(ImGuiCol idx, CONST ImVec4 col)
|
||||
{
|
||||
return ImGui::PushStyleColor(idx, col);
|
||||
@@ -320,6 +334,11 @@ CIMGUI_API void igPopStyleVar(int count)
|
||||
return ImGui::PopStyleVar(count);
|
||||
}
|
||||
|
||||
CIMGUI_API void igGetStyleColorVec4(ImVec4 *pOut, ImGuiCol idx)
|
||||
{
|
||||
*pOut = ImGui::GetStyleColorVec4(idx);
|
||||
}
|
||||
|
||||
CIMGUI_API ImFont *igGetFont()
|
||||
{
|
||||
return ImGui::GetFont();
|
||||
@@ -345,6 +364,11 @@ CIMGUI_API ImU32 igGetColorU32Vec(CONST ImVec4* col)
|
||||
return ImGui::GetColorU32(*col);
|
||||
}
|
||||
|
||||
CIMGUI_API ImU32 igGetColorU32U32(ImU32 col)
|
||||
{
|
||||
return ImGui::GetColorU32(col);
|
||||
}
|
||||
|
||||
// Parameters stacks (current window)
|
||||
CIMGUI_API void igPushItemWidth(float item_width)
|
||||
{
|
||||
@@ -421,6 +445,11 @@ CIMGUI_API void igOpenPopup(CONST char* str_id)
|
||||
return ImGui::OpenPopup(str_id);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igOpenPopupOnItemClick(const char *str_id, int mouse_button)
|
||||
{
|
||||
return ImGui::OpenPopupOnItemClick(str_id, mouse_button);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginPopup(CONST char *str_id)
|
||||
{
|
||||
return ImGui::BeginPopup(str_id);
|
||||
@@ -436,9 +465,9 @@ CIMGUI_API bool igBeginPopupContextItem(CONST char* str_id, int mouse_button)
|
||||
return ImGui::BeginPopupContextItem(str_id, mouse_button);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginPopupContextWindow(bool also_over_items, CONST char* str_id, int mouse_button)
|
||||
CIMGUI_API bool igBeginPopupContextWindow(CONST char *str_id, int mouse_button, bool also_over_items)
|
||||
{
|
||||
return ImGui::BeginPopupContextWindow(also_over_items, str_id, mouse_button);
|
||||
return ImGui::BeginPopupContextWindow(str_id, mouse_button, also_over_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginPopupContextVoid(CONST char *str_id, int mouse_button)
|
||||
@@ -451,6 +480,11 @@ CIMGUI_API void igEndPopup()
|
||||
return ImGui::EndPopup();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsPopupOpen(CONST char *str_id)
|
||||
{
|
||||
return ImGui::IsPopupOpen(str_id);
|
||||
}
|
||||
|
||||
CIMGUI_API void igCloseCurrentPopup()
|
||||
{
|
||||
return ImGui::CloseCurrentPopup();
|
||||
@@ -548,9 +582,9 @@ CIMGUI_API void igSetCursorScreenPos(CONST ImVec2 pos)
|
||||
return ImGui::SetCursorScreenPos(pos);
|
||||
}
|
||||
|
||||
CIMGUI_API void igAlignFirstTextHeightToWidgets()
|
||||
CIMGUI_API void igAlignTextToFramePadding()
|
||||
{
|
||||
return ImGui::AlignFirstTextHeightToWidgets();
|
||||
return ImGui::AlignTextToFramePadding();
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetTextLineHeight()
|
||||
@@ -563,9 +597,14 @@ CIMGUI_API float igGetTextLineHeightWithSpacing()
|
||||
return ImGui::GetTextLineHeightWithSpacing();
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetItemsLineHeightWithSpacing()
|
||||
CIMGUI_API float igGetFrameHeight()
|
||||
{
|
||||
return ImGui::GetItemsLineHeightWithSpacing();
|
||||
return ImGui::GetFrameHeight();
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetFrameHeightWithSpacing()
|
||||
{
|
||||
return ImGui::GetFrameHeightWithSpacing();
|
||||
}
|
||||
|
||||
//Columns
|
||||
@@ -585,6 +624,16 @@ CIMGUI_API int igGetColumnIndex()
|
||||
return ImGui::GetColumnIndex();
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetColumnWidth(int column_index)
|
||||
{
|
||||
return ImGui::GetColumnWidth(column_index);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetColumnWidth(int column_index, float width)
|
||||
{
|
||||
return ImGui::SetColumnWidth(column_index, width);
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetColumnOffset(int column_index)
|
||||
{
|
||||
return ImGui::GetColumnOffset(column_index);
|
||||
@@ -595,11 +644,6 @@ CIMGUI_API void igSetColumnOffset(int column_index, float offset_x)
|
||||
return ImGui::SetColumnOffset(column_index, offset_x);
|
||||
}
|
||||
|
||||
CIMGUI_API float igGetColumnWidth(int column_index)
|
||||
{
|
||||
return ImGui::GetColumnWidth(column_index);
|
||||
}
|
||||
|
||||
CIMGUI_API int igGetColumnsCount()
|
||||
{
|
||||
return ImGui::GetColumnsCount();
|
||||
@@ -608,43 +652,42 @@ CIMGUI_API int igGetColumnsCount()
|
||||
// ID scopes
|
||||
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
|
||||
// You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
|
||||
CIMGUI_API void igPushIdStr(CONST char* str_id)
|
||||
CIMGUI_API void igPushIDStr(CONST char *str_id)
|
||||
{
|
||||
return ImGui::PushID(str_id);
|
||||
}
|
||||
|
||||
CIMGUI_API void igPushIdStrRange(CONST char* str_begin, CONST char* str_end)
|
||||
CIMGUI_API void igPushIDStrRange(CONST char *str_begin, CONST char *str_end)
|
||||
{
|
||||
return ImGui::PushID(str_begin, str_end);
|
||||
}
|
||||
|
||||
|
||||
CIMGUI_API void igPushIdPtr(CONST void* ptr_id)
|
||||
CIMGUI_API void igPushIDPtr(CONST void *ptr_id)
|
||||
{
|
||||
return ImGui::PushID(ptr_id);
|
||||
}
|
||||
|
||||
CIMGUI_API void igPushIdInt(int int_id)
|
||||
CIMGUI_API void igPushIDInt(int int_id)
|
||||
{
|
||||
return ImGui::PushID(int_id);
|
||||
}
|
||||
|
||||
CIMGUI_API void igPopId()
|
||||
CIMGUI_API void igPopID()
|
||||
{
|
||||
return ImGui::PopID();
|
||||
}
|
||||
|
||||
CIMGUI_API ImGuiID igGetIdStr(CONST char* str_id)
|
||||
CIMGUI_API ImGuiID igGetIDStr(CONST char *str_id)
|
||||
{
|
||||
return ImGui::GetID(str_id);
|
||||
}
|
||||
|
||||
CIMGUI_API ImGuiID igGetIdStrRange(CONST char* str_begin, CONST char* str_end)
|
||||
CIMGUI_API ImGuiID igGetIDStrRange(CONST char *str_begin, CONST char *str_end)
|
||||
{
|
||||
return ImGui::GetID(str_begin, str_end);
|
||||
}
|
||||
|
||||
CIMGUI_API ImGuiID igGetIdPtr(CONST void* ptr_id)
|
||||
CIMGUI_API ImGuiID igGetIDPtr(CONST void *ptr_id)
|
||||
{
|
||||
return ImGui::GetID(ptr_id);
|
||||
}
|
||||
@@ -783,41 +826,6 @@ CIMGUI_API bool igRadioButton(CONST char* label, int* v, int v_button)
|
||||
return ImGui::RadioButton(label, v, v_button);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo(CONST char* label, int* current_item, CONST char* CONST* items, int items_count, int height_in_items)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items, items_count, height_in_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo2(CONST char* label, int* current_item, CONST char* items_separated_by_zeros, int height_in_items)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items_separated_by_zeros, height_in_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo3(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)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items_getter, data, items_count, height_in_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorButton(CONST ImVec4 col, bool small_height, bool outline_border)
|
||||
{
|
||||
return ImGui::ColorButton(col, small_height, outline_border);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorEdit3(CONST char* label, float col[3])
|
||||
{
|
||||
return ImGui::ColorEdit3(label, col);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorEdit4(CONST char* label, float col[4], bool show_alpha)
|
||||
{
|
||||
return ImGui::ColorEdit4(label, col, show_alpha);
|
||||
}
|
||||
|
||||
CIMGUI_API void igColorEditMode(ImGuiColorEditMode mode)
|
||||
{
|
||||
return ImGui::ColorEditMode(mode);
|
||||
}
|
||||
|
||||
CIMGUI_API void igPlotLines(CONST char *label, CONST float *values, int values_count, int values_offset, CONST char *overlay_text, float scale_min, float scale_max, ImVec2 graph_size, int stride)
|
||||
{
|
||||
return ImGui::PlotLines(label, values, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size, stride);
|
||||
@@ -838,7 +846,7 @@ CIMGUI_API void igPlotHistogram2(CONST char* label, float(*values_getter)(void*
|
||||
return ImGui::PlotHistogram(label, values_getter, data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
|
||||
}
|
||||
|
||||
CIMGUI_API void igProgressBar(float fraction, CONST ImVec2* size_arg, const char* overlay)
|
||||
CIMGUI_API void igProgressBar(float fraction, CONST ImVec2 *size_arg, CONST char *overlay)
|
||||
{
|
||||
return ImGui::ProgressBar(fraction, *size_arg, overlay);
|
||||
}
|
||||
@@ -899,6 +907,62 @@ CIMGUI_API bool igVSliderInt(CONST char* label, CONST ImVec2 size, int* v, int v
|
||||
return ImGui::VSliderInt(label, size, v, v_min, v_max, display_format);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginCombo(CONST char *label, CONST char *preview_value, ImGuiComboFlags flags)
|
||||
{
|
||||
return ImGui::BeginCombo(label, preview_value, flags);
|
||||
}
|
||||
|
||||
CIMGUI_API void igEndCombo()
|
||||
{
|
||||
return ImGui::EndCombo();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo(CONST char *label, int *current_item, CONST char *CONST *items, int items_count, int popup_max_height_in_items)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items, items_count, popup_max_height_in_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo2(CONST char *label, int *current_item, CONST char *items_separated_by_zeros, int popup_max_height_in_items)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items_separated_by_zeros, popup_max_height_in_items);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igCombo3(CONST char *label, int *current_item, bool (*items_getter)(void *data, int idx, CONST char **out_text), void *data, int items_count, int popup_max_height_in_items)
|
||||
{
|
||||
return ImGui::Combo(label, current_item, items_getter, data, items_count, popup_max_height_in_items);
|
||||
}
|
||||
|
||||
// Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
|
||||
CIMGUI_API bool igColorEdit3(CONST char *label, float col[3], ImGuiColorEditFlags flags)
|
||||
{
|
||||
return ImGui::ColorEdit3(label, col, flags);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorEdit4(CONST char *label, float col[4], ImGuiColorEditFlags flags)
|
||||
{
|
||||
return ImGui::ColorEdit4(label, col, flags);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorPicker3(CONST char *label, float col[3], ImGuiColorEditFlags flags)
|
||||
{
|
||||
return ImGui::ColorPicker3(label, col, flags);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorPicker4(CONST char *label, float col[4], ImGuiColorEditFlags flags, CONST float *ref_col)
|
||||
{
|
||||
return ImGui::ColorPicker4(label, col, flags, ref_col);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igColorButton(CONST char *desc_id, CONST ImVec4 col, ImGuiColorEditFlags flags, CONST ImVec2 size)
|
||||
{
|
||||
return ImGui::ColorButton(desc_id, col, flags, size);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetColorEditOptions(ImGuiColorEditFlags flags)
|
||||
{
|
||||
return ImGui::SetColorEditOptions(flags);
|
||||
}
|
||||
|
||||
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
|
||||
CIMGUI_API bool igDragFloat(CONST char *label, float *v, float v_speed, float v_min, float v_max, CONST char *display_format, float power)
|
||||
{
|
||||
@@ -1001,7 +1065,6 @@ CIMGUI_API bool igInputInt4(CONST char* label, int v[4], ImGuiInputTextFlags ext
|
||||
return ImGui::InputInt4(label, v, extra_flags);
|
||||
}
|
||||
|
||||
|
||||
// Widgets: Trees
|
||||
CIMGUI_API bool igTreeNode(CONST char *label)
|
||||
{
|
||||
@@ -1098,7 +1161,7 @@ CIMGUI_API float igGetTreeNodeToLabelSpacing()
|
||||
return ImGui::GetTreeNodeToLabelSpacing();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetNextTreeNodeOpen(bool opened, ImGuiSetCond cond)
|
||||
CIMGUI_API void igSetNextTreeNodeOpen(bool opened, ImGuiCond cond)
|
||||
{
|
||||
return ImGui::SetNextTreeNodeOpen(opened, cond);
|
||||
}
|
||||
@@ -1210,16 +1273,6 @@ CIMGUI_API void igValueFloat(CONST char* prefix, float v, CONST char* float_form
|
||||
ImGui::Value(prefix, v, float_format);
|
||||
}
|
||||
|
||||
CIMGUI_API void igValueColor(CONST char* prefix, CONST ImVec4 v)
|
||||
{
|
||||
ImGui::ValueColor(prefix,v);
|
||||
}
|
||||
|
||||
CIMGUI_API void igValueColor2(CONST char* prefix, ImU32 v)
|
||||
{
|
||||
ImGui::ValueColor(prefix,v);
|
||||
}
|
||||
|
||||
// Logging: all text output from interface is redirected to tty/file/clipboard. Tree nodes are automatically opened.
|
||||
CIMGUI_API void igLogToTTY(int max_depth)
|
||||
{
|
||||
@@ -1251,12 +1304,42 @@ CIMGUI_API void igLogText(CONST char* fmt, ...)
|
||||
char buffer[256];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
snprintf(buffer, 256, fmt, args);
|
||||
vsnprintf(buffer, 256, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
ImGui::LogText("%s", buffer);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginDragDropSource(ImGuiDragDropFlags flags, int mouse_button)
|
||||
{
|
||||
return ImGui::BeginDragDropSource(flags, mouse_button);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igSetDragDropPayload(CONST char *type, CONST void *data, size_t size, ImGuiCond cond)
|
||||
{
|
||||
return ImGui::SetDragDropPayload(type, data, size, cond);
|
||||
}
|
||||
|
||||
CIMGUI_API void igEndDragDropSource()
|
||||
{
|
||||
ImGui::EndDragDropSource();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igBeginDragDropTarget()
|
||||
{
|
||||
return ImGui::BeginDragDropTarget();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST struct ImGuiPayload *igAcceptDragDropPayload(CONST char *type, ImGuiDragDropFlags flags)
|
||||
{
|
||||
return ImGui::AcceptDragDropPayload(type, flags);
|
||||
}
|
||||
|
||||
CIMGUI_API void igEndDragDropTarget()
|
||||
{
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
CIMGUI_API void igPushClipRect(CONST struct ImVec2 clip_rect_min, CONST struct ImVec2 clip_rect_max, bool intersect_with_current_clip_rect)
|
||||
{
|
||||
return ImGui::PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect);
|
||||
@@ -1267,15 +1350,35 @@ CIMGUI_API void igPopClipRect()
|
||||
return ImGui::PopClipRect();
|
||||
}
|
||||
|
||||
// Utilities
|
||||
CIMGUI_API bool igIsItemHovered()
|
||||
CIMGUI_API void igStyleColorsClassic(struct ImGuiStyle *dst)
|
||||
{
|
||||
return ImGui::IsItemHovered();
|
||||
ImGui::StyleColorsClassic(dst);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsItemHoveredRect()
|
||||
CIMGUI_API void igStyleColorsDark(struct ImGuiStyle *dst)
|
||||
{
|
||||
return ImGui::IsItemHoveredRect();
|
||||
ImGui::StyleColorsDark(dst);
|
||||
}
|
||||
|
||||
CIMGUI_API void igStyleColorsLight(struct ImGuiStyle *dst)
|
||||
{
|
||||
ImGui::StyleColorsLight(dst);
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetItemDefaultFocus()
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
|
||||
CIMGUI_API void igSetKeyboardFocusHere(int offset)
|
||||
{
|
||||
ImGui::SetKeyboardFocusHere(offset);
|
||||
}
|
||||
|
||||
// Utilities
|
||||
CIMGUI_API bool igIsItemHovered(ImGuiHoveredFlags flags)
|
||||
{
|
||||
return ImGui::IsItemHovered(flags);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsItemActive()
|
||||
@@ -1323,29 +1426,24 @@ CIMGUI_API void igSetItemAllowOverlap()
|
||||
ImGui::SetItemAllowOverlap();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsWindowHovered()
|
||||
CIMGUI_API bool igIsWindowFocused(ImGuiFocusedFlags flags)
|
||||
{
|
||||
return ImGui::IsWindowFocused(flags);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsWindowHovered(ImGuiHoveredFlags)
|
||||
{
|
||||
return ImGui::IsWindowHovered();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsWindowFocused()
|
||||
CIMGUI_API bool igIsAnyWindowFocused()
|
||||
{
|
||||
return ImGui::IsWindowFocused();
|
||||
return ImGui::IsAnyWindowFocused();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsRootWindowFocused()
|
||||
CIMGUI_API bool igIsAnyWindowHovered()
|
||||
{
|
||||
return ImGui::IsRootWindowFocused();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsRootWindowOrAnyChildFocused()
|
||||
{
|
||||
return ImGui::IsRootWindowOrAnyChildFocused();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsRootWindowOrAnyChildHovered()
|
||||
{
|
||||
return ImGui::IsRootWindowOrAnyChildHovered();
|
||||
return ImGui::IsAnyWindowHovered();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsRectVisible(CONST ImVec2 item_size)
|
||||
@@ -1378,6 +1476,11 @@ CIMGUI_API bool igIsKeyReleased(int user_key_index)
|
||||
return ImGui::IsKeyReleased(user_key_index);
|
||||
}
|
||||
|
||||
CIMGUI_API int igGetKeyPressedAmount(int key_index, float repeat_delay, float rate)
|
||||
{
|
||||
return ImGui::GetKeyPressedAmount(key_index, repeat_delay, rate);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseDown(int button)
|
||||
{
|
||||
return ImGui::IsMouseDown(button);
|
||||
@@ -1398,14 +1501,9 @@ CIMGUI_API bool igIsMouseReleased(int button)
|
||||
return ImGui::IsMouseReleased(button);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseHoveringWindow()
|
||||
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold)
|
||||
{
|
||||
return ImGui::IsMouseHoveringWindow();
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseHoveringAnyWindow()
|
||||
{
|
||||
return ImGui::IsMouseHoveringAnyWindow();
|
||||
return ImGui::IsMouseDragging(button, lock_threshold);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 r_min, CONST ImVec2 r_max, bool clip)
|
||||
@@ -1413,13 +1511,9 @@ CIMGUI_API bool igIsMouseHoveringRect(CONST ImVec2 r_min, CONST ImVec2 r_max, bo
|
||||
return ImGui::IsMouseHoveringRect(r_min, r_max, clip);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igIsMouseDragging(int button, float lock_threshold)
|
||||
CIMGUI_API bool igIsMousePosValid(CONST struct ImVec2 *mouse_pos)
|
||||
{
|
||||
return ImGui::IsMouseDragging(button,lock_threshold);
|
||||
}
|
||||
CIMGUI_API bool igIsPosHoveringAnyWindow(CONST ImVec2 pos)
|
||||
{
|
||||
return ImGui::IsPosHoveringAnyWindow(pos);
|
||||
return ImGui::IsMousePosValid(mouse_pos);
|
||||
}
|
||||
|
||||
CIMGUI_API void igGetMousePos(ImVec2 *pOut)
|
||||
@@ -1492,9 +1586,19 @@ CIMGUI_API int igGetFrameCount()
|
||||
return ImGui::GetFrameCount();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST char* igGetStyleColName(ImGuiCol idx)
|
||||
CIMGUI_API struct ImDrawList *igGetOverlayDrawList()
|
||||
{
|
||||
return ImGui::GetStyleColName(idx);
|
||||
return ImGui::GetOverlayDrawList();
|
||||
}
|
||||
|
||||
CIMGUI_API struct ImDrawListSharedData *igGetDrawListSharedData()
|
||||
{
|
||||
return ImGui::GetDrawListSharedData();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST char *igGetStyleColorName(ImGuiCol idx)
|
||||
{
|
||||
return ImGui::GetStyleColorName(idx);
|
||||
}
|
||||
|
||||
CIMGUI_API void igCalcItemRectClosestPoint(ImVec2 *pOut, CONST ImVec2 pos, bool on_edge, float outward)
|
||||
@@ -1582,9 +1686,18 @@ CIMGUI_API void ImGuiIO_ClearInputCharacters()
|
||||
return ImGui::GetIO().ClearInputCharacters();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Init(struct ImGuiTextFilter* filter, const char* default_filter)
|
||||
CIMGUI_API struct ImGuiTextFilter *ImGuiTextFilter_Create(const char *default_filter)
|
||||
{
|
||||
*filter = ImGuiTextFilter(default_filter);
|
||||
ImGuiTextFilter *filter = (ImGuiTextFilter *)ImGui::MemAlloc(sizeof(ImGuiTextFilter));
|
||||
IM_PLACEMENT_NEW(filter)
|
||||
ImGuiTextFilter(default_filter);
|
||||
return filter;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Destroy(struct ImGuiTextFilter *filter)
|
||||
{
|
||||
filter->~ImGuiTextFilter();
|
||||
ImGui::MemFree(filter);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Clear(struct ImGuiTextFilter *filter)
|
||||
@@ -1597,38 +1710,100 @@ CIMGUI_API bool ImGuiTextFilter_Draw(struct ImGuiTextFilter* filter, const char*
|
||||
return filter->Draw(label, width);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextFilter_PassFilter(struct ImGuiTextFilter* filter, const char* text, const char* text_end)
|
||||
CIMGUI_API bool ImGuiTextFilter_PassFilter(const struct ImGuiTextFilter *filter, const char *text, const char *text_end)
|
||||
{
|
||||
return filter->PassFilter(text, text_end);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextFilter_IsActive(struct ImGuiTextFilter* filter)
|
||||
CIMGUI_API bool ImGuiTextFilter_IsActive(const struct ImGuiTextFilter *filter)
|
||||
{
|
||||
return filter->IsActive();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Build(struct ImGuiTextFilter *filter)
|
||||
{
|
||||
filter->Build();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_DeleteChars(struct ImGuiTextEditCallbackData* data, int pos, int bytes_count)
|
||||
CIMGUI_API const char *ImGuiTextFilter_GetInputBuf(struct ImGuiTextFilter *filter)
|
||||
{
|
||||
data->DeleteChars(pos, bytes_count);
|
||||
return filter->InputBuf;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_InsertChars(struct ImGuiTextEditCallbackData* data, int pos, const char* text, const char* text_end)
|
||||
CIMGUI_API struct ImGuiTextBuffer *ImGuiTextBuffer_Create()
|
||||
{
|
||||
data->InsertChars(pos, text, text_end);
|
||||
ImGuiTextBuffer *buffer = (ImGuiTextBuffer *)ImGui::MemAlloc(sizeof(ImGuiTextBuffer));
|
||||
IM_PLACEMENT_NEW(buffer)
|
||||
ImGuiTextBuffer();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextEditCallbackData_HasSelection(struct ImGuiTextEditCallbackData* data)
|
||||
CIMGUI_API void ImGuiTextBuffer_Destroy(struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return data->HasSelection();
|
||||
buffer->~ImGuiTextBuffer();
|
||||
ImGui::MemFree(buffer);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_Init(struct ImGuiStorage* storage)
|
||||
CIMGUI_API char ImGuiTextBuffer_index(struct ImGuiTextBuffer *buffer, int i)
|
||||
{
|
||||
*storage = ImGuiStorage();
|
||||
return (*buffer)[i];
|
||||
}
|
||||
|
||||
CIMGUI_API const char *ImGuiTextBuffer_begin(const struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return buffer->begin();
|
||||
}
|
||||
|
||||
CIMGUI_API const char *ImGuiTextBuffer_end(const struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return buffer->end();
|
||||
}
|
||||
|
||||
CIMGUI_API int ImGuiTextBuffer_size(const struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return buffer->size();
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextBuffer_empty(struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return buffer->empty();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextBuffer_clear(struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
buffer->clear();
|
||||
}
|
||||
|
||||
CIMGUI_API const char *ImGuiTextBuffer_c_str(const struct ImGuiTextBuffer *buffer)
|
||||
{
|
||||
return buffer->c_str();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
buffer->appendfv(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextBuffer_appendfv(struct ImGuiTextBuffer *buffer, const char *fmt, va_list args)
|
||||
{
|
||||
buffer->appendfv(fmt, args);
|
||||
}
|
||||
|
||||
CIMGUI_API struct ImGuiStorage *ImGuiStorage_Create()
|
||||
{
|
||||
ImGuiStorage *storage = (ImGuiStorage *)ImGui::MemAlloc(sizeof(ImGuiStorage));
|
||||
IM_PLACEMENT_NEW(storage)
|
||||
ImGuiStorage();
|
||||
return storage;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_Destroy(struct ImGuiStorage *storage)
|
||||
{
|
||||
storage->~ImGuiStorage();
|
||||
ImGui::MemFree(storage);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_Clear(struct ImGuiStorage *storage)
|
||||
@@ -1700,3 +1875,18 @@ CIMGUI_API void ImGuiStorage_SetAllInt(struct ImGuiStorage* storage, int val)
|
||||
{
|
||||
storage->SetAllInt(val);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_DeleteChars(struct ImGuiTextEditCallbackData *data, int pos, int bytes_count)
|
||||
{
|
||||
data->DeleteChars(pos, bytes_count);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_InsertChars(struct ImGuiTextEditCallbackData *data, int pos, const char *text, const char *text_end)
|
||||
{
|
||||
data->InsertChars(pos, text, text_end);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextEditCallbackData_HasSelection(struct ImGuiTextEditCallbackData *data)
|
||||
{
|
||||
return data->HasSelection();
|
||||
}
|
||||
|
625
cimgui/cimgui.h
625
cimgui/cimgui.h
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,16 @@
|
||||
#include "../imgui/imgui.h"
|
||||
#include "cimgui.h"
|
||||
|
||||
CIMGUI_API void ImDrawData_DeIndexAllBuffers(ImDrawData *drawData)
|
||||
{
|
||||
return drawData->DeIndexAllBuffers();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawData_ScaleClipRects(ImDrawData *drawData, const struct ImVec2 sc)
|
||||
{
|
||||
return drawData->ScaleClipRects(sc);
|
||||
}
|
||||
|
||||
CIMGUI_API int ImDrawList_GetVertexBufferSize(ImDrawList *list)
|
||||
{
|
||||
return list->VtxBuffer.size();
|
||||
@@ -32,16 +42,6 @@ CIMGUI_API ImDrawCmd* ImDrawList_GetCmdPtr(ImDrawList* list, int n)
|
||||
return &list->CmdBuffer[n];
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawData_DeIndexAllBuffers(ImDrawData* drawData)
|
||||
{
|
||||
return drawData->DeIndexAllBuffers();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawData_ScaleClipRects(ImDrawData* drawData, struct ImVec2 sc)
|
||||
{
|
||||
return drawData->ScaleClipRects(sc);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_Clear(ImDrawList *list)
|
||||
{
|
||||
return list->Clear();
|
||||
@@ -77,6 +77,16 @@ CIMGUI_API void ImDrawList_PopTextureID(ImDrawList* list)
|
||||
return list->PopTextureID();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_GetClipRectMin(ImVec2 *pOut, ImDrawList *list)
|
||||
{
|
||||
*pOut = list->GetClipRectMin();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_GetClipRectMax(ImVec2 *pOut, ImDrawList *list)
|
||||
{
|
||||
*pOut = list->GetClipRectMax();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_AddLine(ImDrawList *list, CONST struct ImVec2 a, CONST struct ImVec2 b, ImU32 col, float thickness)
|
||||
{
|
||||
return list->AddLine(a, b, col, thickness);
|
||||
@@ -147,14 +157,19 @@ CIMGUI_API void ImDrawList_AddImageQuad(struct ImDrawList* list, ImTextureID use
|
||||
return list->AddImageQuad(user_texture_id, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_AddPolyline(ImDrawList* list, CONST ImVec2* points, CONST int num_points, ImU32 col, bool closed, float thickness, bool anti_aliased)
|
||||
CIMGUI_API void ImDrawList_AddImageRounded(struct ImDrawList *list, ImTextureID user_texture_id, CONST struct ImVec2 a, CONST struct ImVec2 b, CONST struct ImVec2 uv_a, CONST struct ImVec2 uv_b, ImU32 col, float rounding, int rounding_corners)
|
||||
{
|
||||
return list->AddPolyline(points, num_points, col, closed, thickness, anti_aliased);
|
||||
list->AddImageRounded(user_texture_id, a, b, uv_a, uv_b, col, rounding, rounding_corners);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList* list, CONST ImVec2* points, CONST int num_points, ImU32 col, bool anti_aliased)
|
||||
CIMGUI_API void ImDrawList_AddPolyline(ImDrawList *list, CONST ImVec2 *points, CONST int num_points, ImU32 col, bool closed, float thickness)
|
||||
{
|
||||
return list->AddConvexPolyFilled(points, num_points, col, anti_aliased);
|
||||
return list->AddPolyline(points, num_points, col, closed, thickness);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_AddConvexPolyFilled(ImDrawList *list, CONST ImVec2 *points, CONST int num_points, ImU32 col)
|
||||
{
|
||||
return list->AddConvexPolyFilled(points, num_points, col);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImDrawList_AddBezierCurve(ImDrawList *list, CONST struct ImVec2 pos0, CONST struct ImVec2 cp0, CONST struct ImVec2 cp1, CONST struct ImVec2 pos1, ImU32 col, float thickness, int num_segments)
|
||||
|
@@ -37,19 +37,19 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* atlas,CONST char*
|
||||
return atlas->AddFontFromFileTTF(filename, size_pixels, font_cfg, glyph_ranges);
|
||||
}
|
||||
|
||||
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* atlas, void* ttf_data, int ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges)
|
||||
CIMGUI_API ImFont *ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas *atlas, void *font_data, int font_size, float size_pixels, CONST ImFontConfig *font_cfg, CONST ImWchar *glyph_ranges)
|
||||
{
|
||||
return atlas->AddFontFromMemoryTTF(ttf_data, ttf_size, size_pixels, font_cfg, glyph_ranges);
|
||||
return atlas->AddFontFromMemoryTTF(font_data, font_size, size_pixels, font_cfg, glyph_ranges);
|
||||
}
|
||||
|
||||
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* atlas, CONST void* compressed_ttf_data, int compressed_ttf_size, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges)
|
||||
CIMGUI_API ImFont *ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas *atlas, CONST void *compressed_font_data, int compressed_font_size, float size_pixels, CONST ImFontConfig *font_cfg, CONST ImWchar *glyph_ranges)
|
||||
{
|
||||
return atlas->AddFontFromMemoryCompressedTTF(compressed_ttf_data, compressed_ttf_size, size_pixels, font_cfg, glyph_ranges);
|
||||
return atlas->AddFontFromMemoryCompressedTTF(compressed_font_data, compressed_font_size, size_pixels, font_cfg, glyph_ranges);
|
||||
}
|
||||
|
||||
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* atlas, CONST char* compressed_ttf_data_base85, float size_pixels, CONST ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges)
|
||||
CIMGUI_API ImFont *ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas *atlas, CONST char *compressed_font_data_base85, float size_pixels, CONST ImFontConfig *font_cfg, CONST ImWchar *glyph_ranges)
|
||||
{
|
||||
return atlas->AddFontFromMemoryCompressedBase85TTF(compressed_ttf_data_base85, size_pixels, font_cfg, glyph_ranges);
|
||||
return atlas->AddFontFromMemoryCompressedBase85TTF(compressed_font_data_base85, size_pixels, font_cfg, glyph_ranges);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas *atlas)
|
||||
@@ -57,6 +57,16 @@ CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* atlas)
|
||||
return atlas->ClearTexData();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_ClearInputData(ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->ClearInputData();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_ClearFonts(ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->ClearFonts();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->Clear();
|
||||
@@ -91,3 +101,228 @@ CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesThai(struct ImFontAtlas* a
|
||||
{
|
||||
return atlas->GetGlyphRangesThai();
|
||||
}
|
||||
|
||||
CIMGUI_API ImTextureID ImFontAtlas_GetTexID(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexID;
|
||||
}
|
||||
|
||||
CIMGUI_API unsigned char *ImFontAtlas_GetTexPixelsAlpha8(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexPixelsAlpha8;
|
||||
}
|
||||
|
||||
CIMGUI_API unsigned int *ImFontAtlas_GetTexPixelsRGBA32(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexPixelsRGBA32;
|
||||
}
|
||||
|
||||
CIMGUI_API int ImFontAtlas_GetTexWidth(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexWidth;
|
||||
}
|
||||
|
||||
CIMGUI_API int ImFontAtlas_GetTexHeight(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexHeight;
|
||||
}
|
||||
|
||||
CIMGUI_API int ImFontAtlas_GetTexDesiredWidth(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexDesiredWidth;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_SetTexDesiredWidth(struct ImFontAtlas *atlas, int TexDesiredWidth_)
|
||||
{
|
||||
atlas->TexDesiredWidth = TexDesiredWidth_;
|
||||
}
|
||||
|
||||
CIMGUI_API int ImFontAtlas_GetTexGlyphPadding(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->TexGlyphPadding;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_SetTexGlyphPadding(struct ImFontAtlas *atlas, int TexGlyphPadding_)
|
||||
{
|
||||
atlas->TexGlyphPadding = TexGlyphPadding_;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFontAtlas_GetTexUvWhitePixel(struct ImFontAtlas *atlas, ImVec2 *pOut)
|
||||
{
|
||||
*pOut = atlas->TexUvWhitePixel;
|
||||
}
|
||||
|
||||
// ImFontAtlas::Fonts;
|
||||
CIMGUI_API int ImFontAtlas_Fonts_size(struct ImFontAtlas *atlas)
|
||||
{
|
||||
return atlas->Fonts.size();
|
||||
}
|
||||
|
||||
CIMGUI_API ImFont *ImFontAtlas_Fonts_index(struct ImFontAtlas *atlas, int index)
|
||||
{
|
||||
return atlas->Fonts[index];
|
||||
}
|
||||
|
||||
// ImFont
|
||||
CIMGUI_API float ImFont_GetFontSize(CONST struct ImFont *font)
|
||||
{
|
||||
return font->FontSize;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_SetFontSize(struct ImFont *font, float FontSize_)
|
||||
{
|
||||
font->FontSize = FontSize_;
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_GetScale(CONST struct ImFont *font)
|
||||
{
|
||||
return font->Scale;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_SetScale(struct ImFont *font, float Scale_)
|
||||
{
|
||||
font->Scale = Scale_;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_GetDisplayOffset(CONST struct ImFont *font, ImVec2 *pOut)
|
||||
{
|
||||
*pOut = font->DisplayOffset;
|
||||
}
|
||||
|
||||
CIMGUI_API CONST struct IMFONTGLYPH *ImFont_GetFallbackGlyph(CONST struct ImFont *font)
|
||||
{
|
||||
return font->FallbackGlyph;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_SetFallbackGlyph(struct ImFont *font, CONST struct IMFONTGLYPH *FallbackGlyph_)
|
||||
{
|
||||
font->FallbackGlyph = FallbackGlyph_;
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_GetFallbackAdvanceX(CONST struct ImFont *font)
|
||||
{
|
||||
return font->FallbackAdvanceX;
|
||||
}
|
||||
|
||||
CIMGUI_API ImWchar ImFont_GetFallbackChar(CONST struct ImFont *font)
|
||||
{
|
||||
return font->FallbackChar;
|
||||
}
|
||||
|
||||
CIMGUI_API short ImFont_GetConfigDataCount(CONST struct ImFont *font)
|
||||
{
|
||||
return font->ConfigDataCount;
|
||||
}
|
||||
|
||||
CIMGUI_API struct ImFontConfig *ImFont_GetConfigData(struct ImFont *font)
|
||||
{
|
||||
return font->ConfigData;
|
||||
}
|
||||
|
||||
CIMGUI_API struct ImFontAtlas *ImFont_GetContainerAtlas(struct ImFont *font)
|
||||
{
|
||||
return font->ContainerAtlas;
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_GetAscent(CONST struct ImFont *font)
|
||||
{
|
||||
return font->Ascent;
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_GetDescent(CONST struct ImFont *font)
|
||||
{
|
||||
return font->Descent;
|
||||
}
|
||||
|
||||
CIMGUI_API int ImFont_GetMetricsTotalSurface(CONST struct ImFont *font)
|
||||
{
|
||||
return font->MetricsTotalSurface;
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_ClearOutputData(struct ImFont *font)
|
||||
{
|
||||
font->ClearOutputData();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_BuildLookupTable(struct ImFont *font)
|
||||
{
|
||||
font->BuildLookupTable();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST struct IMFONTGLYPH *ImFont_FindGlyph(CONST struct ImFont *font, ImWchar c)
|
||||
{
|
||||
return font->FindGlyph(c);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_SetFallbackChar(struct ImFont *font, ImWchar c)
|
||||
{
|
||||
font->SetFallbackChar(c);
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_GetCharAdvance(CONST struct ImFont *font, ImWchar c)
|
||||
{
|
||||
return font->GetCharAdvance(c);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImFont_IsLoaded(CONST struct ImFont *font)
|
||||
{
|
||||
return font->IsLoaded();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST char *ImFont_GetDebugName(CONST struct ImFont *font)
|
||||
{
|
||||
return font->GetDebugName();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_CalcTextSizeA(CONST struct ImFont *font, ImVec2 *pOut, float size, float max_width, float wrap_width, CONST char *text_begin, CONST char *text_end, CONST char **remaining)
|
||||
{
|
||||
*pOut = font->CalcTextSizeA(size, max_width, wrap_width, text_begin, text_end, remaining);
|
||||
}
|
||||
|
||||
CIMGUI_API CONST char *ImFont_CalcWordWrapPositionA(CONST struct ImFont *font, float scale, CONST char *text, CONST char *text_end, float wrap_width)
|
||||
{
|
||||
return font->CalcWordWrapPositionA(scale, text, text_end, wrap_width);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_RenderChar(CONST struct ImFont *font, ImDrawList *draw_list, float size, ImVec2 pos, ImU32 col, unsigned short c)
|
||||
{
|
||||
return font->RenderChar(draw_list, size, pos, col, c);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImFont_RenderText(CONST struct ImFont *font, ImDrawList *draw_list, float size, ImVec2 pos, ImU32 col, CONST ImVec4 *clip_rect, CONST char *text_begin, CONST char *text_end, float wrap_width, bool cpu_fine_clip)
|
||||
{
|
||||
return font->RenderText(draw_list, size, pos, col, *clip_rect, text_begin, text_end, wrap_width, cpu_fine_clip);
|
||||
}
|
||||
|
||||
// ImFont::Glyph
|
||||
CIMGUI_API int ImFont_Glyphs_size(CONST struct ImFont *font)
|
||||
{
|
||||
return font->Glyphs.size();
|
||||
}
|
||||
|
||||
CIMGUI_API struct IMFONTGLYPH *ImFont_Glyphs_index(struct ImFont *font, int index)
|
||||
{
|
||||
return &font->Glyphs[index];
|
||||
}
|
||||
|
||||
// ImFont::IndexXAdvance
|
||||
CIMGUI_API int ImFont_IndexXAdvance_size(CONST struct ImFont *font)
|
||||
{
|
||||
return font->IndexAdvanceX.size();
|
||||
}
|
||||
|
||||
CIMGUI_API float ImFont_IndexXAdvance_index(CONST struct ImFont *font, int index)
|
||||
{
|
||||
return font->IndexAdvanceX[index];
|
||||
}
|
||||
|
||||
// ImFont::IndexLookup
|
||||
CIMGUI_API int ImFont_IndexLookup_size(CONST struct ImFont *font)
|
||||
{
|
||||
return font->IndexLookup.size();
|
||||
}
|
||||
|
||||
CIMGUI_API unsigned short ImFont_IndexLookup_index(CONST struct ImFont *font, int index)
|
||||
{
|
||||
return font->IndexLookup[index];
|
||||
}
|
||||
|
2
imgui
2
imgui
Submodule imgui updated: 5e1caaaef3...e916310b2e
Reference in New Issue
Block a user