From 207e930b1c41874d36ac48d1d02aad49f15f2229 Mon Sep 17 00:00:00 2001 From: Nikola Petrov Date: Mon, 3 Feb 2025 16:11:32 +0100 Subject: [PATCH] add sqlite to view --- view/inc/Vapp.hpp | 2 ++ view/src/Vapp.cpp | 4 +++- view/src/main.cpp | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/view/inc/Vapp.hpp b/view/inc/Vapp.hpp index e11900c..7690acb 100644 --- a/view/inc/Vapp.hpp +++ b/view/inc/Vapp.hpp @@ -1,4 +1,5 @@ +#include "sql.hpp" class Vapp { @@ -10,4 +11,5 @@ public: private: bool showDemoWindow; + sqlite3 *db; }; \ No newline at end of file diff --git a/view/src/Vapp.cpp b/view/src/Vapp.cpp index c4d46e8..2e53485 100644 --- a/view/src/Vapp.cpp +++ b/view/src/Vapp.cpp @@ -9,7 +9,8 @@ void Vapp::init() { - // TraceLog(LOG_INFO, "%d / %d = %d", sizeof(Dna), sizeof(int64_t), sizeof(Dna) / sizeof(int64_t)); + sql::init(); + sql::open(DB_NAME, &db); } void Vapp::update() @@ -40,4 +41,5 @@ void Vapp::draw() void Vapp::deinit() { + sql::close(db); } diff --git a/view/src/main.cpp b/view/src/main.cpp index 461643c..f237b22 100644 --- a/view/src/main.cpp +++ b/view/src/main.cpp @@ -1,4 +1,3 @@ - #include #include #include