From 26734b479f13e20398ac8f6ef19ae7e8fdf97ec7 Mon Sep 17 00:00:00 2001 From: marcnoon Date: Sun, 8 Sep 2024 10:12:26 -0700 Subject: [PATCH 1/3] Update files include include and src folders for cmake compatability --- BasicGameEngine/BasicGameEngine.vcxproj | 30 ++++-------------- BasicGameEngine/RCa18080 | Bin 0 -> 7234 bytes BasicGameEngine/RCb18080 | Bin 0 -> 7234 bytes .../{ => include}/BasicGameEngine.h | 2 +- .../{ => include}/InterprocessComm.h | 0 .../{ => include}/InterprocessCommMgr.h | 0 .../{ => include}/SharedMemoryData.h | 0 BasicGameEngine/{ => include}/StatusBar.h | 0 BasicGameEngine/{ => include}/StatusBarMgr.h | 0 BasicGameEngine/{ => include}/TaskBarMgr.h | 0 BasicGameEngine/{ => include}/UserPrivilege.h | 0 .../{ => include}/UserPrivilegeMgr.h | 0 BasicGameEngine/{ => include}/WindowMutex.h | 0 .../{ => include}/WindowMutexMgr.h | 0 BasicGameEngine/{ => include}/framework.h | 2 +- BasicGameEngine/{ => src}/BasicGameEngine.cpp | 2 +- .../{ => src}/InterprocessComm.cpp | 0 .../{ => src}/InterprocessCommMgr.cpp | 0 BasicGameEngine/{ => src}/StatusBar.cpp | 0 BasicGameEngine/{ => src}/StatusBarMgr.cpp | 0 BasicGameEngine/{ => src}/TaskBarMgr.cpp | 2 +- BasicGameEngine/{ => src}/UserPrivilege.cpp | 0 .../{ => src}/UserPrivilegeMgr.cpp | 0 BasicGameEngine/{ => src}/WindowMutex.cpp | 0 BasicGameEngine/{ => src}/WindowMutexMgr.cpp | 0 25 files changed, 10 insertions(+), 28 deletions(-) create mode 100644 BasicGameEngine/RCa18080 create mode 100644 BasicGameEngine/RCb18080 rename BasicGameEngine/{ => include}/BasicGameEngine.h (91%) rename BasicGameEngine/{ => include}/InterprocessComm.h (100%) rename BasicGameEngine/{ => include}/InterprocessCommMgr.h (100%) rename BasicGameEngine/{ => include}/SharedMemoryData.h (100%) rename BasicGameEngine/{ => include}/StatusBar.h (100%) rename BasicGameEngine/{ => include}/StatusBarMgr.h (100%) rename BasicGameEngine/{ => include}/TaskBarMgr.h (100%) rename BasicGameEngine/{ => include}/UserPrivilege.h (100%) rename BasicGameEngine/{ => include}/UserPrivilegeMgr.h (100%) rename BasicGameEngine/{ => include}/WindowMutex.h (100%) rename BasicGameEngine/{ => include}/WindowMutexMgr.h (100%) rename BasicGameEngine/{ => include}/framework.h (93%) rename BasicGameEngine/{ => src}/BasicGameEngine.cpp (99%) rename BasicGameEngine/{ => src}/InterprocessComm.cpp (100%) rename BasicGameEngine/{ => src}/InterprocessCommMgr.cpp (100%) rename BasicGameEngine/{ => src}/StatusBar.cpp (100%) rename BasicGameEngine/{ => src}/StatusBarMgr.cpp (100%) rename BasicGameEngine/{ => src}/TaskBarMgr.cpp (95%) rename BasicGameEngine/{ => src}/UserPrivilege.cpp (100%) rename BasicGameEngine/{ => src}/UserPrivilegeMgr.cpp (100%) rename BasicGameEngine/{ => src}/WindowMutex.cpp (100%) rename BasicGameEngine/{ => src}/WindowMutexMgr.cpp (100%) diff --git a/BasicGameEngine/BasicGameEngine.vcxproj b/BasicGameEngine/BasicGameEngine.vcxproj index 09c6396..a90e5f2 100644 --- a/BasicGameEngine/BasicGameEngine.vcxproj +++ b/BasicGameEngine/BasicGameEngine.vcxproj @@ -76,6 +76,7 @@ true WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) true + $(ProjectDir)\include Windows @@ -104,6 +105,7 @@ true _DEBUG;_WINDOWS;%(PreprocessorDefinitions) true + $(ProjectDir)\include Windows @@ -127,32 +129,12 @@ - - - - - - - - - - - - - - + + - - - - - - - - - - + + diff --git a/BasicGameEngine/RCa18080 b/BasicGameEngine/RCa18080 new file mode 100644 index 0000000000000000000000000000000000000000..4ff4da5c8a7fb55082ea352224d4ef8993ca1a3a GIT binary patch literal 7234 zcmdT}Yfs}w6uqA-^*^{qTJ5SR#Q_5JOBE6l(DI0IU_nAcX&`JQASjP+EA_|soO?a7 z9Xn3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p1kM@}T*2mbG zZHjk_#$d5d`)U&(Tu3QH-APymufqdRxr{eI4;tsXyjq;oH=%1Cy3o$72dR4v(gdHf5*UCJsU94USz|313q50D6VD(rglZ`eDaoxjH%vr3k z&ExdWVkv7_`wjIGcgIh#IIE|R;6>KW)U^x?kTZ%TDoaJ>auRW6?)Dm*Lqj=6E@37i z2f9kh$Mfgu%zUP10T^NvE7H=t8WT3B;j#(sSmC#3GGvmc_r!J#?*@t!5$316nrF}B@GV~&Il2x*dvUzK#a}>wrF&j~w zu$6`+g zQN^^qk|$^NUAzvn7ZLT}#e0B^Xgh)T6u%+x$_&qQe8y=9H5&Il$p}uz+BR}9dsz>W zrFj;{%IHw5Qud@{+SLceb(V20YonqQmiR=3bq#CL7VfOc+EGpHIGguHm6pwx diff --git a/BasicGameEngine/BasicGameEngine.cpp b/BasicGameEngine/src/BasicGameEngine.cpp similarity index 99% rename from BasicGameEngine/BasicGameEngine.cpp rename to BasicGameEngine/src/BasicGameEngine.cpp index 80ced46..5be6bc3 100644 --- a/BasicGameEngine/BasicGameEngine.cpp +++ b/BasicGameEngine/src/BasicGameEngine.cpp @@ -7,7 +7,7 @@ #include #include #include // For std::mutex and std::lock_guard -#include "resource.h" +#include "..\resource.h" #include #include "TaskBarMgr.h" #include "WindowMutexMgr.h" diff --git a/BasicGameEngine/InterprocessComm.cpp b/BasicGameEngine/src/InterprocessComm.cpp similarity index 100% rename from BasicGameEngine/InterprocessComm.cpp rename to BasicGameEngine/src/InterprocessComm.cpp diff --git a/BasicGameEngine/InterprocessCommMgr.cpp b/BasicGameEngine/src/InterprocessCommMgr.cpp similarity index 100% rename from BasicGameEngine/InterprocessCommMgr.cpp rename to BasicGameEngine/src/InterprocessCommMgr.cpp diff --git a/BasicGameEngine/StatusBar.cpp b/BasicGameEngine/src/StatusBar.cpp similarity index 100% rename from BasicGameEngine/StatusBar.cpp rename to BasicGameEngine/src/StatusBar.cpp diff --git a/BasicGameEngine/StatusBarMgr.cpp b/BasicGameEngine/src/StatusBarMgr.cpp similarity index 100% rename from BasicGameEngine/StatusBarMgr.cpp rename to BasicGameEngine/src/StatusBarMgr.cpp diff --git a/BasicGameEngine/TaskBarMgr.cpp b/BasicGameEngine/src/TaskBarMgr.cpp similarity index 95% rename from BasicGameEngine/TaskBarMgr.cpp rename to BasicGameEngine/src/TaskBarMgr.cpp index c0051bd..06a0f08 100644 --- a/BasicGameEngine/TaskBarMgr.cpp +++ b/BasicGameEngine/src/TaskBarMgr.cpp @@ -1,5 +1,5 @@ #include "TaskBarMgr.h" -#include "resource.h" // Include your specific resource header file +#include "..\resource.h" // Include your specific resource header file #include "StatusBarMgr.h" TaskBarMgr::TaskBarMgr() diff --git a/BasicGameEngine/UserPrivilege.cpp b/BasicGameEngine/src/UserPrivilege.cpp similarity index 100% rename from BasicGameEngine/UserPrivilege.cpp rename to BasicGameEngine/src/UserPrivilege.cpp diff --git a/BasicGameEngine/UserPrivilegeMgr.cpp b/BasicGameEngine/src/UserPrivilegeMgr.cpp similarity index 100% rename from BasicGameEngine/UserPrivilegeMgr.cpp rename to BasicGameEngine/src/UserPrivilegeMgr.cpp diff --git a/BasicGameEngine/WindowMutex.cpp b/BasicGameEngine/src/WindowMutex.cpp similarity index 100% rename from BasicGameEngine/WindowMutex.cpp rename to BasicGameEngine/src/WindowMutex.cpp diff --git a/BasicGameEngine/WindowMutexMgr.cpp b/BasicGameEngine/src/WindowMutexMgr.cpp similarity index 100% rename from BasicGameEngine/WindowMutexMgr.cpp rename to BasicGameEngine/src/WindowMutexMgr.cpp From 94d8023b0d063d01517fa38668634779ff761339 Mon Sep 17 00:00:00 2001 From: marcnoon Date: Sun, 8 Sep 2024 11:20:16 -0700 Subject: [PATCH 2/3] Update docker file attempt 1 --- BasicGameEngine/BasicGameEngine.vcxproj | 10 +++++--- BasicGameEngine/CMakeLists.txt | 24 +++++++++++++++++++ BasicGameEngine/Dockerfile | 27 +++++++++++++++++++++ BasicGameEngine/Dockerfile.txt | 32 +++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 BasicGameEngine/CMakeLists.txt create mode 100644 BasicGameEngine/Dockerfile create mode 100644 BasicGameEngine/Dockerfile.txt diff --git a/BasicGameEngine/BasicGameEngine.vcxproj b/BasicGameEngine/BasicGameEngine.vcxproj index a90e5f2..91216ee 100644 --- a/BasicGameEngine/BasicGameEngine.vcxproj +++ b/BasicGameEngine/BasicGameEngine.vcxproj @@ -129,12 +129,12 @@ - + - - + + @@ -143,6 +143,10 @@ + + + + diff --git a/BasicGameEngine/CMakeLists.txt b/BasicGameEngine/CMakeLists.txt new file mode 100644 index 0000000..ab98b0c --- /dev/null +++ b/BasicGameEngine/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.15) # Specify the minimum version of CMake you want to use +project(BasicGameEngine) + +# Set the C++ standard +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +# Include directories +include_directories(include) # Add the include directory + +# Add the source files to the project +file(GLOB SOURCES "src/*.cpp") # Collect all source files + +# Add the executable +add_executable(BasicGameEngine ${SOURCES}) + +# Link any required libraries (if you are using Windows-specific libraries, add them here) +target_link_libraries(BasicGameEngine + PRIVATE + user32 # Add Windows libraries as needed + gdi32 + shell32 + comctl32 +) diff --git a/BasicGameEngine/Dockerfile b/BasicGameEngine/Dockerfile new file mode 100644 index 0000000..7a3e480 --- /dev/null +++ b/BasicGameEngine/Dockerfile @@ -0,0 +1,27 @@ +# Use the official Microsoft Visual Studio Build Tools base image +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# Install Visual Studio Build Tools and CMake +RUN curl -L -o vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe && \ + start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ + --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended && \ + del vs_buildtools.exe && \ + curl -L -o cmake.zip https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-windows-x86_64.zip && \ + powershell -Command "Expand-Archive -Path cmake.zip -DestinationPath C:\\cmake" && \ + setx PATH "%PATH%;C:\\cmake\\bin" && \ + del cmake.zip + +# Set the working directory to the project folder +WORKDIR C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine + +# Copy the entire solution to the Docker image +COPY . . + +# Generate build files with CMake +RUN cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release + +# Build the project +RUN cmake --build build --config Release + +# Set the entry point to run the application +CMD ["C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine\\build\\BasicGameEngine.exe"] diff --git a/BasicGameEngine/Dockerfile.txt b/BasicGameEngine/Dockerfile.txt new file mode 100644 index 0000000..c1d41f3 --- /dev/null +++ b/BasicGameEngine/Dockerfile.txt @@ -0,0 +1,32 @@ +# Use the official Microsoft Visual Studio Build Tools base image + +# ### WINDOWS 2022 ### # +# FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# ### WINDOWS 2019 ### # May be Windows 10 Compatible? +FROM mcr.microsoft.com/windows/servercore:ltsc2019 + +# Install Visual Studio Build Tools and CMake +RUN curl -L -o vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe && \ + start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ + --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended && \ + del vs_buildtools.exe && \ + curl -L -o cmake.zip https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-windows-x86_64.zip && \ + powershell -Command "Expand-Archive -Path cmake.zip -DestinationPath C:\\cmake" && \ + setx PATH "%PATH%;C:\\cmake\\bin" && \ + del cmake.zip + +# Set the working directory to the project folder +WORKDIR C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine + +# Copy the entire solution to the Docker image +COPY . . + +# Generate build files with CMake +RUN cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release + +# Build the project +RUN cmake --build build --config Release + +# Set the entry point to run the application +CMD ["C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine\\build\\BasicGameEngine.exe"] From 3aa61437e62d894aae7d7fde17e587eecde4f78d Mon Sep 17 00:00:00 2001 From: marcnoon Date: Mon, 9 Sep 2024 11:16:05 -0700 Subject: [PATCH 3/3] Try to test on windows server 2022 compatible docker for compiling in the cloud. Difficult because its a vc++ windows app. --- .dockerignore | 17 +++++++++ BasicGameEngine/BasicGameEngine.vcxproj | 5 ++- BasicGameEngine/Dockerfile | 32 +++++------------ BasicGameEngine/Dockerfile.txt | 32 ----------------- BasicGameEngine/Dockerfile_MSVC | 47 +++++++++++++++++++++++++ Dockerfile | 17 +++++++++ 6 files changed, 93 insertions(+), 57 deletions(-) create mode 100644 .dockerignore delete mode 100644 BasicGameEngine/Dockerfile.txt create mode 100644 BasicGameEngine/Dockerfile_MSVC create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..90d9424 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Ignore Visual Studio files +.vs/ +*.user +*.suo +*.VC.db + +# Ignore build directories +x64/ +Debug/ +Release/ + +# Ignore any other temporary files or directories +*.log +*.obj +*.tlog +*.idb +*.pdb diff --git a/BasicGameEngine/BasicGameEngine.vcxproj b/BasicGameEngine/BasicGameEngine.vcxproj index 91216ee..fcb4d69 100644 --- a/BasicGameEngine/BasicGameEngine.vcxproj +++ b/BasicGameEngine/BasicGameEngine.vcxproj @@ -145,7 +145,10 @@ - + + + + diff --git a/BasicGameEngine/Dockerfile b/BasicGameEngine/Dockerfile index 7a3e480..70ae9f2 100644 --- a/BasicGameEngine/Dockerfile +++ b/BasicGameEngine/Dockerfile @@ -1,27 +1,11 @@ -# Use the official Microsoft Visual Studio Build Tools base image -FROM mcr.microsoft.com/windows/servercore:ltsc2022 +# Use a compatible base image for your Windows version +FROM mcr.microsoft.com/windows/nanoserver:1909 -# Install Visual Studio Build Tools and CMake -RUN curl -L -o vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe && \ - start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ - --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended && \ - del vs_buildtools.exe && \ - curl -L -o cmake.zip https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-windows-x86_64.zip && \ - powershell -Command "Expand-Archive -Path cmake.zip -DestinationPath C:\\cmake" && \ - setx PATH "%PATH%;C:\\cmake\\bin" && \ - del cmake.zip +# Set the working directory +WORKDIR /app -# Set the working directory to the project folder -WORKDIR C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine +# Copy the executable from the correct relative location +COPY ./x64/Debug/BasicGameEngine.exe . -# Copy the entire solution to the Docker image -COPY . . - -# Generate build files with CMake -RUN cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release - -# Build the project -RUN cmake --build build --config Release - -# Set the entry point to run the application -CMD ["C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine\\build\\BasicGameEngine.exe"] +# Set the entry point to run the executable +CMD ["BasicGameEngine.exe"] diff --git a/BasicGameEngine/Dockerfile.txt b/BasicGameEngine/Dockerfile.txt deleted file mode 100644 index c1d41f3..0000000 --- a/BasicGameEngine/Dockerfile.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Use the official Microsoft Visual Studio Build Tools base image - -# ### WINDOWS 2022 ### # -# FROM mcr.microsoft.com/windows/servercore:ltsc2022 - -# ### WINDOWS 2019 ### # May be Windows 10 Compatible? -FROM mcr.microsoft.com/windows/servercore:ltsc2019 - -# Install Visual Studio Build Tools and CMake -RUN curl -L -o vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe && \ - start /w vs_buildtools.exe --quiet --wait --norestart --nocache \ - --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended && \ - del vs_buildtools.exe && \ - curl -L -o cmake.zip https://github.com/Kitware/CMake/releases/download/v3.27.0/cmake-3.27.0-windows-x86_64.zip && \ - powershell -Command "Expand-Archive -Path cmake.zip -DestinationPath C:\\cmake" && \ - setx PATH "%PATH%;C:\\cmake\\bin" && \ - del cmake.zip - -# Set the working directory to the project folder -WORKDIR C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine - -# Copy the entire solution to the Docker image -COPY . . - -# Generate build files with CMake -RUN cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release - -# Build the project -RUN cmake --build build --config Release - -# Set the entry point to run the application -CMD ["C:\\Users\\marcn\\source\\repos\\BasicGameEngine\\BasicGameEngine\\build\\BasicGameEngine.exe"] diff --git a/BasicGameEngine/Dockerfile_MSVC b/BasicGameEngine/Dockerfile_MSVC new file mode 100644 index 0000000..0d831fd --- /dev/null +++ b/BasicGameEngine/Dockerfile_MSVC @@ -0,0 +1,47 @@ +# Use the official Microsoft Visual Studio Build Tools base image +FROM mcr.microsoft.com/windows/servercore:ltsc2019 + +# Set up proxy settings if needed +ENV HTTP_PROXY=http://yourproxy:port +ENV HTTPS_PROXY=http://yourproxy:port + +# Install Visual Studio Build Tools and CMake +RUN powershell -Command " \ + Set-ExecutionPolicy Bypass -Scope Process -Force; \ + [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; \ + $retryCount = 0; \ + $maxRetries = 5; \ + while ($retryCount -lt $maxRetries) { \ + try { \ + Invoke-WebRequest -Uri 'https://aka.ms/vs/17/release/vs_buildtools.exe' -OutFile 'vs_buildtools.exe'; \ + Write-Host 'Downloading Visual Studio Build Tools...'; \ + Start-Process -Wait -FilePath 'vs_buildtools.exe' -ArgumentList '--quiet', '--wait', '--add Microsoft.VisualStudio.Workload.VCTools'; \ + Write-Host 'Visual Studio Build Tools installation completed.'; \ + if (Test-Path 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC') { \ + Write-Host 'MSVC installation verified.'; \ + break; \ + } else { \ + Write-Error 'MSVC not found!'; \ + Get-ChildItem 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools'; \ + exit 1; \ + } \ + } catch { \ + Write-Host 'Download failed, retrying...'; \ + $retryCount++; \ + Start-Sleep -Seconds 10; \ + } \ + }; \ + if ($retryCount -eq $maxRetries) { \ + Write-Error 'Failed to download Visual Studio Build Tools after multiple attempts.'; \ + exit 1; \ + }; \ + Remove-Item -Force vs_buildtools.exe" + +# Set the working directory +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . . + +# Run PowerShell in the container +CMD ["powershell"] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e40cc05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Use a compatible base image for your Windows version +FROM mcr.microsoft.com/windows/nanoserver:1909 + +# Set the working directory +WORKDIR /app + +# Set the working directory +WORKDIR /app + +# Copy the executable from the correct location +COPY ../x64/Debug/BasicGameEngine.exe . + +# Expose any necessary ports (if required) +# EXPOSE 8080 + +# Set the entry point to run the executable +CMD ["BasicGameEngine.exe"]