summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-21 04:18:06 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-21 04:18:06 +0100
commiteabcbed30df8ff5fdb63b5a4f844d01f436f9a2d (patch)
tree02e4bb4bad1381e61402c68592fb5cff3f53dfbf /editor
parent91467e77de6ac3acff4326f4cd9d5a4390ccc3ce (diff)
wip inspector stuff
Diffstat (limited to 'editor')
-rw-r--r--editor/inspect.cpp24
-rw-r--r--editor/inspect.hpp9
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