Compare commits
No commits in common. "207e930b1c41874d36ac48d1d02aad49f15f2229" and "8619918faccbe830032de5f0133c511bb4f59f48" have entirely different histories.
207e930b1c
...
8619918fac
@ -51,7 +51,7 @@ target_include_directories(server PRIVATE server/inc shared/inc)
|
|||||||
|
|
||||||
add_executable(view
|
add_executable(view
|
||||||
view/src/main.cpp
|
view/src/main.cpp
|
||||||
view/src/Vapp.cpp
|
|
||||||
shared/src/canvas/BackGround.cpp
|
shared/src/canvas/BackGround.cpp
|
||||||
shared/src/canvas/BackGroundColors.cpp
|
shared/src/canvas/BackGroundColors.cpp
|
||||||
shared/src/canvas/Canvas.cpp
|
shared/src/canvas/Canvas.cpp
|
||||||
|
@ -111,16 +111,17 @@ void checker()
|
|||||||
if (type != SQL_NULL)
|
if (type != SQL_NULL)
|
||||||
{
|
{
|
||||||
user_table_id = sql::column_int64(get_user_table_id_stmt, 0);
|
user_table_id = sql::column_int64(get_user_table_id_stmt, 0);
|
||||||
sql::bind_int64(rem_like_w_user_table_id_stmt, 1, user_table_id);
|
|
||||||
sql::step(rem_like_w_user_table_id_stmt);
|
|
||||||
sql::reset(rem_like_w_user_table_id_stmt);
|
|
||||||
|
|
||||||
sql::bind_int64(rem_user_table_id_stmt, 1, user_table_id);
|
|
||||||
sql::step(rem_user_table_id_stmt);
|
|
||||||
sql::reset(rem_user_table_id_stmt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql::reset(get_user_table_id_stmt);
|
sql::reset(get_user_table_id_stmt);
|
||||||
|
|
||||||
|
sql::bind_int64(rem_like_w_user_table_id_stmt, 1, user_table_id);
|
||||||
|
sql::step(rem_like_w_user_table_id_stmt);
|
||||||
|
sql::reset(rem_like_w_user_table_id_stmt);
|
||||||
|
|
||||||
|
sql::bind_int64(rem_user_table_id_stmt, 1, user_table_id);
|
||||||
|
sql::step(rem_user_table_id_stmt);
|
||||||
|
sql::reset(rem_user_table_id_stmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_gen)
|
if (new_gen)
|
||||||
|
@ -14,7 +14,7 @@ const char get_unchecked[] = "SELECT USER_ID FROM user_table WHERE CHECKED = 0;"
|
|||||||
|
|
||||||
const char get_gen[] = "SELECT lt.HASH, lt.POS, lt.LIKED FROM like_table lt JOIN user_table ut ON lt.USER_TABLE_ID = ut.ID WHERE ut.USER_ID = ? AND ut.GEN = ? ORDER BY lt.POS ASC;";
|
const char get_gen[] = "SELECT lt.HASH, lt.POS, lt.LIKED FROM like_table lt JOIN user_table ut ON lt.USER_TABLE_ID = ut.ID WHERE ut.USER_ID = ? AND ut.GEN = ? ORDER BY lt.POS ASC;";
|
||||||
|
|
||||||
const char get_user_table_id[] = "SELECT ID FROM user_table WHERE USER_ID = ? AND GEN >= ?;";
|
const char get_user_table_id[] = "SELECT ID FROM user_table WHERE USER_ID = ? AND GEN = ?;";
|
||||||
|
|
||||||
const char rem_like_w_user_table_id[] = "DELETE FROM like_table WHERE USER_TABLE_ID = ?;";
|
const char rem_like_w_user_table_id[] = "DELETE FROM like_table WHERE USER_TABLE_ID = ?;";
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
#include "sql.hpp"
|
|
||||||
|
|
||||||
class Vapp
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void init();
|
|
||||||
void update();
|
|
||||||
void draw();
|
|
||||||
void deinit();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool showDemoWindow;
|
|
||||||
sqlite3 *db;
|
|
||||||
};
|
|
@ -1,45 +0,0 @@
|
|||||||
#include <cinttypes>
|
|
||||||
|
|
||||||
#include "Vapp.hpp"
|
|
||||||
#include "values/Dna.hpp"
|
|
||||||
|
|
||||||
#include <rlImGui.h>
|
|
||||||
#include <imgui.h>
|
|
||||||
#include <raylib.h>
|
|
||||||
|
|
||||||
void Vapp::init()
|
|
||||||
{
|
|
||||||
sql::init();
|
|
||||||
sql::open(DB_NAME, &db);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Vapp::update()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Vapp::draw()
|
|
||||||
{
|
|
||||||
ClearBackground(RAYWHITE);
|
|
||||||
|
|
||||||
ImGui::DockSpaceOverViewport(0, NULL, ImGuiDockNodeFlags_PassthruCentralNode);
|
|
||||||
|
|
||||||
if (ImGui::BeginMainMenuBar())
|
|
||||||
{
|
|
||||||
if (ImGui::BeginMenu("Window"))
|
|
||||||
{
|
|
||||||
if (ImGui::MenuItem("Demo Window", nullptr, showDemoWindow))
|
|
||||||
showDemoWindow = !showDemoWindow;
|
|
||||||
|
|
||||||
ImGui::EndMenu();
|
|
||||||
}
|
|
||||||
ImGui::EndMainMenuBar();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showDemoWindow)
|
|
||||||
ImGui::ShowDemoWindow(&showDemoWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Vapp::deinit()
|
|
||||||
{
|
|
||||||
sql::close(db);
|
|
||||||
}
|
|
@ -1,34 +1,51 @@
|
|||||||
|
|
||||||
#include <raylib.h>
|
#include <raylib.h>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <rlImGui.h>
|
#include <rlImGui.h>
|
||||||
#include "Vapp.hpp"
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int screenWidth = 800;
|
int screenWidth = 800;
|
||||||
int screenHeight = 800;
|
int screenHeight = 800;
|
||||||
|
|
||||||
Vapp app;
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
InitWindow(screenWidth, screenHeight, "VIEW");
|
InitWindow(screenWidth, screenHeight, "VIEW");
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
rlImGuiSetup(true);
|
rlImGuiSetup(true);
|
||||||
app.init();
|
|
||||||
bool showDemoWindow = true;
|
bool showDemoWindow = true;
|
||||||
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||||
|
|
||||||
while (!WindowShouldClose())
|
while (!WindowShouldClose())
|
||||||
{
|
{
|
||||||
app.update();
|
|
||||||
BeginDrawing();
|
BeginDrawing();
|
||||||
rlImGuiBegin();
|
rlImGuiBegin();
|
||||||
app.draw();
|
|
||||||
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
|
ImGui::DockSpaceOverViewport(0, NULL, ImGuiDockNodeFlags_PassthruCentralNode);
|
||||||
|
|
||||||
|
if (ImGui::BeginMainMenuBar())
|
||||||
|
{
|
||||||
|
if (ImGui::BeginMenu("Window"))
|
||||||
|
{
|
||||||
|
if (ImGui::MenuItem("Demo Window", nullptr, showDemoWindow))
|
||||||
|
showDemoWindow = !showDemoWindow;
|
||||||
|
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
ImGui::EndMainMenuBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showDemoWindow)
|
||||||
|
ImGui::ShowDemoWindow(&showDemoWindow);
|
||||||
|
|
||||||
|
|
||||||
rlImGuiEnd();
|
rlImGuiEnd();
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
app.deinit();
|
|
||||||
rlImGuiShutdown();
|
rlImGuiShutdown();
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user