From dbd113deabffeaeec58fb630b45f89e8e70312f7 Mon Sep 17 00:00:00 2001 From: Jason Ly Date: Sun, 28 Dec 2025 22:43:26 -0500 Subject: [PATCH] create build project for windows --- README.md | 4 +++- premake5.lua | 10 +++++++++ src/joomer-efsw-file-monitoring.cpp | 32 +---------------------------- 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 0f12bcc..9145d67 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,10 @@ Run **x64 Native Tools Command Prompt for VS 2022** mkdir learndir cd learndir git clone https://git.indoodle.com/jason/joomer-ftxui-file-monitoring.git -cd joomer-ftxui-file-monitoring +premake5 vs2022 +cd joomer-ftxui-file-monitoring/make/windows msbuild joomer-ftxui-file-monitoring.vcxproj /t:Build /p:Configuration=Debug /p:Platform=x64 +cd ../.. bin\Debug\joomer-ftxui-file-monitoring.exe ``` diff --git a/premake5.lua b/premake5.lua index 4d6062d..b1f37a8 100644 --- a/premake5.lua +++ b/premake5.lua @@ -211,6 +211,16 @@ workspace "efsw" includedirs { "include", "src" } conf_links() + filter "configurations:debug" + defines { "DEBUG" } + symbols "On" + conf_warnings() + + filter "configurations:release" + defines { "NDEBUG" } + optimize "On" + conf_warnings() + project "efsw-test-stdc" kind "ConsoleApp" language "C" diff --git a/src/joomer-efsw-file-monitoring.cpp b/src/joomer-efsw-file-monitoring.cpp index 0cc57db..004950c 100644 --- a/src/joomer-efsw-file-monitoring.cpp +++ b/src/joomer-efsw-file-monitoring.cpp @@ -49,37 +49,7 @@ class UpdateListener : public efsw::FileWatchListener { ( oldFilename.empty() ? "" : "from file " + oldFilename + " to " ) + filename + ") has event " << getActionName( action ) << std::endl; - - // Check if a file was added (dropped) - /*if (action == efsw::Actions::Add) { - int width, height, channels; - // Reconstruct the full path - std::string fullPath = dir + filename; - - // Add this delay - efsw::System::sleep(500); - - std::cout << "File dropped: " << filename << std::endl; - std::cout << "Full path: " << fullPath << std::endl; - unsigned char* image_data = stbi_load(fullPath.c_str(), &width, &height, &channels, 0); - if (image_data) - { - std::cout << "DEBUG: Image loaded successfully. Flipping..." << std::endl; - flip_image_vertically(image_data, width, height, channels); - // --- Save the flipped image to a new temporary file --- - std::string flipped_filename = "flipped_" + filename; - stbi_write_jpg(flipped_filename.c_str(), width, height, channels, image_data, 100); // Quality 100 - stbi_image_free(image_data); - - STOP = true; - } - else - { - // This will tell you if the path was wrong or the file was locked - std::cout << "DEBUG: stbi_load failed for: " << fullPath << std::endl; - std::cout << "Reason: " << stbi_failure_reason() << std::endl; - } - }*/ + if (action == efsw::Actions::Add || action == efsw::Actions::Modified) { // 1. Ignore the event if it's a file WE created if (filename.find("flipped_") == 0) {