diff --git a/ExampleModules.nix b/ExampleModules.nix index 3fa3d2d..0fa0cd8 100644 --- a/ExampleModules.nix +++ b/ExampleModules.nix @@ -27,6 +27,37 @@ }; + TestNotCurses = pkgs.stdenvNoCC.mkDerivation { + + name = "TestNotCurses"; + + src = ./.; + + nativeBuildInputs = with pkgs; [ + clang + ]; + + buildInputs = with pkgs; [ + notcurses + ]; + + buildPhase = '' + clang++ \ + modules/examples/TestNotCurses/src/*.cpp \ + -fpic -shared \ + -I src -I include \ + -Wall \ + -lnotcurses \ + -DTESTNOTCURSES_DYNAMIC \ + -o $name + ''; + + installPhase = '' + mkdir -p $out/bin + cp $name $out/bin + ''; + + }; Print = pkgs.stdenvNoCC.mkDerivation { name = "Print"; diff --git a/flake.nix b/flake.nix index 0ac8fed..435f674 100755 --- a/flake.nix +++ b/flake.nix @@ -88,6 +88,7 @@ -DRENDERER_OPENGL \ -DWINDOW_GLFW \ -DIMGUIMODULE_DYNAMIC \ + -DCUSTOMFONT=${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf \ -fpic -shared \ -I src -I include -I $imgui -I . \ -lGL -lglfw -lGLEW \ diff --git a/include/pch.hpp b/include/pch.hpp index 9738403..5edde1b 100644 --- a/include/pch.hpp +++ b/include/pch.hpp @@ -17,4 +17,7 @@ #include +#define STRINGIZE(x) #x +#define STRINGIZE_VALUE_OF(x) STRINGIZE(x) + #endif diff --git a/modules/ImguiModule/src/ImguiModule.cpp b/modules/ImguiModule/src/ImguiModule.cpp index 8a42ba2..8ff6dd4 100644 --- a/modules/ImguiModule/src/ImguiModule.cpp +++ b/modules/ImguiModule/src/ImguiModule.cpp @@ -7,6 +7,8 @@ #include +#include "pch.hpp" + ImguiModule::ImguiModule(Archimedes::App* a, void* h = nullptr) : Archimedes::Module(a, h) { name = "ImguiModule"; @@ -40,9 +42,12 @@ void ImguiModule::onLoad() { io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking - //io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows + //io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows - // Setup Dear ImGui style +#ifdef CUSTOMFONT + io.Fonts->AddFontFromFileTTF(STRINGIZE_VALUE_OF(CUSTOMFONT), 13.0f); +#endif + // Setup Dear ImGui style ImGui::StyleColorsDark(); //ImGui::StyleColorsLight(); diff --git a/modules/Networking/src/Networking.cpp b/modules/Networking/src/Networking.cpp new file mode 100644 index 0000000..e69de29 diff --git a/modules/Networking/src/Networking.h b/modules/Networking/src/Networking.h new file mode 100644 index 0000000..e69de29 diff --git a/modules/examples/Print/src/Print.h b/modules/examples/Print/src/Print.h index dbe93f1..21bcadb 100644 --- a/modules/examples/Print/src/Print.h +++ b/modules/examples/Print/src/Print.h @@ -6,8 +6,6 @@ class Print : public Archimedes::Module { Print(Archimedes::App*, void*); ~Print(); void run(); - void onLoad() {} - }; #ifdef PRINT_DYNAMIC diff --git a/modules/examples/TestNotCurses/src/TestNotCurses.cpp b/modules/examples/TestNotCurses/src/TestNotCurses.cpp new file mode 100644 index 0000000..8340146 --- /dev/null +++ b/modules/examples/TestNotCurses/src/TestNotCurses.cpp @@ -0,0 +1,17 @@ +#include "TestNotCurses.h" + +TestNotCurses::TestNotCurses(Archimedes::App* a, void* h) : Archimedes::Module(a, h) { + name = "TestNotCurses"; +} + +TestNotCurses::~TestNotCurses() { + +} + +void TestNotCurses::onLoad() { + +} + +void TestNotCurses::run() { + +} diff --git a/modules/examples/TestNotCurses/src/TestNotCurses.h b/modules/examples/TestNotCurses/src/TestNotCurses.h new file mode 100644 index 0000000..94792a6 --- /dev/null +++ b/modules/examples/TestNotCurses/src/TestNotCurses.h @@ -0,0 +1,17 @@ +#include "Archimedes.h" + +#include + +class TestNotCurses : public Archimedes::Module { + + public: + TestNotCurses(Archimedes::App*, void*); + ~TestNotCurses(); + void run(); + void onLoad(); +}; + +#ifdef TESTNOTCURSES_DYNAMIC +#define MODULE_TYPE TestNotCurses +#include "endModule.h" +#endif