Added configuration helper types.
This commit is contained in:
26
private/raid_test/frames/config.cpp
Normal file
26
private/raid_test/frames/config.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
|
||||
#include "raid_test/frames/config.hpp"
|
||||
|
||||
#include <imgui.h>
|
||||
#include "raid/config.hpp"
|
||||
#include "raid_test/application.hpp"
|
||||
|
||||
namespace raid_test
|
||||
{
|
||||
void renderConfig(bool& open)
|
||||
{
|
||||
if (!ImGui::Begin(CONFIG_TITLE, &open))
|
||||
{
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
||||
static constexpr const char* TEST_BOOL_PATH = "test/section/bool";
|
||||
bool testBool = gApplication.getConfig().getValue(TEST_BOOL_PATH).asBool();
|
||||
if (ImGui::Checkbox("Test Bool", &testBool)) {
|
||||
gApplication.getConfig().setValue(TEST_BOOL_PATH, testBool);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
14
private/raid_test/frames/config.hpp
Normal file
14
private/raid_test/frames/config.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined(RAID_TEST_FRAMES_CONFIG_HPP_INCLUDED)
|
||||
#define RAID_TEST_FRAMES_CONFIG_HPP_INCLUDED 1
|
||||
|
||||
namespace raid_test
|
||||
{
|
||||
inline constexpr const char* CONFIG_TITLE = "Config";
|
||||
|
||||
void renderConfig(bool& open);
|
||||
} // namespace raid_test
|
||||
|
||||
#endif // !defined(RAID_TEST_FRAMES_CONFIG_HPP_INCLUDED)
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
#include "raid_test/frames/data_table.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <random>
|
||||
#include <imgui.h>
|
||||
|
||||
Reference in New Issue
Block a user