mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-13 05:08:31 +01:00
Added several new bindings (#18)
* Added ImDrawData_ScaleClipRects and fixed wrong call in igSliderFloat2 * Added ImGuiTextFilter * Added ImGuiTextEditCallbackData * Added ImGuiStorage * Added ImFontAtlas_GetGlyphRanges* APIs * Added ImGuiTextFilter struct and fixed ImDrawData_ScaleClipRects
This commit is contained in:

committed by
Stephan Dilly

parent
09a51f162e
commit
98f480cc28
@@ -851,7 +851,7 @@ CIMGUI_API bool igSliderFloat(CONST char* label, float* v, float v_min, float v_
|
||||
|
||||
CIMGUI_API bool igSliderFloat2(CONST char* label, float v[2], float v_min, float v_max, CONST char* display_format, float power)
|
||||
{
|
||||
return ImGui::SliderFloat(label, v, v_min, v_max, display_format, power);
|
||||
return ImGui::SliderFloat2(label, v, v_min, v_max, display_format, power);
|
||||
}
|
||||
|
||||
CIMGUI_API bool igSliderFloat3(CONST char* label, float v[3], float v_min, float v_max, CONST char* display_format, float power)
|
||||
@@ -1575,4 +1575,123 @@ CIMGUI_API void ImGuiIO_AddInputCharactersUTF8(CONST char* utf8_chars)
|
||||
CIMGUI_API void ImGuiIO_ClearInputCharacters()
|
||||
{
|
||||
return ImGui::GetIO().ClearInputCharacters();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Init(struct ImGuiTextFilter* filter, const char* default_filter)
|
||||
{
|
||||
*filter = ImGuiTextFilter(default_filter);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiTextFilter_Clear(struct ImGuiTextFilter* filter)
|
||||
{
|
||||
filter->Clear();
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextFilter_Draw(struct ImGuiTextFilter* filter, const char* label, float width)
|
||||
{
|
||||
return filter->Draw(label, width);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextFilter_PassFilter(struct ImGuiTextFilter* filter, const char* text, const char* text_end)
|
||||
{
|
||||
return filter->PassFilter(text, text_end);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiTextFilter_IsActive(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)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_Init(struct ImGuiStorage* storage)
|
||||
{
|
||||
*storage = ImGuiStorage();
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_Clear(struct ImGuiStorage* storage)
|
||||
{
|
||||
storage->Clear();
|
||||
}
|
||||
|
||||
CIMGUI_API int ImGuiStorage_GetInt(struct ImGuiStorage* storage, ImGuiID key, int default_val)
|
||||
{
|
||||
return storage->GetInt(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_SetInt(struct ImGuiStorage* storage, ImGuiID key, int val)
|
||||
{
|
||||
storage->SetInt(key, val);
|
||||
}
|
||||
|
||||
CIMGUI_API bool ImGuiStorage_GetBool(struct ImGuiStorage* storage, ImGuiID key, bool default_val)
|
||||
{
|
||||
return storage->GetBool(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_SetBool(struct ImGuiStorage* storage, ImGuiID key, bool val)
|
||||
{
|
||||
storage->SetBool(key, val);
|
||||
}
|
||||
|
||||
CIMGUI_API float ImGuiStorage_GetFloat(struct ImGuiStorage* storage, ImGuiID key, float default_val)
|
||||
{
|
||||
return storage->GetFloat(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_SetFloat(struct ImGuiStorage* storage, ImGuiID key, float val)
|
||||
{
|
||||
storage->SetFloat(key, val);
|
||||
}
|
||||
|
||||
CIMGUI_API void* ImGuiStorage_GetVoidPtr(struct ImGuiStorage* storage, ImGuiID key)
|
||||
{
|
||||
return storage->GetVoidPtr(key);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_SetVoidPtr(struct ImGuiStorage* storage, ImGuiID key, void* val)
|
||||
{
|
||||
storage->SetVoidPtr(key, val);
|
||||
}
|
||||
|
||||
CIMGUI_API int* ImGuiStorage_GetIntRef(struct ImGuiStorage* storage, ImGuiID key, int default_val)
|
||||
{
|
||||
return storage->GetIntRef(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API bool* ImGuiStorage_GetBoolRef(struct ImGuiStorage* storage, ImGuiID key, bool default_val)
|
||||
{
|
||||
return storage->GetBoolRef(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API float* ImGuiStorage_GetFloatRef(struct ImGuiStorage* storage, ImGuiID key, float default_val)
|
||||
{
|
||||
return storage->GetFloatRef(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API void** ImGuiStorage_GetVoidPtrRef(struct ImGuiStorage* storage, ImGuiID key, void* default_val)
|
||||
{
|
||||
return storage->GetVoidPtrRef(key, default_val);
|
||||
}
|
||||
|
||||
CIMGUI_API void ImGuiStorage_SetAllInt(struct ImGuiStorage* storage, int val)
|
||||
{
|
||||
storage->SetAllInt(val);
|
||||
}
|
@@ -35,6 +35,7 @@ struct ImFontConfig;
|
||||
struct ImFontAtlas;
|
||||
struct ImDrawCmd;
|
||||
struct ImGuiListClipper;
|
||||
struct ImGuiTextFilter;
|
||||
|
||||
typedef unsigned short ImDrawIdx;
|
||||
typedef unsigned int ImU32;
|
||||
@@ -752,6 +753,11 @@ CIMGUI_API struct ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(struct Im
|
||||
CIMGUI_API struct ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(struct ImFontAtlas* atlas, CONST char* compressed_ttf_data_base85, float size_pixels, CONST struct ImFontConfig* font_cfg, CONST ImWchar* glyph_ranges);
|
||||
CIMGUI_API void ImFontAtlas_ClearTexData(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API void ImFontAtlas_Clear(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesDefault(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesKorean(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesJapanese(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesChinese(struct ImFontAtlas* atlas);
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesCyrillic(struct ImFontAtlas* atlas);
|
||||
|
||||
CIMGUI_API void ImGuiIO_AddInputCharacter(unsigned short c);
|
||||
CIMGUI_API void ImGuiIO_AddInputCharactersUTF8(CONST char* utf8_chars);
|
||||
@@ -759,6 +765,7 @@ CIMGUI_API void ImGuiIO_ClearInputCharacters();
|
||||
|
||||
//ImDrawData
|
||||
CIMGUI_API void ImDrawData_DeIndexAllBuffers(struct ImDrawData* drawData);
|
||||
CIMGUI_API void ImDrawData_ScaleClipRects(struct ImDrawData* drawData, struct ImVec2 sc);
|
||||
|
||||
//ImDrawList
|
||||
CIMGUI_API int ImDrawList_GetVertexBufferSize(struct ImDrawList* list);
|
||||
@@ -831,3 +838,33 @@ CIMGUI_API void ImGuiListClipper_End(ImGuiListClipper* clipper);
|
||||
CIMGUI_API bool ImGuiListClipper_Step(ImGuiListClipper* clipper);
|
||||
CIMGUI_API int ImGuiListClipper_GetDisplayStart(ImGuiListClipper* clipper);
|
||||
CIMGUI_API int ImGuiListClipper_GetDisplayEnd(ImGuiListClipper* clipper);
|
||||
|
||||
// ImGuiTextFilter
|
||||
CIMGUI_API void ImGuiTextFilter_Init(struct ImGuiTextFilter* filter, const char* default_filter);
|
||||
CIMGUI_API void ImGuiTextFilter_Clear(struct ImGuiTextFilter* filter);
|
||||
CIMGUI_API bool ImGuiTextFilter_Draw(struct ImGuiTextFilter* filter, const char* label, float width);
|
||||
CIMGUI_API bool ImGuiTextFilter_PassFilter(struct ImGuiTextFilter* filter, const char* text, const char* text_end);
|
||||
CIMGUI_API bool ImGuiTextFilter_IsActive(struct ImGuiTextFilter* filter);
|
||||
CIMGUI_API void ImGuiTextFilter_Build(struct ImGuiTextFilter* filter);
|
||||
|
||||
// ImGuiTextEditCallbackData
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_DeleteChars(struct ImGuiTextEditCallbackData* data, int pos, int bytes_count);
|
||||
CIMGUI_API void ImGuiTextEditCallbackData_InsertChars(struct ImGuiTextEditCallbackData* data, int pos, const char* text, const char* text_end);
|
||||
CIMGUI_API bool ImGuiTextEditCallbackData_HasSelection(struct ImGuiTextEditCallbackData* data);
|
||||
|
||||
// ImGuiStorage
|
||||
CIMGUI_API void ImGuiStorage_Init(struct ImGuiStorage* storage);
|
||||
CIMGUI_API void ImGuiStorage_Clear(struct ImGuiStorage* storage);
|
||||
CIMGUI_API int ImGuiStorage_GetInt(struct ImGuiStorage* storage, ImGuiID key, int default_val);
|
||||
CIMGUI_API void ImGuiStorage_SetInt(struct ImGuiStorage* storage, ImGuiID key, int val);
|
||||
CIMGUI_API bool ImGuiStorage_GetBool(struct ImGuiStorage* storage, ImGuiID key, bool default_val);
|
||||
CIMGUI_API void ImGuiStorage_SetBool(struct ImGuiStorage* storage, ImGuiID key, bool val);
|
||||
CIMGUI_API float ImGuiStorage_GetFloat(struct ImGuiStorage* storage, ImGuiID key, float default_val);
|
||||
CIMGUI_API void ImGuiStorage_SetFloat(struct ImGuiStorage* storage, ImGuiID key, float val);
|
||||
CIMGUI_API void* ImGuiStorage_GetVoidPtr(struct ImGuiStorage* storage, ImGuiID key);
|
||||
CIMGUI_API void ImGuiStorage_SetVoidPtr(struct ImGuiStorage* storage, ImGuiID key, void* val);
|
||||
CIMGUI_API int* ImGuiStorage_GetIntRef(struct ImGuiStorage* storage, ImGuiID key, int default_val);
|
||||
CIMGUI_API bool* ImGuiStorage_GetBoolRef(struct ImGuiStorage* storage, ImGuiID key, bool default_val);
|
||||
CIMGUI_API float* ImGuiStorage_GetFloatRef(struct ImGuiStorage* storage, ImGuiID key, float default_val);
|
||||
CIMGUI_API void** ImGuiStorage_GetVoidPtrRef(struct ImGuiStorage* storage, ImGuiID key, void* default_val);
|
||||
CIMGUI_API void ImGuiStorage_SetAllInt(struct ImGuiStorage* storage, int val);
|
||||
|
@@ -67,6 +67,8 @@
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CIMGUI_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@@ -37,6 +37,11 @@ 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();
|
||||
|
@@ -60,4 +60,29 @@ CIMGUI_API void ImFontAtlas_ClearTexData(ImFontAtlas* atlas)
|
||||
CIMGUI_API void ImFontAtlas_Clear(ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->Clear();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesDefault(struct ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->GetGlyphRangesDefault();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesKorean(struct ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->GetGlyphRangesKorean();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesJapanese(struct ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->GetGlyphRangesJapanese();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesChinese(struct ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->GetGlyphRangesChinese();
|
||||
}
|
||||
|
||||
CIMGUI_API CONST ImWchar* ImFontAtlas_GetGlyphRangesCyrillic(struct ImFontAtlas* atlas)
|
||||
{
|
||||
return atlas->GetGlyphRangesCyrillic();
|
||||
}
|
Reference in New Issue
Block a user