From afed109c74efb5de38eee38811d77ed9f1b0d70a Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 13 Apr 2025 14:21:26 -0500 Subject: [PATCH] start TestNotCurses --- .../examples/TestNotCurses/src/TestNotCurses.cpp | 13 ++++++++++++- modules/examples/TestNotCurses/src/TestNotCurses.h | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/examples/TestNotCurses/src/TestNotCurses.cpp b/modules/examples/TestNotCurses/src/TestNotCurses.cpp index 8340146..aed68c8 100644 --- a/modules/examples/TestNotCurses/src/TestNotCurses.cpp +++ b/modules/examples/TestNotCurses/src/TestNotCurses.cpp @@ -5,13 +5,24 @@ TestNotCurses::TestNotCurses(Archimedes::App* a, void* h) : Archimedes::Module(a } TestNotCurses::~TestNotCurses() { - + notcurses_stop(ncInstance); } void TestNotCurses::onLoad() { + setlocale(LC_ALL, ""); + + notcurses_options opts; + + ncInstance = notcurses_init(&opts, NULL); + + if(!ncInstance) { + app->stopModule(getName()); + return; + } } void TestNotCurses::run() { + notcurses_render(ncInstance); } diff --git a/modules/examples/TestNotCurses/src/TestNotCurses.h b/modules/examples/TestNotCurses/src/TestNotCurses.h index 94792a6..bebde20 100644 --- a/modules/examples/TestNotCurses/src/TestNotCurses.h +++ b/modules/examples/TestNotCurses/src/TestNotCurses.h @@ -9,6 +9,8 @@ class TestNotCurses : public Archimedes::Module { ~TestNotCurses(); void run(); void onLoad(); + private: + notcurses* ncInstance; }; #ifdef TESTNOTCURSES_DYNAMIC