diff --git a/.gitmodules b/.gitmodules index 7a2f01409b36719990f5fcf6cdf9d721c29325c5..6a9e6efb6625985961c4b004254806083e458ea6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,4 +7,7 @@ [submodule "libs/cpp_starter_project"] path = libs/cpp_starter_project url = https://github.com/armin-co/cpp_starter_project.git - # \ No newline at end of file + # +[submodule "libs/spdlog"] + path = libs/spdlog + url = https://github.com/gabime/spdlog diff --git a/CMakeLists.txt b/CMakeLists.txt index 526401edd27d286f50fa3d589c6929c353527d4a..a20287e92c712784399c637bf787ec18bcf75293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,9 @@ if(APPLE) endif() +# logging library spdlog +add_subdirectory(libs/spdlog) + # Add qpong lib for core qpong functionality add_subdirectory(qpong_core) include_directories(qpong_core) diff --git a/README.md b/README.md index 2a2e31e28f742baec3a3ada1a00a3f0fedbe4f60..65562e216e241c186b2772df00c72d19a4100162 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,11 @@ Dependencies: ```` mkdir build && cd build -cmake ../ +cmake .. -make +make -j6 -./src/qpong.app +./gtk_qpong_app/qpong.app ```` diff --git a/gtk_qpong_app/CMakeLists.txt b/gtk_qpong_app/CMakeLists.txt index 9b1e9a89b9ff6670ddf2c9016ac7a40ec67956b5..714aeac509f5a379f47a0476bc1f2f7eb0e69e82 100644 --- a/gtk_qpong_app/CMakeLists.txt +++ b/gtk_qpong_app/CMakeLists.txt @@ -7,6 +7,7 @@ link_directories(${GTKMM_LIBRARY_DIRS}) # get all GTKMM dependencies and configuration include_directories(${GTKMM_INCLUDE_DIRS}) + # create the application add_executable( qpong.app main.cpp @@ -20,6 +21,7 @@ find_package(Threads) # link all necessary libs to the target target_link_libraries( qpong.app qpong_core + spdlog ${CMAKE_THREAD_LIBS_INIT} ${GTKMM_LIBRARIES} fftw3 diff --git a/gtk_qpong_app/main.cpp b/gtk_qpong_app/main.cpp index 80c9d8214cc2e71eb9fb687bc5123442c26f6832..14de39ca7db4112fdb178b1c5f08958fbefb1bb1 100644 --- a/gtk_qpong_app/main.cpp +++ b/gtk_qpong_app/main.cpp @@ -6,6 +6,8 @@ /// #include <iostream> +#include <thread> +#include <spdlog/spdlog.h> #include <gtkmm.h> @@ -15,7 +17,21 @@ /// int main(int argc, char* argv[]) { - std::cout << "QPong -- starting" << std::endl; + spdlog::info("QPong - Let's play quantum pong ;)"); + + spdlog::info("How To:"); + spdlog::info("The bats of player one and two must be moved manually. They can be moved eather up or down."); + spdlog::info("Controls player 1:"); + spdlog::info(" up: Q"); + spdlog::info(" down: A"); + spdlog::info("Controls player 2:"); + spdlog::info(" up: Ü"); + spdlog::info(" down: Ö"); + std::cout << std::endl; + spdlog::info("starting in two seconds - get ready!"); + spdlog::info("two restart the game: press 'enter', the 'space bar' or click the button 'Initialise Paritcle' with the mouse pointer."); + std::this_thread::sleep_for(std::chrono::seconds{2}); + auto app = Gtk::Application::create(argc, argv, "de.armin-co.qpong"); QWindow window; diff --git a/libs/spdlog b/libs/spdlog new file mode 160000 index 0000000000000000000000000000000000000000..9799ecac6a0b64df16f9c6e0e8ebcedbd22d8432 --- /dev/null +++ b/libs/spdlog @@ -0,0 +1 @@ +Subproject commit 9799ecac6a0b64df16f9c6e0e8ebcedbd22d8432 diff --git a/qpong_core/CMakeLists.txt b/qpong_core/CMakeLists.txt index a5ab638a2d447c5e2578bd18bd557724fc289ffb..0776bfa3c17559034875b4a2fa984f4d1396b118 100644 --- a/qpong_core/CMakeLists.txt +++ b/qpong_core/CMakeLists.txt @@ -6,13 +6,3 @@ add_library( ImageBuffer.cpp Player.cpp ) - -# find_package(Threads) - -# target_link_libraries( -# qpong_core -# ${CMAKE_THREAD_LIBS_INIT} -# fftw3 -# fftw3_omp -# m -# ) \ No newline at end of file