create build project for windows
This commit is contained in:
parent
39473834cc
commit
dbd113deab
@ -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
|
||||
```
|
||||
|
||||
|
||||
10
premake5.lua
10
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"
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user