From 37935481062f65a06745abd56b58c23fab767295 Mon Sep 17 00:00:00 2001 From: GG Z <903524121@qq.com> Date: Mon, 23 Feb 2026 10:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/.idea.CppTutorial/.idea/.gitignore | 13 ++ .idea/.idea.CppTutorial/.idea/encodings.xml | 4 + .idea/.idea.CppTutorial/.idea/indexLayout.xml | 8 + .idea/.idea.CppTutorial/.idea/vcs.xml | 4 + CppTutorial.sln | 51 ++++++ CppTutorial/CppTutorial.cpp | 138 ++++++++++++++++ CppTutorial/CppTutorial.h | 0 CppTutorial/CppTutorial.vcxproj | 156 ++++++++++++++++++ CppTutorial/CppTutorial.vcxproj.filters | 48 ++++++ CppTutorial/Math.cpp | 11 ++ CppTutorial/Timer.cpp | 1 + CppTutorial/Timer.h | 110 ++++++++++++ CppTutorial/log.cpp | 6 + CppTutorial/pch.cpp | 1 + CppTutorial/pch.h | 2 + CppTutorial/results.json | 1 + CppTutorial/text.txt | 1 + CppTutorial/trace.json | 6 + Engine/Engine.vcxproj | 138 ++++++++++++++++ Engine/Engine.vcxproj.filters | 27 +++ Engine/src/Engine.cpp | 10 ++ Engine/src/Engine.h | 6 + Game/Game.vcxproj | 142 ++++++++++++++++ Game/Game.vcxproj.filters | 22 +++ Game/src/Application.cpp | 6 + 25 files changed, 912 insertions(+) create mode 100644 .idea/.idea.CppTutorial/.idea/.gitignore create mode 100644 .idea/.idea.CppTutorial/.idea/encodings.xml create mode 100644 .idea/.idea.CppTutorial/.idea/indexLayout.xml create mode 100644 .idea/.idea.CppTutorial/.idea/vcs.xml create mode 100644 CppTutorial.sln create mode 100644 CppTutorial/CppTutorial.cpp create mode 100644 CppTutorial/CppTutorial.h create mode 100644 CppTutorial/CppTutorial.vcxproj create mode 100644 CppTutorial/CppTutorial.vcxproj.filters create mode 100644 CppTutorial/Math.cpp create mode 100644 CppTutorial/Timer.cpp create mode 100644 CppTutorial/Timer.h create mode 100644 CppTutorial/log.cpp create mode 100644 CppTutorial/pch.cpp create mode 100644 CppTutorial/pch.h create mode 100644 CppTutorial/results.json create mode 100644 CppTutorial/text.txt create mode 100644 CppTutorial/trace.json create mode 100644 Engine/Engine.vcxproj create mode 100644 Engine/Engine.vcxproj.filters create mode 100644 Engine/src/Engine.cpp create mode 100644 Engine/src/Engine.h create mode 100644 Game/Game.vcxproj create mode 100644 Game/Game.vcxproj.filters create mode 100644 Game/src/Application.cpp diff --git a/.idea/.idea.CppTutorial/.idea/.gitignore b/.idea/.idea.CppTutorial/.idea/.gitignore new file mode 100644 index 0000000..1d02846 --- /dev/null +++ b/.idea/.idea.CppTutorial/.idea/.gitignore @@ -0,0 +1,13 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# Rider 忽略的文件 +/contentModel.xml +/.idea.CppTutorial.iml +/modules.xml +/projectSettingsUpdater.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/.idea.CppTutorial/.idea/encodings.xml b/.idea/.idea.CppTutorial/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/.idea/.idea.CppTutorial/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/.idea.CppTutorial/.idea/indexLayout.xml b/.idea/.idea.CppTutorial/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.CppTutorial/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.CppTutorial/.idea/vcs.xml b/.idea/.idea.CppTutorial/.idea/vcs.xml new file mode 100644 index 0000000..d843f34 --- /dev/null +++ b/.idea/.idea.CppTutorial/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CppTutorial.sln b/CppTutorial.sln new file mode 100644 index 0000000..57a6d75 --- /dev/null +++ b/CppTutorial.sln @@ -0,0 +1,51 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35617.110 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppTutorial", "CppTutorial\CppTutorial.vcxproj", "{34695727-FCF9-4A55-9EE7-62140E5183E4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Engine", "Engine\Engine.vcxproj", "{EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Game", "Game\Game.vcxproj", "{8139EE61-D77D-44A4-B075-7D84336DB5E3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Debug|x64.ActiveCfg = Debug|x64 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Debug|x64.Build.0 = Debug|x64 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Debug|x86.ActiveCfg = Debug|Win32 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Debug|x86.Build.0 = Debug|Win32 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Release|x64.ActiveCfg = Release|x64 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Release|x64.Build.0 = Release|x64 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Release|x86.ActiveCfg = Release|Win32 + {34695727-FCF9-4A55-9EE7-62140E5183E4}.Release|x86.Build.0 = Release|Win32 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Debug|x64.ActiveCfg = Debug|x64 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Debug|x64.Build.0 = Debug|x64 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Debug|x86.ActiveCfg = Debug|Win32 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Debug|x86.Build.0 = Debug|Win32 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Release|x64.ActiveCfg = Release|x64 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Release|x64.Build.0 = Release|x64 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Release|x86.ActiveCfg = Release|Win32 + {EBEF5677-2E8A-4FE2-972D-9CAC91EB5E09}.Release|x86.Build.0 = Release|Win32 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Debug|x64.ActiveCfg = Debug|x64 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Debug|x64.Build.0 = Debug|x64 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Debug|x86.ActiveCfg = Debug|Win32 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Debug|x86.Build.0 = Debug|Win32 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Release|x64.ActiveCfg = Release|x64 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Release|x64.Build.0 = Release|x64 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Release|x86.ActiveCfg = Release|Win32 + {8139EE61-D77D-44A4-B075-7D84336DB5E3}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {40A2A093-4844-41E5-95FA-DD27BA10A111} + EndGlobalSection +EndGlobal diff --git a/CppTutorial/CppTutorial.cpp b/CppTutorial/CppTutorial.cpp new file mode 100644 index 0000000..f756639 --- /dev/null +++ b/CppTutorial/CppTutorial.cpp @@ -0,0 +1,138 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +struct ProfileResult { + std::string Name; + long long Start, End; + uint32_t ThreadID; +}; + +class Instrumentor { +private: + std::string m_CurrentSessionName; + std::ofstream m_OutputStream; + int m_ProfileCount = 0; + + Instrumentor() {} + +public: + static Instrumentor& Get() { + static Instrumentor* s_Instance; + + if (!s_Instance) + s_Instance = new Instrumentor(); + return *s_Instance; + } + + void BeginSession(const std::string& name, const std::string& filepath = "results.json") { + m_CurrentSessionName = name; + m_OutputStream.open(filepath); + WriteHeader(); + } + + void EndSession() { + WriteFooter(); + m_OutputStream.close(); + m_ProfileCount = 0; + } + + void WriteProfile(const ProfileResult& result) { + if (m_ProfileCount++ > 0) + m_OutputStream << ","; + + std::string name = result.Name; + std::replace(name.begin(), name.end(), '"', '\''); + + m_OutputStream << "{"; + m_OutputStream << "\"cat\":\"function\","; + m_OutputStream << "\"dur\":" << (result.End - result.Start) << ','; + m_OutputStream << "\"name\":\"" << name << "\","; + m_OutputStream << "\"ph\":\"X\","; + m_OutputStream << "\"pid\":0,"; + m_OutputStream << "\"tid\":" << result.ThreadID << ","; + m_OutputStream << "\"ts\":" << result.Start; + m_OutputStream << "}"; + + m_OutputStream.flush(); + } + + void WriteHeader() { + m_OutputStream << "{\"otherData\": {},\"traceEvents\":["; + m_OutputStream.flush(); + } + + void WriteFooter() { + m_OutputStream << "]}"; + m_OutputStream.flush(); + } +}; + +class InstrumentationTimer { +private: + ProfileResult m_Result; + std::chrono::time_point m_StartTimepoint; + bool m_Stopped; + +public: + InstrumentationTimer(const std::string& name) + : m_Result({ name, 0, 0, 0 }), m_Stopped(false) { + m_StartTimepoint = std::chrono::high_resolution_clock::now(); + // 使用 std::hash 生成线程 ID 的哈希值并转换为 uint32_t + std::hash hasher; + m_Result.ThreadID = static_cast(hasher(std::this_thread::get_id())); + } + + ~InstrumentationTimer() { + if (!m_Stopped) + Stop(); + } + + void Stop() { + auto endTimepoint = std::chrono::high_resolution_clock::now(); + + long long start = std::chrono::time_point_cast(m_StartTimepoint).time_since_epoch().count(); + long long end = std::chrono::time_point_cast(endTimepoint).time_since_epoch().count(); + + m_Result.Start = start; + m_Result.End = end; + + Instrumentor::Get().WriteProfile(m_Result); + m_Stopped = true; + } +}; + +#define PROFILE_SCOPE(name) InstrumentationTimer timer##__LINE__(name) +#define PROFILE_FUNCTION() PROFILE_SCOPE(__FUNCTION__) +void Function1() { + PROFILE_FUNCTION(); + for (int i = 0; i < 1000; ++i) { + std::cout << "Function1: " << i << std::endl; + } +} + +void Function2() { + PROFILE_FUNCTION(); + std::vector vec; + for (int i = 0; i < 1000; ++i) { + vec.push_back(i); + } +} + +int main() { + Instrumentor::Get().BeginSession("Test Session"); + + { + PROFILE_FUNCTION(); + Function1(); + Function2(); + } + + Instrumentor::Get().EndSession(); + return 0; +} \ No newline at end of file diff --git a/CppTutorial/CppTutorial.h b/CppTutorial/CppTutorial.h new file mode 100644 index 0000000..e69de29 diff --git a/CppTutorial/CppTutorial.vcxproj b/CppTutorial/CppTutorial.vcxproj new file mode 100644 index 0000000..b92606c --- /dev/null +++ b/CppTutorial/CppTutorial.vcxproj @@ -0,0 +1,156 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {34695727-fcf9-4a55-9ee7-62140e5183e4} + CppTutorial + 10.0 + + + + Application + true + v145 + Unicode + + + Application + false + v145 + true + Unicode + + + Application + true + v145 + Unicode + + + Application + false + v145 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + NotUsing + pch.h + stdcpp17 + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + NotUsing + pch.h + stdcpp17 + + + Console + true + true + true + + + + + + + + Create + Create + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CppTutorial/CppTutorial.vcxproj.filters b/CppTutorial/CppTutorial.vcxproj.filters new file mode 100644 index 0000000..8a89793 --- /dev/null +++ b/CppTutorial/CppTutorial.vcxproj.filters @@ -0,0 +1,48 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + 源文件 + + + + + 头文件 + + + 头文件 + + + 头文件 + + + + + + \ No newline at end of file diff --git a/CppTutorial/Math.cpp b/CppTutorial/Math.cpp new file mode 100644 index 0000000..7f090b2 --- /dev/null +++ b/CppTutorial/Math.cpp @@ -0,0 +1,11 @@ +#include + +int Multiply(int a, int b) +{ + return a * b; +} +static void Log(const char* message) +{ + std::cout << message << std::endl; + std::cout << message << std::endl; +} \ No newline at end of file diff --git a/CppTutorial/Timer.cpp b/CppTutorial/Timer.cpp new file mode 100644 index 0000000..afe5d24 --- /dev/null +++ b/CppTutorial/Timer.cpp @@ -0,0 +1 @@ +#include "Timer.h" diff --git a/CppTutorial/Timer.h b/CppTutorial/Timer.h new file mode 100644 index 0000000..ca523a6 --- /dev/null +++ b/CppTutorial/Timer.h @@ -0,0 +1,110 @@ +#pragma once +#include +#include +#include +#include +#include +#include + +struct ProfileResult { + std::string Name; + long long Start, End; + uint32_t ThreadID; +}; + +class Instrumentor { +private: + std::string m_CurrentSessionName; + std::ofstream m_OutputStream; + int m_ProfileCount = 0; + + Instrumentor() {} + +public: + static Instrumentor& Get() { + static Instrumentor* s_Instance; + + if (!s_Instance) + s_Instance = new Instrumentor(); + return *s_Instance; + } + + void BeginSession(const std::string& name, const std::string& filepath = "results.json") { + m_CurrentSessionName = name; + m_OutputStream.open(filepath); + WriteHeader(); + } + + void EndSession() { + WriteFooter(); + m_OutputStream.close(); + m_ProfileCount = 0; + } + + void WriteProfile(const ProfileResult& result) { + if (m_ProfileCount++ > 0) + m_OutputStream << ","; + + std::string name = result.Name; + std::replace(name.begin(), name.end(), '"', '\''); + + m_OutputStream << "{"; + m_OutputStream << "\"cat\":\"function\","; + m_OutputStream << "\"dur\":" << (result.End - result.Start) << ','; + m_OutputStream << "\"name\":\"" << name << "\","; + m_OutputStream << "\"ph\":\"X\","; + m_OutputStream << "\"pid\":0,"; + m_OutputStream << "\"tid\":" << result.ThreadID << ","; + m_OutputStream << "\"ts\":" << result.Start; + m_OutputStream << "}"; + + m_OutputStream.flush(); + } + + void WriteHeader() { + m_OutputStream << "{\"otherData\": {},\"traceEvents\":["; + m_OutputStream.flush(); + } + + void WriteFooter() { + m_OutputStream << "]}"; + m_OutputStream.flush(); + } +}; + +class InstrumentationTimer { +private: + ProfileResult m_Result; + std::chrono::time_point m_StartTimepoint; + bool m_Stopped; + +public: + InstrumentationTimer(const std::string& name) + : m_Result({ name, 0, 0, 0 }), m_Stopped(false) { + m_StartTimepoint = std::chrono::high_resolution_clock::now(); + // ʹ std::hash ߳ ID ĹϣֵתΪ uint32_t + std::hash hasher; + m_Result.ThreadID = static_cast(hasher(std::this_thread::get_id())); + } + + ~InstrumentationTimer() { + if (!m_Stopped) + Stop(); + } + + void Stop() { + auto endTimepoint = std::chrono::high_resolution_clock::now(); + + long long start = std::chrono::time_point_cast(m_StartTimepoint).time_since_epoch().count(); + long long end = std::chrono::time_point_cast(endTimepoint).time_since_epoch().count(); + + m_Result.Start = start; + m_Result.End = end; + + Instrumentor::Get().WriteProfile(m_Result); + m_Stopped = true; + } +}; + +#define PROFILE_SCOPE(name) InstrumentationTimer timer##__LINE__(name) +#define PROFILE_FUNCTION() PROFILE_SCOPE(__FUNCTION__) \ No newline at end of file diff --git a/CppTutorial/log.cpp b/CppTutorial/log.cpp new file mode 100644 index 0000000..f230217 --- /dev/null +++ b/CppTutorial/log.cpp @@ -0,0 +1,6 @@ +#include + +void Log(const char* message) +{ + std::cout << message << '\n'; +} \ No newline at end of file diff --git a/CppTutorial/pch.cpp b/CppTutorial/pch.cpp new file mode 100644 index 0000000..1d9f38c --- /dev/null +++ b/CppTutorial/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" diff --git a/CppTutorial/pch.h b/CppTutorial/pch.h new file mode 100644 index 0000000..3f59c93 --- /dev/null +++ b/CppTutorial/pch.h @@ -0,0 +1,2 @@ +#pragma once + diff --git a/CppTutorial/results.json b/CppTutorial/results.json new file mode 100644 index 0000000..e6e071a --- /dev/null +++ b/CppTutorial/results.json @@ -0,0 +1 @@ +{"otherData": {},"traceEvents":[{"cat":"function","dur":90369,"name":"Function1","ph":"X","pid":0,"tid":2095694787,"ts":216107861788},{"cat":"function","dur":80,"name":"Function2","ph":"X","pid":0,"tid":2095694787,"ts":216107952219},{"cat":"function","dur":90542,"name":"main","ph":"X","pid":0,"tid":2095694787,"ts":216107861784}]} \ No newline at end of file diff --git a/CppTutorial/text.txt b/CppTutorial/text.txt new file mode 100644 index 0000000..418d6c3 --- /dev/null +++ b/CppTutorial/text.txt @@ -0,0 +1 @@ +DATA \ No newline at end of file diff --git a/CppTutorial/trace.json b/CppTutorial/trace.json new file mode 100644 index 0000000..3d668be --- /dev/null +++ b/CppTutorial/trace.json @@ -0,0 +1,6 @@ +{ + "traceEvents": [ + {"name": "Sleep 100ms", "cat": "Test", "ph": "X", "ts": 214981785763, "dur": 107468, "pid": 0, "tid": 19484}, + {"name": "Calculate Sum", "cat": "Test", "ph": "X", "ts": 214981894040, "dur": 1313, "pid": 0, "tid": 19484} + ] +} diff --git a/Engine/Engine.vcxproj b/Engine/Engine.vcxproj new file mode 100644 index 0000000..b91412a --- /dev/null +++ b/Engine/Engine.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {ebef5677-2e8a-4fe2-972d-9cac91eb5e09} + Engine + 10.0 + + + + Application + true + v145 + Unicode + + + Application + false + v145 + true + Unicode + + + StaticLibrary + true + v145 + Unicode + + + StaticLibrary + false + v145 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/Engine/Engine.vcxproj.filters b/Engine/Engine.vcxproj.filters new file mode 100644 index 0000000..afa12e0 --- /dev/null +++ b/Engine/Engine.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 头文件 + + + + + 源文件 + + + \ No newline at end of file diff --git a/Engine/src/Engine.cpp b/Engine/src/Engine.cpp new file mode 100644 index 0000000..894a1d2 --- /dev/null +++ b/Engine/src/Engine.cpp @@ -0,0 +1,10 @@ +#include "Engine.h" +#include +namespace engine +{ + void PrintMessage() + { + std::cout << "Welcome to the Engine!" << std::endl; + } +} + diff --git a/Engine/src/Engine.h b/Engine/src/Engine.h new file mode 100644 index 0000000..bf237c5 --- /dev/null +++ b/Engine/src/Engine.h @@ -0,0 +1,6 @@ +#pragma once + +namespace engine{ + + void PrintMessage(); +} diff --git a/Game/Game.vcxproj b/Game/Game.vcxproj new file mode 100644 index 0000000..0680139 --- /dev/null +++ b/Game/Game.vcxproj @@ -0,0 +1,142 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {8139ee61-d77d-44a4-b075-7d84336db5e3} + Game + 10.0 + + + + Application + true + v145 + Unicode + + + Application + false + v145 + true + Unicode + + + Application + true + v145 + Unicode + + + Application + false + v145 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)Engine\src + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)Engine\src + + + Console + true + true + true + + + + + + + + {ebef5677-2e8a-4fe2-972d-9cac91eb5e09} + + + + + + \ No newline at end of file diff --git a/Game/Game.vcxproj.filters b/Game/Game.vcxproj.filters new file mode 100644 index 0000000..9677e08 --- /dev/null +++ b/Game/Game.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/Game/src/Application.cpp b/Game/src/Application.cpp new file mode 100644 index 0000000..727cb4a --- /dev/null +++ b/Game/src/Application.cpp @@ -0,0 +1,6 @@ +#include "Engine.h" +//#include "../../Engine/src/Engine.h" + +int main() { + engine::PrintMessage(); +} \ No newline at end of file