#include "simple_mq.h" #include "utility.hpp" #include "variable_defs.h" #include #include #include using namespace simple_mq_singleton; extern GLFWwindow *main_window; void initialize_mq(); void load_config(); void initialize_cuda(); void initialize_main_window(); void cleanup(); void prepare_imgui_frame(); void handle_imgui_events(); bool is_capturing(); bool is_encoding(); void wait_camera_frames(); void process_camera_frames(); void render_main_window(); void generate_output_frame(); int main() { #ifndef NDEBUG spdlog::set_level(spdlog::level::trace); #endif // initialize many staffs initialize_mq(); initialize_cuda(); load_config(); initialize_main_window(); while (!glfwWindowShouldClose(main_window)) { RESET_TIMER; prepare_imgui_frame(); handle_imgui_events(); if (is_capturing()) { wait_camera_frames(); process_camera_frames(); if (is_encoding()) { generate_output_frame(); } } render_main_window(); } cleanup(); return 0; }