A setting manager using INI files and dear ImGui.
#include "Veridian.h"
#include "imgui.h"
void MyRenderLoop()
{
static float MyFloat = 0.f;
static ImVec4 MyColor = ImVec4;
static bool Registered = false;
if (!Registered)
{
Veridian::InitContext("MySettings.ini");
// Section Internal setting name User-facing name Type Value
Veridian::Export("Floats", "MyFloat", "Example float", Veridian::VSettingType::VFloat, &MyFloat);
Veridian::Export("Colors", "MyColor", "Example color", Veridian::VSettingType::VVec4, &MyColor);
}
ImGui::Begin("Veridian settings");
Veridian::RenderAll();
ImGui::End();
}
If (for whatever reason), the setting is invalid (nullptr was registered as setting, or invalid setting type), then Veridian will handle both cases properly: