summaryrefslogtreecommitdiff
path: root/src/ui/ui_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/ui_log.cpp')
-rw-r--r--src/ui/ui_log.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/ui_log.cpp b/src/ui/ui_log.cpp
new file mode 100644
index 0000000..08a0a72
--- /dev/null
+++ b/src/ui/ui_log.cpp
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+#include "ui.hpp"
+#include "imgui.h"
+#include "log.hpp"
+#include "locales.hpp"
+
+void ui_draw_log()
+{
+ log* l = get_log();
+
+ for (int i = (int)l->history_length-1; i >= 0; i--)
+ {
+ u32 cursor = l->write_cursor - l->history_length + i;
+ if (cursor < 0) {
+ cursor = (l->write_cursor + i) % MAX_LEN_LOG_HISTORY;
+ }
+ ImGui::Text(l->history[cursor]);
+ }
+} \ No newline at end of file