mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
17
3rdparty/ocornut-imgui/imgui_user.h
vendored
17
3rdparty/ocornut-imgui/imgui_user.h
vendored
@@ -1 +1,18 @@
|
||||
namespace ImGui
|
||||
{
|
||||
struct Font
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
Regular,
|
||||
Mono,
|
||||
|
||||
Count
|
||||
};
|
||||
};
|
||||
|
||||
void PushFont(Font::Enum _font);
|
||||
|
||||
} // namespace ImGui
|
||||
|
||||
#include "widgets/memory_editor.h"
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace ImGui
|
||||
strcpy(AddrInput, "");
|
||||
}
|
||||
|
||||
void Draw(unsigned char* mem_data, int mem_size, size_t base_display_addr = 0);
|
||||
void Draw(void* mem_data, int mem_size, size_t base_display_addr = 0);
|
||||
void Draw(const void* mem_data, int mem_size, size_t base_display_addr = 0);
|
||||
};
|
||||
} // namespace ImGui
|
||||
|
||||
19
3rdparty/ocornut-imgui/widgets/memory_editor.inl
vendored
19
3rdparty/ocornut-imgui/widgets/memory_editor.inl
vendored
@@ -6,10 +6,20 @@ namespace ImGui
|
||||
// End();
|
||||
// }
|
||||
|
||||
void MemoryEditor::Draw(unsigned char* mem_data, int mem_size, size_t base_display_addr)
|
||||
void MemoryEditor::Draw(void* mem_data_void, int mem_size, size_t base_display_addr)
|
||||
{
|
||||
PushFont(Font::Mono);
|
||||
|
||||
unsigned char* mem_data = (unsigned char*)mem_data_void;
|
||||
|
||||
BeginChild("##scrolling", ImVec2(0, -GetItemsLineHeightWithSpacing()));
|
||||
|
||||
if (ImGui::BeginPopupContextWindow() )
|
||||
{
|
||||
ImGui::Checkbox("HexII", &HexII);
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0.0f, 0.0f) );
|
||||
PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, 0.0f) );
|
||||
|
||||
@@ -223,6 +233,13 @@ namespace ImGui
|
||||
}
|
||||
|
||||
PopItemWidth();
|
||||
|
||||
PopFont();
|
||||
}
|
||||
|
||||
void MemoryEditor::Draw(const void* mem_data, int mem_size, size_t base_display_addr)
|
||||
{
|
||||
Draw(const_cast<void*>(mem_data), mem_size, base_display_addr);
|
||||
}
|
||||
|
||||
} // namespace ImGui
|
||||
|
||||
@@ -280,19 +280,6 @@ namespace ImGui
|
||||
SetCursorPosY(GetCursorPosY() + GetTextLineHeightWithSpacing() );
|
||||
}
|
||||
|
||||
struct Font
|
||||
{
|
||||
enum Enum
|
||||
{
|
||||
Regular,
|
||||
Mono,
|
||||
|
||||
Count
|
||||
};
|
||||
};
|
||||
|
||||
void PushFont(Font::Enum _font);
|
||||
|
||||
} // namespace ImGui
|
||||
|
||||
#endif // IMGUI_H_HEADER_GUARD
|
||||
|
||||
@@ -453,8 +453,8 @@ struct OcornutImguiContext
|
||||
config.MergeMode = false;
|
||||
// config.MergeGlyphCenterV = true;
|
||||
|
||||
m_font[ImGui::Font::Regular] = io.Fonts->AddFontFromMemoryTTF( (void*)s_robotoRegularTtf, sizeof(s_robotoRegularTtf), _fontSize, &config);
|
||||
m_font[ImGui::Font::Mono ] = io.Fonts->AddFontFromMemoryTTF( (void*)s_robotoMonoRegularTtf, sizeof(s_robotoMonoRegularTtf), _fontSize, &config);
|
||||
m_font[ImGui::Font::Regular] = io.Fonts->AddFontFromMemoryTTF( (void*)s_robotoRegularTtf, sizeof(s_robotoRegularTtf), _fontSize, &config);
|
||||
m_font[ImGui::Font::Mono ] = io.Fonts->AddFontFromMemoryTTF( (void*)s_robotoMonoRegularTtf, sizeof(s_robotoMonoRegularTtf), _fontSize-3.0f, &config);
|
||||
|
||||
config.MergeMode = true;
|
||||
config.DstFont = m_font[ImGui::Font::Regular];
|
||||
@@ -660,9 +660,24 @@ struct OcornutImguiContext
|
||||
#endif // 0
|
||||
|
||||
#if 0
|
||||
extern void ShowExampleAppCustomNodeGraph(bool* opened);
|
||||
bool opened = true;
|
||||
ShowExampleAppCustomNodeGraph(&opened);
|
||||
{
|
||||
static ImGui::MemoryEditor me;
|
||||
bool open = true;
|
||||
if (ImGui::Begin("HexII", &open))
|
||||
{
|
||||
me.Draw(s_iconsKenneyTtf, sizeof(s_iconsKenneyTtf) );
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
#endif // 0
|
||||
|
||||
#if 0
|
||||
{
|
||||
extern void ShowExampleAppCustomNodeGraph(bool* opened);
|
||||
bool opened = true;
|
||||
ShowExampleAppCustomNodeGraph(&opened);
|
||||
}
|
||||
#endif // 0
|
||||
}
|
||||
|
||||
|
||||
@@ -733,6 +733,7 @@ int _main_(int _argc, char** _argv)
|
||||
|
||||
ImGui::Text("Key bindings:\n\n");
|
||||
|
||||
ImGui::PushFont(ImGui::Font::Mono);
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "ESC"); ImGui::SameLine(64); ImGui::Text("Exit.");
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "h"); ImGui::SameLine(64); ImGui::Text("Toggle help screen.");
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "f"); ImGui::SameLine(64); ImGui::Text("Toggle full-screen.");
|
||||
@@ -753,6 +754,8 @@ int _main_(int _argc, char** _argv)
|
||||
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "r/g/b"); ImGui::SameLine(64); ImGui::Text("Toggle R, G, or B color channel.");
|
||||
ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), "a"); ImGui::SameLine(64); ImGui::Text("Toggle alpha blending.");
|
||||
ImGui::PopFont();
|
||||
|
||||
ImGui::NextLine();
|
||||
|
||||
ImGui::Dummy(ImVec2(0.0f, 0.0f) );
|
||||
|
||||
Reference in New Issue
Block a user