Skip to content
Snippets Groups Projects
Commit 68655c48 authored by Armin Co's avatar Armin Co
Browse files

Added logging with spdlog

cleaning up
parent 3bdecb96
Branches
Tags
No related merge requests found
...@@ -8,3 +8,6 @@ ...@@ -8,3 +8,6 @@
path = libs/cpp_starter_project path = libs/cpp_starter_project
url = https://github.com/armin-co/cpp_starter_project.git url = https://github.com/armin-co/cpp_starter_project.git
# #
[submodule "libs/spdlog"]
path = libs/spdlog
url = https://github.com/gabime/spdlog
...@@ -26,6 +26,9 @@ if(APPLE) ...@@ -26,6 +26,9 @@ if(APPLE)
endif() endif()
# logging library spdlog
add_subdirectory(libs/spdlog)
# Add qpong lib for core qpong functionality # Add qpong lib for core qpong functionality
add_subdirectory(qpong_core) add_subdirectory(qpong_core)
include_directories(qpong_core) include_directories(qpong_core)
......
...@@ -21,11 +21,11 @@ Dependencies: ...@@ -21,11 +21,11 @@ Dependencies:
```` ````
mkdir build && cd build mkdir build && cd build
cmake ../ cmake ..
make make -j6
./src/qpong.app ./gtk_qpong_app/qpong.app
```` ````
......
...@@ -7,6 +7,7 @@ link_directories(${GTKMM_LIBRARY_DIRS}) ...@@ -7,6 +7,7 @@ link_directories(${GTKMM_LIBRARY_DIRS})
# get all GTKMM dependencies and configuration # get all GTKMM dependencies and configuration
include_directories(${GTKMM_INCLUDE_DIRS}) include_directories(${GTKMM_INCLUDE_DIRS})
# create the application # create the application
add_executable( qpong.app add_executable( qpong.app
main.cpp main.cpp
...@@ -20,6 +21,7 @@ find_package(Threads) ...@@ -20,6 +21,7 @@ find_package(Threads)
# link all necessary libs to the target # link all necessary libs to the target
target_link_libraries( qpong.app target_link_libraries( qpong.app
qpong_core qpong_core
spdlog
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
${GTKMM_LIBRARIES} ${GTKMM_LIBRARIES}
fftw3 fftw3
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
/// ///
#include <iostream> #include <iostream>
#include <thread>
#include <spdlog/spdlog.h>
#include <gtkmm.h> #include <gtkmm.h>
...@@ -15,7 +17,21 @@ ...@@ -15,7 +17,21 @@
/// ///
int main(int argc, char* argv[]) 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"); auto app = Gtk::Application::create(argc, argv, "de.armin-co.qpong");
QWindow window; QWindow window;
......
Subproject commit 9799ecac6a0b64df16f9c6e0e8ebcedbd22d8432
...@@ -6,13 +6,3 @@ add_library( ...@@ -6,13 +6,3 @@ add_library(
ImageBuffer.cpp ImageBuffer.cpp
Player.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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment