add acept db file name
This commit is contained in:
parent
31e8f302ac
commit
30980423eb
@ -19,7 +19,7 @@ constexpr int numberOfFunc = 2;
|
|||||||
class Vapp
|
class Vapp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init();
|
void init(char* filename);
|
||||||
void update();
|
void update();
|
||||||
void draw();
|
void draw();
|
||||||
void deinit();
|
void deinit();
|
||||||
|
@ -11,7 +11,7 @@ const char select_user_id[] = "SELECT USER_ID FROM user_table GROUP BY USER_ID;"
|
|||||||
|
|
||||||
constexpr int sizeOfCanvas = 1000;
|
constexpr int sizeOfCanvas = 1000;
|
||||||
|
|
||||||
void Vapp::init()
|
void Vapp::init(char* filename)
|
||||||
{
|
{
|
||||||
bigTexture = LoadRenderTexture(sizeOfCanvas * 4, sizeOfCanvas * 4);
|
bigTexture = LoadRenderTexture(sizeOfCanvas * 4, sizeOfCanvas * 4);
|
||||||
treeTexture = LoadRenderTexture(sizeOfCanvas, sizeOfCanvas);
|
treeTexture = LoadRenderTexture(sizeOfCanvas, sizeOfCanvas);
|
||||||
@ -20,7 +20,7 @@ void Vapp::init()
|
|||||||
DnaManager::setUp(&manager, 0);
|
DnaManager::setUp(&manager, 0);
|
||||||
|
|
||||||
sql::init();
|
sql::init();
|
||||||
sql::open(DB_NAME, &db);
|
sql::open(filename, &db);
|
||||||
|
|
||||||
sqlite3_stmt *stmt;
|
sqlite3_stmt *stmt;
|
||||||
sql::prepare_v2(db, select_user_id, -1, &stmt, NULL);
|
sql::prepare_v2(db, select_user_id, -1, &stmt, NULL);
|
||||||
|
@ -2,18 +2,24 @@
|
|||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <rlImGui.h>
|
#include <rlImGui.h>
|
||||||
#include "Vapp.hpp"
|
#include "Vapp.hpp"
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int screenWidth = 1000;
|
int screenWidth = 1000;
|
||||||
int screenHeight = 1000;
|
int screenHeight = 1000;
|
||||||
|
|
||||||
|
if(argc != 2){
|
||||||
|
printf("MISING DB FILE\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Vapp app;
|
Vapp app;
|
||||||
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
||||||
InitWindow(screenWidth, screenHeight, "VIEW");
|
InitWindow(screenWidth, screenHeight, "VIEW");
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
rlImGuiSetup(true);
|
rlImGuiSetup(true);
|
||||||
app.init();
|
app.init(argv[1]);
|
||||||
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||||
|
|
||||||
while (!WindowShouldClose())
|
while (!WindowShouldClose())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user