Something went wrong. Try again.
art software for the rest of us
drawing paint image sdl art
Something went wrong. Try again.
C++
12345678910111213141516171819202122232425262728293031#include "Style.h"#include <imgui.h>
Style::Style(std::unordered_map<ImGuiStyleVar, float> stylesFloat, std::unordered_map<ImGuiStyleVar, ImVec2> stylesVec2, std::unordered_map<ImGuiCol, ImVec4> colors){ this->stylesFloat = stylesFloat; this->stylesVec2 = stylesVec2; this->colors = colors;}
void Style::Push(){ for (auto style : stylesFloat) { ImGui::PushStyleVar(style.first, style.second); } for (auto style : stylesVec2) { ImGui::PushStyleVar(style.first, style.second); } for (auto color : colors) { ImGui::PushStyleColor(color.first, color.second); }}
void Style::Pop(){ ImGui::PopStyleColor(colors.size()); ImGui::PopStyleVar(stylesVec2.size()); ImGui::PopStyleVar(stylesFloat.size());}