mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-05 15:30:00 +01:00
Refactor _drawIcon function to make accessible outside
This commit is contained in:
@@ -173,12 +173,15 @@ bool ImGuiToolkit::ButtonSwitch(const char* label, bool* toggle, const char* too
|
||||
|
||||
|
||||
|
||||
void _drawIcon(ImVec2 screenpos, int i, int j, bool enabled = true, ImGuiWindow* window = ImGui::GetCurrentWindow() )
|
||||
void _drawIcon(ImVec2 screenpos, int i, int j, bool enabled, ImGuiWindow* window )
|
||||
{
|
||||
// icons.dds is a 20 x 20 grid of icons
|
||||
if (textureicons == 0)
|
||||
textureicons = Resource::getTextureDDS("images/icons.dds");
|
||||
|
||||
if (window == nullptr)
|
||||
window = ImGui::GetCurrentWindow();
|
||||
|
||||
ImVec2 uv0( static_cast<float>(i) * 0.05, static_cast<float>(j) * 0.05 );
|
||||
ImVec2 uv1( uv0.x + 0.05, uv0.y + 0.05 );
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "IconsFontAwesome5.h"
|
||||
|
||||
void _drawIcon(ImVec2 screenpos, int i, int j, bool enabled = true, struct ImGuiWindow* window = nullptr );
|
||||
|
||||
namespace ImGuiToolkit
|
||||
{
|
||||
// Icons from resource icon.dds
|
||||
|
||||
Reference in New Issue
Block a user