diff --git a/Rgb2Hires_PC/CMakeLists.txt b/Rgb2Hires_PC/CMakeLists.txt index f67693b..a0b6395 100644 --- a/Rgb2Hires_PC/CMakeLists.txt +++ b/Rgb2Hires_PC/CMakeLists.txt @@ -31,6 +31,7 @@ else() find_package(ImageMagick 6.9 EXACT REQUIRED COMPONENTS Magick++ ) endif(WIN32) find_package(SDL2 REQUIRED) +find_package(Threads REQUIRED) # directories set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin/debug) @@ -55,9 +56,12 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${ImageMagick_INCLUDE_DIRS} $ # Application Picture add_executable(Picture src/App_Picture.cpp) +if(NOT WIN32) + set_target_properties(Picture PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread) +endif() target_compile_definitions(Picture PUBLIC MAGICKCORE_QUANTUM_DEPTH=16 MAGICKCORE_HDRI_ENABLE=0) target_include_directories(Picture PRIVATE src ${ImageMagick_INCLUDE_DIRS}) -target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${SDL2_LIBRARIES} ${PROJECT_NAME}) +target_link_libraries(Picture ${ImageMagick_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${PROJECT_NAME} ${SDL2_LIBRARIES}) # SDL2 must be at the end set_property(TARGET Picture PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}) # Application Tile diff --git a/Rgb2Hires_PC/src/Display.cpp b/Rgb2Hires_PC/src/Display.cpp index e7b9ecd..2a46e73 100644 --- a/Rgb2Hires_PC/src/Display.cpp +++ b/Rgb2Hires_PC/src/Display.cpp @@ -2,6 +2,8 @@ #include #include #include + +#define SDL_MAIN_HANDLED #include #include "Picture.h" @@ -175,7 +177,7 @@ namespace RgbToHires //=========================================================================== -// RGB videocards HGR + // RGB videocards HGR //! @details Adapted from AppleWin: https://github.com/AppleWin/AppleWin //! A 14-dot block is used to draw a 7-pixel block (2 * 3.5-pixel blocks) diff --git a/Rgb2Hires_PC/src/Display.h b/Rgb2Hires_PC/src/Display.h index c06a9ef..3042445 100644 --- a/Rgb2Hires_PC/src/Display.h +++ b/Rgb2Hires_PC/src/Display.h @@ -19,6 +19,7 @@ #define _DISPLAY_H_ #include +#include #include "ImageQuantized.h" #include "HiRes.h"