diff options
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/inspect.cpp | 24 | ||||
| -rw-r--r-- | editor/inspect.hpp | 9 |
2 files changed, 33 insertions, 0 deletions
diff --git a/editor/inspect.cpp b/editor/inspect.cpp new file mode 100644 index 00000000..c1f0840e --- /dev/null +++ b/editor/inspect.cpp @@ -0,0 +1,24 @@ +#include "inspect.hpp" +#include "entity/accessor.hpp" +#include <imgui.h> + +namespace floormat { + +using namespace entities; + +template<typename T> +static void do_inspect_field(const void* datum, const entities::erased_accessor& accessor) +{ + auto range = accessor.get_range(datum); + auto enabled = accessor.is_enabled(datum); + auto [min, max] = range.convert<T>(); + + +} + +template<> void inspect_field<int>(const void* datum, const entities::erased_accessor& accessor) +{ + do_inspect_field<int>(datum, accessor); +} + +} // namespace floormat diff --git a/editor/inspect.hpp b/editor/inspect.hpp new file mode 100644 index 00000000..feca67d1 --- /dev/null +++ b/editor/inspect.hpp @@ -0,0 +1,9 @@ +#pragma once +//#include "entity/accessor.hpp" +namespace floormat::entities { struct erased_accessor; } + +namespace floormat { + +template<typename T> void inspect_field(const void* datum, const entities::erased_accessor& accessor); + +} // namespace floormat |
