├── Engine
├── Shader
│ ├── BasePassPS.esl
│ ├── BasePassVS.esl
│ └── Platform.esh
├── Source
│ ├── RHI-Vulkan
│ │ ├── Src
│ │ │ ├── VmaImport.cpp
│ │ │ ├── VulkanRHIModule.cpp
│ │ │ ├── Surface.cpp
│ │ │ ├── Platform
│ │ │ │ ├── Win32Surface.cpp
│ │ │ │ └── MacosSurface.mm
│ │ │ └── BufferView.cpp
│ │ ├── Include
│ │ │ └── RHI
│ │ │ │ └── Vulkan
│ │ │ │ ├── VulkanRHIModule.h
│ │ │ │ ├── Sampler.h
│ │ │ │ ├── Surface.h
│ │ │ │ ├── Queue.h
│ │ │ │ ├── PipelineLayout.h
│ │ │ │ ├── BindGroupLayout.h
│ │ │ │ ├── CommandBuffer.h
│ │ │ │ ├── ShaderModule.h
│ │ │ │ ├── BindGroup.h
│ │ │ │ ├── BufferView.h
│ │ │ │ ├── Gpu.h
│ │ │ │ ├── Synchronous.h
│ │ │ │ ├── TextureView.h
│ │ │ │ ├── SwapChain.h
│ │ │ │ ├── Buffer.h
│ │ │ │ └── Texture.h
│ │ └── CMakeLists.txt
│ ├── Test
│ │ ├── Include
│ │ │ └── Test
│ │ │ │ └── Test.h
│ │ ├── CMakeLists.txt
│ │ └── Src
│ │ │ └── Main.cpp
│ ├── RHI-DirectX12
│ │ ├── Src
│ │ │ ├── Common.cpp
│ │ │ ├── Surface.cpp
│ │ │ ├── ShaderModule.cpp
│ │ │ ├── DX12RHIModule.cpp
│ │ │ └── Gpu.cpp
│ │ ├── CMakeLists.txt
│ │ └── Include
│ │ │ └── RHI
│ │ │ └── DirectX12
│ │ │ ├── Surface.h
│ │ │ ├── DX12RHIModule.h
│ │ │ ├── ShaderModule.h
│ │ │ ├── Queue.h
│ │ │ ├── Sampler.h
│ │ │ ├── Gpu.h
│ │ │ ├── TextureView.h
│ │ │ ├── Texture.h
│ │ │ ├── BindGroup.h
│ │ │ ├── BufferView.h
│ │ │ ├── Buffer.h
│ │ │ ├── SwapChain.h
│ │ │ ├── Synchronous.h
│ │ │ └── BindGroupLayout.h
│ ├── RHI
│ │ ├── CMakeLists.txt
│ │ ├── Src
│ │ │ ├── Gpu.cpp
│ │ │ ├── RHIModule.cpp
│ │ │ ├── CommandBuffer.cpp
│ │ │ ├── Surface.cpp
│ │ │ ├── Device.cpp
│ │ │ ├── Common.cpp
│ │ │ ├── BindGroup.cpp
│ │ │ ├── Synchronous.cpp
│ │ │ ├── ShaderModule.cpp
│ │ │ ├── Queue.cpp
│ │ │ └── BindGroupLayout.cpp
│ │ └── Include
│ │ │ └── RHI
│ │ │ ├── RHIModule.h
│ │ │ ├── CommandBuffer.h
│ │ │ ├── Surface.h
│ │ │ ├── RHI.h
│ │ │ ├── Gpu.h
│ │ │ ├── ShaderModule.h
│ │ │ ├── Instance.h
│ │ │ ├── BindGroup.h
│ │ │ ├── Queue.h
│ │ │ ├── PipelineLayout.h
│ │ │ └── Buffer.h
│ ├── Common
│ │ ├── Test
│ │ │ ├── FileSystemTest.cpp
│ │ │ ├── UtilityTest.cpp
│ │ │ ├── FileTest.cpp
│ │ │ ├── HashTest.cpp
│ │ │ └── DelegateTest.cpp
│ │ ├── CMakeLists.txt
│ │ ├── Src
│ │ │ ├── Serialization.cpp
│ │ │ ├── IO.cpp
│ │ │ ├── Platform.cpp
│ │ │ ├── Hash.cpp
│ │ │ └── Debug.cpp
│ │ └── Include
│ │ │ └── Common
│ │ │ ├── Math
│ │ │ ├── Math.h
│ │ │ └── Common.h
│ │ │ ├── File.h
│ │ │ ├── Platform.h
│ │ │ ├── IO.h
│ │ │ └── DynamicLibrary.h
│ ├── Runtime
│ │ ├── Src
│ │ │ ├── RuntimeModule.cpp
│ │ │ ├── Client.cpp
│ │ │ ├── Component
│ │ │ │ ├── Primitive.cpp
│ │ │ │ ├── Scene.cpp
│ │ │ │ ├── Camera.cpp
│ │ │ │ ├── Light.cpp
│ │ │ │ └── Player.cpp
│ │ │ ├── Settings
│ │ │ │ └── Game.cpp
│ │ │ ├── Asset
│ │ │ │ ├── Mesh.cpp
│ │ │ │ ├── Level.cpp
│ │ │ │ └── Asset.cpp
│ │ │ ├── Viewport.cpp
│ │ │ ├── SystemGraphPresets.cpp
│ │ │ ├── System
│ │ │ │ └── Player.cpp
│ │ │ └── GameThread.cpp
│ │ ├── Include
│ │ │ └── Runtime
│ │ │ │ ├── RuntimeModule.h
│ │ │ │ ├── Meta.h
│ │ │ │ ├── SystemGraphPresets.h
│ │ │ │ ├── GameModule.h
│ │ │ │ ├── Client.h
│ │ │ │ ├── Component
│ │ │ │ ├── Primitive.h
│ │ │ │ ├── Scene.h
│ │ │ │ ├── Camera.h
│ │ │ │ ├── Light.h
│ │ │ │ └── Player.h
│ │ │ │ ├── Asset
│ │ │ │ ├── Level.h
│ │ │ │ └── Mesh.h
│ │ │ │ ├── Settings
│ │ │ │ └── Game.h
│ │ │ │ ├── System
│ │ │ │ └── Transform.h
│ │ │ │ ├── Viewport.h
│ │ │ │ └── World.h
│ │ ├── Test
│ │ │ ├── RuntimeTestModule.h
│ │ │ ├── RuntimeTestModule.cpp
│ │ │ └── AssetTest.h
│ │ └── CMakeLists.txt
│ ├── RHI-Dummy
│ │ ├── CMakeLists.txt
│ │ ├── Src
│ │ │ ├── Sampler.cpp
│ │ │ ├── Surface.cpp
│ │ │ ├── BindGroup.cpp
│ │ │ ├── BufferView.cpp
│ │ │ ├── TextureView.cpp
│ │ │ ├── PipelineLayout.cpp
│ │ │ ├── BindGroupLayout.cpp
│ │ │ ├── CommandBuffer.cpp
│ │ │ ├── Queue.cpp
│ │ │ ├── ShaderModule.cpp
│ │ │ ├── Texture.cpp
│ │ │ ├── Pipeline.cpp
│ │ │ ├── Gpu.cpp
│ │ │ ├── Synchronous.cpp
│ │ │ ├── Buffer.cpp
│ │ │ ├── DummyRHIModule.cpp
│ │ │ ├── Instance.cpp
│ │ │ └── SwapChain.cpp
│ │ └── Include
│ │ │ └── RHI
│ │ │ └── Dummy
│ │ │ ├── Sampler.h
│ │ │ ├── Surface.h
│ │ │ ├── BindGroup.h
│ │ │ ├── BufferView.h
│ │ │ ├── CommandBuffer.h
│ │ │ ├── TextureView.h
│ │ │ ├── PipelineLayout.h
│ │ │ ├── BindGroupLayout.h
│ │ │ ├── Queue.h
│ │ │ ├── Texture.h
│ │ │ ├── DummyRHIModule.h
│ │ │ ├── ShaderModule.h
│ │ │ ├── Gpu.h
│ │ │ ├── Instance.h
│ │ │ ├── Buffer.h
│ │ │ ├── Pipeline.h
│ │ │ ├── Synchronous.h
│ │ │ └── SwapChain.h
│ ├── Core
│ │ ├── Include
│ │ │ └── Core
│ │ │ │ ├── EngineVersion.h
│ │ │ │ └── Thread.h
│ │ ├── CMakeLists.txt
│ │ └── Test
│ │ │ ├── ConsoleTest.cpp
│ │ │ └── CmdlineTest.cpp
│ ├── Render
│ │ ├── Src
│ │ │ ├── Scene.cpp
│ │ │ ├── Renderer.cpp
│ │ │ └── View.cpp
│ │ ├── Include
│ │ │ └── Render
│ │ │ │ ├── SceneProxy
│ │ │ │ ├── Primitive.h
│ │ │ │ └── Light.h
│ │ │ │ ├── RenderModule.h
│ │ │ │ └── View.h
│ │ └── CMakeLists.txt
│ ├── Launch
│ │ ├── CMakeLists.txt
│ │ ├── Src
│ │ │ ├── Main.cpp
│ │ │ └── GameClient.cpp
│ │ └── Include
│ │ │ └── Launch
│ │ │ ├── GameClient.h
│ │ │ └── GameApplication.h
│ ├── Mirror
│ │ ├── CMakeLists.txt
│ │ ├── Include
│ │ │ └── Mirror
│ │ │ │ └── Meta.h
│ │ └── Test
│ │ │ └── RegistryTest.h
│ └── CMakeLists.txt
└── CMakeLists.txt
├── Editor
├── Web
│ ├── .npmrc
│ ├── src
│ │ ├── vite-env.d.ts
│ │ ├── styles
│ │ │ └── globals.css
│ │ ├── qwebchannel.d.ts
│ │ ├── App.tsx
│ │ ├── main.tsx
│ │ └── provider.tsx
│ ├── favicon.ico
│ ├── vercel.json
│ ├── postcss.config.js
│ ├── public
│ │ ├── logo.png
│ │ └── vite.svg
│ ├── tsconfig.node.json
│ ├── vite.config.ts
│ ├── .gitignore
│ ├── tailwind.config.js
│ ├── tsconfig.json
│ ├── index.html
│ └── LICENSE
├── Resource
│ └── ProjectTemplates
│ │ ├── 2D
│ │ └── CMakeLists.txt
│ │ └── 3D
│ │ └── CMakeLists.txt
├── Src
│ ├── Widget
│ │ ├── Editor.cpp
│ │ └── WebWidget.cpp
│ ├── EditorEngine.cpp
│ └── EditorModule.cpp
├── Include
│ └── Editor
│ │ ├── Widget
│ │ ├── Editor.h
│ │ ├── WebWidget.h
│ │ └── GraphicsWidget.h
│ │ ├── EditorModule.h
│ │ ├── EditorEngine.h
│ │ └── WebUIServer.h
└── Shader
│ └── GraphicsWindowSample.esl
├── Tool
├── CMakeLists.txt
└── MirrorTool
│ ├── Test
│ └── MirrorToolInput.h
│ ├── CMakeLists.txt
│ └── Include
│ └── MirrorTool
│ └── Generator.h
├── .gitattributes
├── .github
└── resource
│ ├── Logo.png
│ └── JetBrains.png
├── ThirdParty
└── ConanRecipes
│ ├── vulkan-validationlayers
│ ├── test_package
│ │ ├── test_package.cpp
│ │ ├── conanfile.py
│ │ └── CMakeLists.txt
│ ├── conandata.yml
│ └── patches
│ │ └── 0000-fix-spirv-tools-includes.patch
│ ├── glfw
│ ├── conandata.yml
│ └── test_package
│ │ ├── test_package.cpp
│ │ ├── CMakeLists.txt
│ │ └── conanfile.py
│ ├── molten-vk
│ ├── test_package
│ │ ├── test_package.cpp
│ │ ├── CMakeLists.txt
│ │ └── conanfile.py
│ └── conandata.yml
│ ├── dxc
│ ├── conandata.yml
│ └── test_package
│ │ ├── CMakeLists.txt
│ │ └── conanfile.py
│ ├── vulkan-utility-libraries
│ ├── conandata.yml
│ └── test_package
│ │ ├── test_package.cpp
│ │ ├── CMakeLists.txt
│ │ └── conanfile.py
│ ├── debugbreak
│ ├── test_package
│ │ ├── test_package.cpp
│ │ ├── CMakeLists.txt
│ │ └── conanfile.py
│ ├── conandata.yml
│ └── conanfile.py
│ ├── rapidjson
│ ├── conandata.yml
│ ├── test_package
│ │ ├── CMakeLists.txt
│ │ ├── test_package.cpp
│ │ └── conanfile.py
│ └── conanfile.py
│ ├── assimp
│ ├── conandata.yml
│ └── test_package
│ │ ├── CMakeLists.txt
│ │ ├── test_package.cpp
│ │ └── conanfile.py
│ ├── libclang
│ ├── conandata.yml
│ └── test_package
│ │ ├── CMakeLists.txt
│ │ ├── test_package.cpp
│ │ └── conanfile.py
│ ├── qt
│ ├── debug.py
│ └── test_package
│ │ ├── test_package.cpp
│ │ ├── conanfile.py
│ │ └── CMakeLists.txt
│ └── clipp
│ ├── test_package
│ ├── CMakeLists.txt
│ ├── test_package.cpp
│ └── conanfile.py
│ ├── conandata.yml
│ └── conanfile.py
├── Sample
├── RHI-TexSampling
│ ├── Awesomeface.png
│ └── TexSampling.esl
├── Rendering-BaseTexture
│ ├── Awesomeface.png
│ └── BaseTexture.esl
├── Rendering-Triangle
│ └── Triangle.esl
├── RHI-ParallelCompute
│ └── Compute.esl
├── RHI-Triangle
│ └── Triangle.esl
├── RHI-SSAO
│ └── Shader
│ │ └── Blur.esl
└── Rendering-SSAO
│ └── Shader
│ └── Blur.esl
├── .gitignore
├── CMakeLists.txt
├── .clang-tidy
├── LICENSE
├── conanfile.py
└── CMake
└── Common.cmake
/Engine/Shader/BasePassPS.esl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Engine/Shader/BasePassVS.esl:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Editor/Web/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock=true
--------------------------------------------------------------------------------
/Tool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(MirrorTool)
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | ThirdParty/ConanRecipes/**/* text eol=lf
--------------------------------------------------------------------------------
/Editor/Web/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/Editor/Web/src/styles/globals.css:
--------------------------------------------------------------------------------
1 | @import "tailwindcss";
2 |
3 | @config "../../tailwind.config.js"
--------------------------------------------------------------------------------
/Editor/Web/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/Editor/Web/favicon.ico
--------------------------------------------------------------------------------
/Editor/Web/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "rewrites": [
3 | { "source": "/(.*)", "destination": "/" }
4 | ]
5 | }
--------------------------------------------------------------------------------
/.github/resource/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/.github/resource/Logo.png
--------------------------------------------------------------------------------
/Editor/Web/postcss.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: {
3 | "@tailwindcss/postcss": {},
4 | },
5 | };
--------------------------------------------------------------------------------
/Editor/Web/public/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/Editor/Web/public/logo.png
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-validationlayers/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | int main() {
2 | return 0;
3 | }
--------------------------------------------------------------------------------
/.github/resource/JetBrains.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/.github/resource/JetBrains.png
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/glfw/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "3.4-exp":
3 | commit: "7b6aead9fb88b3623e3b3725ebb42670cbe4c579"
4 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/molten-vk/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | int main(int argc, char* argv[])
2 | {
3 | return 0;
4 | }
5 |
--------------------------------------------------------------------------------
/Sample/RHI-TexSampling/Awesomeface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/Sample/RHI-TexSampling/Awesomeface.png
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/dxc/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.8.2505.1-exp":
3 | commit: "b106a961d09221b3c5bdb37be45b679257da08b8"
4 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/molten-vk/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.4.1-exp":
3 | commit: "db445ff2042d9ce348c439ad8451112f354b8d2a"
4 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-utility-libraries/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.4.313.0-exp":
3 | branch: "vulkan-sdk-1.4.313"
4 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/debugbreak/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(void) {
4 | return 0;
5 | }
6 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/rapidjson/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "cci.20250205-exp":
3 | commit: "24b5e7a8b27f42fa16b96fc70aade9106cf7102f"
4 |
--------------------------------------------------------------------------------
/Sample/Rendering-BaseTexture/Awesomeface.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ExplosionEngine/Explosion/HEAD/Sample/Rendering-BaseTexture/Awesomeface.png
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/assimp/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "6.0.2-exp":
3 | url: "https://github.com/assimp/assimp/archive/refs/tags/v6.0.2.tar.gz"
4 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Src/VmaImport.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Junkang on 2023/6/5.
3 | //
4 |
5 | #define VMA_IMPLEMENTATION
6 | #include
7 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/debugbreak/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.0-exp":
3 | url: "https://github.com/scottt/debugbreak/archive/refs/tags/v1.0.tar.gz"
4 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/libclang/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "21.1.7-exp":
3 | url: "https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-21.1.7.tar.gz"
4 |
--------------------------------------------------------------------------------
/Engine/Source/Test/Include/Test/Test.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/7/28.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Test {}
10 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/glfw/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(void) {
4 | glfwInit();
5 | glfwTerminate();
6 | return 0;
7 | }
8 |
--------------------------------------------------------------------------------
/Editor/Resource/ProjectTemplates/2D/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.25)
2 | project(%{projectName}%)
3 |
4 | include(ExternalProject)
5 | include(GenerateExportHeader)
6 |
--------------------------------------------------------------------------------
/Editor/Resource/ProjectTemplates/3D/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.25)
2 | project(%{projectName}%)
3 |
4 | include(ExternalProject)
5 | include(GenerateExportHeader)
6 |
--------------------------------------------------------------------------------
/Editor/Web/src/qwebchannel.d.ts:
--------------------------------------------------------------------------------
1 | export { QWebChannel } from './qwebchannel.js';
2 |
3 | declare global {
4 | interface Window {
5 | qt: any;
6 | backend: any;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Src/Common.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 13/1/2022.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::DirectX12 {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME RHI
4 | TYPE STATIC
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB Core
8 | )
9 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Test/FileSystemTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/1/3.
3 | //
4 |
5 | #include
6 |
7 | TEST(FileSystemTest, PathTest)
8 | {
9 | // TODO
10 | }
11 |
--------------------------------------------------------------------------------
/Engine/Source/Test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | exp_add_library(
2 | NAME Test
3 | TYPE STATIC
4 | SRC Src/Main.cpp
5 | PUBLIC_INC Include
6 | PUBLIC_LIB Core
7 | PUBLIC_MERGE_LIB GTest::gtest
8 | )
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/RuntimeModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #include
6 |
7 | IMPLEMENT_DYNAMIC_MODULE(RUNTIME_API, Runtime::RuntimeModule)
8 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME RHI-Dummy
4 | TYPE SHARED
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB RHI
8 | )
9 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Src/Gpu.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 12/1/2022.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI {
8 | Gpu::Gpu() = default;
9 |
10 | Gpu::~Gpu() = default;
11 | }
12 |
--------------------------------------------------------------------------------
/Engine/Source/Core/Include/Core/EngineVersion.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/8/16.
3 | //
4 |
5 | #pragma once
6 |
7 | #define ENGINE_VERSION_MAJOR 0
8 | #define ENGINE_VERSION_MINOR 0
9 | #define ENGINE_VERSION_PATCH 1
10 |
--------------------------------------------------------------------------------
/Engine/Source/Render/Src/Scene.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/17.
3 | //
4 |
5 | #include
6 |
7 | namespace Render {
8 | Scene::Scene() = default;
9 |
10 | Scene::~Scene() = default;
11 | }
12 |
--------------------------------------------------------------------------------
/Engine/Source/Launch/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Launch
4 | TYPE STATIC
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB Runtime
8 | PUBLIC_MERGE_LIB glfw::glfw
9 | )
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Client.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/18.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | Client::Client() = default;
9 |
10 | Client::~Client() = default;
11 | }
12 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Component/Primitive.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/24.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | StaticPrimitive::StaticPrimitive() = default;
9 | }
10 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Src/RHIModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/7.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI {
8 | RHIModule::RHIModule() = default;
9 |
10 | RHIModule::~RHIModule() = default;
11 | }
12 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Src/CommandBuffer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 21/2/2022.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI {
8 | CommandBuffer::CommandBuffer() = default;
9 |
10 | CommandBuffer::~CommandBuffer() = default;
11 | }
12 |
--------------------------------------------------------------------------------
/Editor/Src/Widget/Editor.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Kindem on 2025/3/22.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace Editor {
9 | ExplosionEditor::ExplosionEditor() = default;
10 | } // namespace Editor
11 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/qt/debug.py:
--------------------------------------------------------------------------------
1 | from conan.api.conan_api import ConanAPI
2 | from conan.cli.cli import Cli
3 |
4 | if __name__ == '__main__':
5 | api = ConanAPI()
6 | api.command = Cli(api)
7 | api.command.run(["build", ".\conanfile.py", "--version=\"6.10.1-exp\""])
8 |
--------------------------------------------------------------------------------
/Engine/Shader/Platform.esh:
--------------------------------------------------------------------------------
1 | #ifndef __PLATFORM_H__
2 | #define __PLATFORM_H__
3 |
4 | #if VULKAN
5 | #define VkBinding(x, y) [[vk::binding(x, y)]]
6 | #define VkLocation(x) [[vk::location(x)]]
7 | #else
8 | #define VkBinding(x, y)
9 | #define VkLocation(x)
10 | #endif
11 |
12 | #endif
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Component/Scene.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/13.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | SceneHolder::SceneHolder(Render::Scene* inScene)
9 | : scene(inScene)
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/clipp/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(clipp REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE clipp::clipp)
8 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/assimp/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(assimp REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp)
8 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-utility-libraries/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | int main(int argc, char* argv[])
5 | {
6 | vku::safe_VkInstanceCreateInfo safe_info;
7 | return 0;
8 | }
9 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME RHI-DirectX12
4 | TYPE SHARED
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB RHI d3d12
8 | PUBLIC_MERGE_LIB Microsoft::DirectX-Headers dxgi d3dcompiler
9 | )
10 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/libclang/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(libclang REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE libclang::libclang)
8 |
--------------------------------------------------------------------------------
/Editor/Web/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true,
8 | "strict": true
9 | },
10 | "include": ["vite.config.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/Engine/Source/Render/Include/Render/SceneProxy/Primitive.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/24.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Render {
10 | struct PrimitiveSceneProxy {
11 | PrimitiveSceneProxy();
12 |
13 | // TODO
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/debugbreak/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(debugbreak REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE debugbreak::debugbreak)
8 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/rapidjson/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(rapidjson REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE rapidjson::rapidjson)
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # JetBrains
2 | .idea
3 |
4 | # Visual Studio Code
5 | .vscode
6 |
7 | # Binaries
8 | cmake-build*
9 | build*
10 |
11 | # 3rd
12 | ThirdParty/Zip
13 | ThirdParty/Lib
14 | ThirdParty/ConanRecipes/**/src
15 | ThirdParty/ConanRecipes/**/build
16 | ThirdParty/ConanRecipes/**/CMakeUserPresets.json
17 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/RuntimeModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace Runtime {
11 | DECLARE_MIN_MODULE(RUNTIME_API, RuntimeModule, Core::ModuleType::mDynamic)
12 | }
13 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Settings/Game.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/28.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | GameSettings::GameSettings()
9 | : maxLocalPlayerNum(1)
10 | , initialLocalPlayerNum(1)
11 | {
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/clipp/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.2.3-exp":
3 | url: "https://github.com/muellan/clipp/archive/refs/tags/v1.2.3.tar.gz"
4 | patches:
5 | "1.2.3-exp":
6 | - patch_file: patches/0000-fix-cpp23.patch
7 | patch_description: fix build for c++23
8 | patch_type: portability
9 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Component/Camera.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/10/14.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | Camera::Camera()
9 | : perspective(true)
10 | , nearPlane(0.1f)
11 | , fov(90.0f)
12 | {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/libclang/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(void) {
4 | CXIndex index = clang_createIndex(0, 0);
5 | CXTranslationUnit translationUnit = clang_parseTranslationUnit(index, nullptr, nullptr, 0, nullptr, 0, CXTranslationUnit_None);
6 | return 0;
7 | }
8 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-validationlayers/conandata.yml:
--------------------------------------------------------------------------------
1 | sources:
2 | "1.4.313.0-exp":
3 | branch: "vulkan-sdk-1.4.313"
4 | patches:
5 | "1.4.313.0-exp":
6 | - patch_file: patches/0000-fix-spirv-tools-includes.patch
7 | patch_description: fix spir-v tools includes
8 | patch_type: portability
9 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/Widget/Editor.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Kindem on 2025/3/22.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Editor {
10 | class ExplosionEditor final : public QWidget {
11 | Q_OBJECT
12 |
13 | public:
14 | ExplosionEditor();
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Editor/Web/src/App.tsx:
--------------------------------------------------------------------------------
1 | import { Route, Routes } from 'react-router-dom';
2 | import ProjectHubPage from '@/pages/project-hub';
3 |
4 | function App() {
5 | return (
6 |
7 | } path='/project-hub'/>
8 |
9 | );
10 | }
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/rapidjson/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(void) {
4 | const char* json = "{\"a\": true, \"b\": 1, \"c\": \"2\"}";
5 | rapidjson::Document document;
6 | document.Parse(json);
7 | assert(document.IsObject());
8 | return 0;
9 | }
10 |
--------------------------------------------------------------------------------
/Engine/Source/Launch/Src/Main.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/19.
3 | //
4 |
5 | #include
6 |
7 | int main(int argc, char* argv[])
8 | {
9 | Launch::GameApplication app(argc, argv);
10 | while (!app.ShouldClose()) {
11 | app.Tick();
12 | }
13 | return 0;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/Test/Src/Main.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2022/9/5.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | int main(int argc, char* argv[])
9 | {
10 | Core::Cli::Get().Parse(argc, argv);
11 | testing::InitGoogleTest(&argc, argv);
12 | return RUN_ALL_TESTS();
13 | }
14 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Asset/Mesh.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | StaticMesh::StaticMesh(Core::Uri inUri)
9 | : Asset(std::move(inUri))
10 | {
11 | }
12 |
13 | StaticMesh::~StaticMesh() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Component/Light.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/10/14.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | DirectionalLight::DirectionalLight() = default;
9 |
10 | PointLight::PointLight() = default;
11 |
12 | SpotLight::SpotLight() = default;
13 | }
14 |
--------------------------------------------------------------------------------
/Editor/Web/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import react from "@vitejs/plugin-react";
3 | import tsconfigPaths from "vite-tsconfig-paths";
4 | import tailwindcss from "@tailwindcss/vite";
5 |
6 | // https://vitejs.dev/config/
7 | export default defineConfig({
8 | plugins: [react(), tsconfigPaths(), tailwindcss()],
9 | });
10 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Sampler.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummySampler::DummySampler(const SamplerCreateInfo& createInfo)
9 | : Sampler(createInfo)
10 | {
11 | }
12 |
13 | DummySampler::~DummySampler() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Surface.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummySurface::DummySurface(const SurfaceCreateInfo& createInfo)
9 | : Surface(createInfo)
10 | {
11 | }
12 |
13 | DummySurface::~DummySurface() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Test/UtilityTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/5/4.
3 | //
4 |
5 | #include
6 |
7 | #include
8 | using namespace Common;
9 |
10 | TEST(UtilityTest, AlignUpTest)
11 | {
12 | ASSERT_EQ(AlignUp<4>(3), 4);
13 | ASSERT_EQ(AlignUp<4>(7), 8);
14 | ASSERT_EQ(AlignUp<256>(258), 512);
15 | }
16 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/dxc/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(dxc REQUIRED)
5 |
6 | add_definitions(-DPLATFORM_WINDOWS=$,1,0>)
7 |
8 | add_executable(${PROJECT_NAME} test_package.cpp)
9 | target_link_libraries(${PROJECT_NAME} PRIVATE dxc::dxc)
10 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/BindGroup.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyBindGroup::DummyBindGroup(const BindGroupCreateInfo& createInfo)
9 | : BindGroup(createInfo)
10 | {
11 | }
12 |
13 | DummyBindGroup::~DummyBindGroup() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/BufferView.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyBufferView::DummyBufferView(const BufferViewCreateInfo& createInfo)
9 | : BufferView(createInfo)
10 | {
11 | }
12 |
13 | DummyBufferView::~DummyBufferView() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-utility-libraries/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(VulkanUtilityLibraries REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE Vulkan::LayerSettings Vulkan::UtilityHeaders Vulkan::SafeStruct)
8 |
--------------------------------------------------------------------------------
/Engine/Source/Core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Core
4 | TYPE SHARED
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB Common
8 | PUBLIC_MERGE_LIB clipp::clipp
9 | )
10 |
11 | file(GLOB test_sources Test/*.cpp)
12 | exp_add_test(
13 | NAME Core.Test
14 | SRC ${test_sources}
15 | LIB Core
16 | )
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/TextureView.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyTextureView::DummyTextureView(const TextureViewCreateInfo& createInfo)
9 | : TextureView(createInfo)
10 | {
11 | }
12 |
13 | DummyTextureView::~DummyTextureView() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/Mirror/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Mirror
4 | TYPE SHARED
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB Common
8 | )
9 |
10 | file(GLOB test_sources Test/*.cpp)
11 | exp_add_test(
12 | NAME Mirror.Test
13 | SRC ${test_sources}
14 | LIB Mirror
15 | INC Test
16 | REFLECT Test
17 | )
18 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Asset/Level.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/19.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | Level::Level(Core::Uri inUri)
9 | : Asset(std::move(inUri))
10 | {
11 | }
12 |
13 | Level::~Level() = default;
14 |
15 | ECArchive& Level::GetArchive()
16 | {
17 | return archive;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/PipelineLayout.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyPipelineLayout::DummyPipelineLayout(const PipelineLayoutCreateInfo& createInfo)
9 | : PipelineLayout(createInfo)
10 | {
11 | }
12 |
13 | DummyPipelineLayout::~DummyPipelineLayout() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/assimp/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | int main(int argc, char **argv) {
6 | Assimp::Importer importer;
7 | const aiScene* scene = importer.ReadFile("", aiProcess_CalcTangentSpace | aiProcess_Triangulate | aiProcess_JoinIdenticalVertices | aiProcess_SortByPType);
8 | return 0;
9 | }
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/BindGroupLayout.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyBindGroupLayout::DummyBindGroupLayout(const BindGroupLayoutCreateInfo& createInfo)
9 | : BindGroupLayout(createInfo)
10 | {
11 | }
12 |
13 | DummyBindGroupLayout::~DummyBindGroupLayout() = default;
14 | }
15 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Meta.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/28.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace Runtime {
11 | struct RUNTIME_API MetaPresets {
12 | static constexpr const auto* globalComp = "globalComp";
13 | static constexpr const auto* gameReadOnly = "gameReadOnly";
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/SystemGraphPresets.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/13.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace Runtime {
11 | class RUNTIME_API SystemGraphPresets {
12 | public:
13 | static const SystemGraph& Default3DWorld();
14 |
15 | SystemGraphPresets() = delete;
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/GameModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/24.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Runtime {
10 | struct RUNTIME_API GameModule : EngineModule { // NOLINT
11 | Engine* CreateEngine(const EngineInitParams& inParams) override = 0;
12 |
13 | virtual std::string_view GetGameName() const = 0;
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Test/RuntimeTestModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/22.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | class RuntimeTestModule final : public Runtime::EngineModule {
10 | public:
11 | void OnUnload() override;
12 | Core::ModuleType Type() const override;
13 | Runtime::Engine* CreateEngine(const Runtime::EngineInitParams& inParams) override;
14 | };
15 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Sampler.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummySampler final : public Sampler {
11 | public:
12 | NonCopyable(DummySampler)
13 | explicit DummySampler(const SamplerCreateInfo& createInfo);
14 | ~DummySampler() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Surface.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummySurface final : public Surface {
11 | public:
12 | NonCopyable(DummySurface)
13 | explicit DummySurface(const SurfaceCreateInfo& createInfo);
14 | ~DummySurface() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Include/RHI/RHIModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/7.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI {
11 | class RHIModule : public Core::Module {
12 | public:
13 | ~RHIModule() override;
14 | virtual Instance* GetRHIInstance() = 0;
15 |
16 | protected:
17 | RHIModule();
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/CommandBuffer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace RHI::Dummy {
9 | DummyCommandBuffer::DummyCommandBuffer() = default;
10 |
11 | Common::UniquePtr DummyCommandBuffer::Begin()
12 | {
13 | return { new DummyCommandRecorder(*this) };
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/BindGroup.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyBindGroup final : public BindGroup {
11 | public:
12 | NonCopyable(DummyBindGroup)
13 | explicit DummyBindGroup(const BindGroupCreateInfo& createInfo);
14 | ~DummyBindGroup() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Viewport.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/18.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | Viewport::~Viewport() = default;
9 |
10 | Viewport::Viewport() = default;
11 |
12 | PresentInfo::PresentInfo()
13 | : backTexture(nullptr)
14 | , imageReadySemaphore(nullptr)
15 | , renderFinishedSemaphore(nullptr)
16 | {
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Editor/Web/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | !.vscode/extensions.json
17 | .idea
18 | .DS_Store
19 | *.suo
20 | *.ntvs*
21 | *.njsproj
22 | *.sln
23 | *.sw?
24 |
25 |
26 | pnpm-lock.yaml
27 | yarn.lock
28 | package-lock.json
29 | bun.lockb
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/qt/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | QApplication app(argc, argv);
8 |
9 | QWebEngineView view;
10 | view.load(QUrl("https://qt-project.org/"));
11 | view.resize(1024, 768);
12 |
13 | QTimer::singleShot(100, []() -> void { QApplication::quit(); });
14 | return app.exec();
15 | }
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/BufferView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyBufferView final : public BufferView {
11 | public:
12 | NonCopyable(DummyBufferView)
13 | explicit DummyBufferView(const BufferViewCreateInfo& createInfo);
14 | ~DummyBufferView() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/CommandBuffer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyCommandBuffer final : public CommandBuffer {
11 | public:
12 | NonCopyable(DummyCommandBuffer)
13 | DummyCommandBuffer();
14 |
15 | Common::UniquePtr Begin() override;
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Client.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/18.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Runtime {
10 | class World;
11 |
12 | class Client {
13 | public:
14 | virtual ~Client();
15 |
16 | virtual World& GetWorld() = 0;
17 | virtual Viewport& GetViewport() = 0;
18 |
19 | protected:
20 | Client();
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/EditorModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Editor {
10 | class EditorModule final : public Runtime::EngineModule {
11 | public:
12 | void OnUnload() override;
13 | ::Core::ModuleType Type() const override;
14 | Runtime::Engine* CreateEngine(const Runtime::EngineInitParams&) override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/TextureView.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyTextureView final : public TextureView {
11 | public:
12 | NonCopyable(DummyTextureView)
13 | explicit DummyTextureView(const TextureViewCreateInfo& createInfo);
14 | ~DummyTextureView() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/Common/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Common
4 | TYPE STATIC
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_MERGE_LIB rapidjson::rapidjson debugbreak::debugbreak cityhash::cityhash Taskflow::Taskflow
8 | )
9 |
10 | file(GLOB test_sources Test/*.cpp)
11 | exp_add_test(
12 | NAME Common.Test
13 | INC Test
14 | SRC ${test_sources}
15 | LIB Common
16 | )
17 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Src/Serialization.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/7/13.
3 | //
4 |
5 | #include
6 |
7 | namespace Common {
8 | BinarySerializeStream::BinarySerializeStream() = default;
9 |
10 | BinarySerializeStream::~BinarySerializeStream() = default;
11 |
12 | BinaryDeserializeStream::BinaryDeserializeStream() = default;
13 |
14 | BinaryDeserializeStream::~BinaryDeserializeStream() = default;
15 | }
16 |
--------------------------------------------------------------------------------
/Engine/Source/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (${BUILD_TEST})
2 | add_subdirectory(Test)
3 | endif()
4 |
5 | add_subdirectory(Common)
6 | add_subdirectory(Core)
7 | add_subdirectory(Mirror)
8 |
9 | add_subdirectory(RHI)
10 | add_subdirectory(RHI-Dummy)
11 | add_subdirectory(RHI-Vulkan)
12 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
13 | add_subdirectory(RHI-DirectX12)
14 | endif()
15 |
16 | add_subdirectory(Render)
17 | add_subdirectory(Runtime)
18 | add_subdirectory(Launch)
19 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Queue.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyQueue::DummyQueue() = default;
9 |
10 | DummyQueue::~DummyQueue() = default;
11 |
12 | void DummyQueue::Submit(RHI::CommandBuffer* commandBuffer, const QueueSubmitInfo& submitInfo)
13 | {
14 | }
15 |
16 | void DummyQueue::Flush(RHI::Fence* fenceToSignal)
17 | {
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/PipelineLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyPipelineLayout final : public PipelineLayout {
11 | public:
12 | NonCopyable(DummyPipelineLayout)
13 | explicit DummyPipelineLayout(const PipelineLayoutCreateInfo& createInfo);
14 | ~DummyPipelineLayout() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/BindGroupLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyBindGroupLayout final : public BindGroupLayout {
11 | public:
12 | NonCopyable(DummyBindGroupLayout)
13 | explicit DummyBindGroupLayout(const BindGroupLayoutCreateInfo& createInfo);
14 | ~DummyBindGroupLayout() override;
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Src/IO.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/6/6.
3 | //
4 |
5 | #include
6 |
7 | namespace Common {
8 | ScopedCoutFlusher::ScopedCoutFlusher() = default;
9 |
10 | ScopedCoutFlusher::~ScopedCoutFlusher()
11 | {
12 | std::cout << std::flush;
13 | }
14 |
15 | ScopedCerrFlusher::ScopedCerrFlusher() = default;
16 |
17 | ScopedCerrFlusher::~ScopedCerrFlusher()
18 | {
19 | std::cerr << std::flush;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Sample/Rendering-Triangle/Triangle.esl:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #if VERTEX_SHADER
4 | float4 VSMain(
5 | VkLocation(0) float4 position : POSITION) : SV_POSITION
6 | {
7 | float4 pos = position;
8 | #if VULKAN
9 | pos.y = - pos.y;
10 | #endif
11 | return pos;
12 | }
13 | #endif
14 |
15 | #if PIXEL_SHADER
16 | cbuffer psUniform {
17 | float3 pixelColor;
18 | };
19 |
20 | float4 PSMain() : SV_TARGET
21 | {
22 | return float4(pixelColor, 1.0f);
23 | }
24 | #endif
25 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/ShaderModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyShaderModule::DummyShaderModule(const ShaderModuleCreateInfo& createInfo)
9 | : ShaderModule(createInfo)
10 | {
11 | }
12 |
13 | DummyShaderModule::~DummyShaderModule() = default;
14 |
15 | const std::string& DummyShaderModule::GetEntryPoint()
16 | {
17 | return entryPoint;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB_RECURSE sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Runtime
4 | TYPE SHARED
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | REFLECT Include
8 | PUBLIC_LIB Core Mirror Render
9 | PUBLIC_MERGE_LIB assimp::assimp
10 | )
11 |
12 | file(GLOB test_sources Test/*.cpp)
13 | exp_add_test(
14 | NAME Runtime.Test
15 | SRC ${test_sources}
16 | LIB Runtime
17 | INC Test
18 | REFLECT Test
19 | DEP_TARGET RHI-Dummy
20 | )
21 |
--------------------------------------------------------------------------------
/Editor/Web/tailwind.config.js:
--------------------------------------------------------------------------------
1 | import {heroui} from "@heroui/theme"
2 |
3 | /** @type {import('tailwindcss').Config} */
4 | export default {
5 | content: [
6 | "./index.html",
7 | './src/layouts/**/*.{js,ts,jsx,tsx,mdx}',
8 | './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
9 | './src/components/**/*.{js,ts,jsx,tsx,mdx}',
10 | "./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}",
11 | ],
12 | theme: {
13 | extend: {},
14 | },
15 | darkMode: "class",
16 | plugins: [heroui()],
17 | }
18 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Component/Primitive.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/24.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace Runtime {
13 | struct RUNTIME_API EClass() StaticPrimitive final {
14 | EClassBody(StaticPrimitive)
15 |
16 | StaticPrimitive();
17 |
18 | EProperty() AssetPtr mesh;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Src/Surface.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::DirectX12 {
8 | DX12Surface::DX12Surface(const SurfaceCreateInfo& inCreateInfo)
9 | : Surface(inCreateInfo)
10 | , hWnd(static_cast(inCreateInfo.window))
11 | {
12 | }
13 |
14 | DX12Surface::~DX12Surface() = default;
15 |
16 | HWND DX12Surface::GetNative() const
17 | {
18 | return hWnd;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Include/RHI/CommandBuffer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 21/2/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI {
11 | class CommandRecorder;
12 |
13 | class CommandBuffer {
14 | public:
15 | NonCopyable(CommandBuffer)
16 | virtual ~CommandBuffer();
17 |
18 | virtual Common::UniquePtr Begin() = 0;
19 |
20 | protected:
21 | CommandBuffer();
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Src/Surface.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI {
8 | SurfaceCreateInfo::SurfaceCreateInfo(void* inWindow)
9 | : window(inWindow)
10 | {
11 | }
12 |
13 | SurfaceCreateInfo& SurfaceCreateInfo::SetWindow(void* inWindow)
14 | {
15 | window = inWindow;
16 | return *this;
17 | }
18 |
19 | Surface::Surface(const SurfaceCreateInfo&) {}
20 |
21 | Surface::~Surface() = default;
22 | }
23 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/glfw/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(glfw REQUIRED)
5 |
6 | if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
7 | set(platform_ext_libs
8 | "-framework Cocoa"
9 | "-framework IOKit"
10 | "-framework CoreFoundation")
11 | endif()
12 |
13 | add_executable(${PROJECT_NAME} test_package.cpp)
14 | target_link_libraries(${PROJECT_NAME} PRIVATE glfw::glfw ${platform_ext_libs})
15 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/EditorEngine.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Editor {
10 | class EditorEngine final : public Runtime::Engine {
11 | public:
12 | ~EditorEngine() override;
13 |
14 | bool IsEditor() override;
15 |
16 | private:
17 | friend class EditorModule;
18 |
19 | explicit EditorEngine(const Runtime::EngineInitParams& inParams);
20 | };
21 |
22 | EditorEngine& GetEditorEngine();
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Test/FileTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/7/8.
3 | //
4 |
5 | #include
6 | #include
7 | #include
8 |
9 | TEST(FileTest, ReadWriteTextFileTest)
10 | {
11 | static Common::Path file = "../Test/Generated/Common/ReadTextFileTest.txt";
12 |
13 | Common::FileUtils::WriteTextFile(file.Absolute().String(), "hello");
14 | const std::string content = Common::FileUtils::ReadTextFile(file.Absolute().String());
15 | ASSERT_EQ(content, "hello");
16 | }
17 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Queue.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyQueue final : public Queue {
11 | public:
12 | NonCopyable(DummyQueue)
13 | DummyQueue();
14 | ~DummyQueue() override;
15 |
16 | void Submit(RHI::CommandBuffer* commandBuffer, const RHI::QueueSubmitInfo& submitInfo) override;
17 | void Flush(RHI::Fence* fenceToSignal) override;
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Texture.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyTexture final : public Texture {
11 | public:
12 | NonCopyable(DummyTexture)
13 | explicit DummyTexture(const TextureCreateInfo& createInfo);
14 | ~DummyTexture() override;
15 |
16 | Common::UniquePtr CreateTextureView(const TextureViewCreateInfo& createInfo) override;
17 | };
18 | }
19 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Component/Scene.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/13.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace Runtime {
13 | struct RUNTIME_API EClass(globalComp, transient) SceneHolder final {
14 | EClassBody(SceneHolder)
15 |
16 | explicit SceneHolder(Render::Scene* inScene);
17 |
18 | RenderThreadPtr scene;
19 | };
20 | }
21 |
--------------------------------------------------------------------------------
/Sample/RHI-ParallelCompute/Compute.esl:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | // spir-v treat vec2 and vec4 as built-in type?
4 | struct Data {
5 | float4 v1;
6 | float4 v2;
7 | };
8 |
9 | VkBinding(0, 0) StructuredBuffer input : register(t0);
10 |
11 | VkBinding(1, 0) RWStructuredBuffer output : register(u0);
12 |
13 | [numthreads(32, 1, 1)]
14 | void CSMain(uint3 id : SV_DispatchThreadID) {
15 | output[id.x].v1 = input[id.x].v1 * input[id.x].v1;
16 | output[id.x].v2 = input[id.x].v2 * input[id.x].v2;
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Include/RHI/DirectX12/Surface.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 |
11 | namespace RHI::DirectX12 {
12 | class DX12Surface final : public Surface {
13 | public:
14 | NonCopyable(DX12Surface)
15 | explicit DX12Surface(const SurfaceCreateInfo& inCreateInfo);
16 | ~DX12Surface() override;
17 |
18 | HWND GetNative() const;
19 |
20 | private:
21 | HWND hWnd;
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Src/Component/Player.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/13.
3 | //
4 |
5 | #include
6 |
7 | namespace Runtime {
8 | PlayersInfo::PlayersInfo() = default;
9 |
10 | LocalPlayer::LocalPlayer()
11 | : localPlayerIndex(0)
12 | , viewState(nullptr)
13 | {
14 | }
15 |
16 | #if BUILD_EDITOR
17 | EditorPlayer::EditorPlayer()
18 | : viewState(nullptr)
19 | {
20 | }
21 | #endif
22 |
23 | PlayerStart::PlayerStart() = default;
24 | } // namespace Runtime
25 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Include/Common/Math/Math.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Kindem on 2025/8/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
--------------------------------------------------------------------------------
/Editor/Src/EditorEngine.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #include
6 |
7 | namespace Editor {
8 | EditorEngine::~EditorEngine() = default;
9 |
10 | bool EditorEngine::IsEditor()
11 | {
12 | return true;
13 | }
14 |
15 | EditorEngine::EditorEngine(const Runtime::EngineInitParams& inParams)
16 | : Engine(inParams)
17 | {
18 | }
19 |
20 | EditorEngine& GetEditorEngine()
21 | {
22 | return static_cast(Runtime::EngineHolder::Get());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Src/Platform.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/12/21.
3 | //
4 |
5 | #if PLATFORM_WINDOWS
6 | #include
7 | #else
8 | #include
9 | #endif
10 |
11 | #include
12 | #include
13 |
14 | namespace Common {
15 | void PlatformUtils::SetEnvVar(const std::string& inKey, const std::string& inValue)
16 | {
17 | #if PLATFORM_WINDOWS
18 | Assert(SetEnvironmentVariableA(inKey.c_str(), inValue.c_str()));
19 | #else
20 | setenv(inKey.c_str(), inValue.c_str(), 1);
21 | #endif
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/DummyRHIModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/7.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI::Dummy {
11 | class RHI_DUMMY_API DummyRHIModule final : public RHIModule {
12 | public:
13 | DummyRHIModule();
14 | ~DummyRHIModule() override;
15 |
16 | void OnLoad() override;
17 | void OnUnload() override;
18 | Core::ModuleType Type() const override;
19 | Instance* GetRHIInstance() override;
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/ShaderModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyShaderModule final : public ShaderModule {
11 | public:
12 | NonCopyable(DummyShaderModule)
13 | explicit DummyShaderModule(const ShaderModuleCreateInfo& createInfo);
14 | ~DummyShaderModule() override;
15 |
16 | const std::string & GetEntryPoint() override;
17 |
18 | private:
19 | std::string entryPoint;
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Include/RHI/Vulkan/VulkanRHIModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/7.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI::Vulkan {
11 | class RHI_VULKAN_API VulkanRHIModule final : public RHIModule {
12 | public:
13 | VulkanRHIModule();
14 | ~VulkanRHIModule() override;
15 |
16 | void OnLoad() override;
17 | void OnUnload() override;
18 | Core::ModuleType Type() const override;
19 | Instance* GetRHIInstance() override;
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Test/RuntimeTestModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/22.
3 | //
4 |
5 | #include
6 |
7 | void RuntimeTestModule::OnUnload()
8 | {
9 | Runtime::EngineHolder::Unload();
10 | }
11 |
12 | Core::ModuleType RuntimeTestModule::Type() const
13 | {
14 | return Core::ModuleType::mStatic;
15 | }
16 |
17 | Runtime::Engine* RuntimeTestModule::CreateEngine(const Runtime::EngineInitParams& inParams)
18 | {
19 | return new Runtime::MinEngine(inParams);
20 | }
21 |
22 | IMPLEMENT_STATIC_MODULE(RuntimeTest, "RuntimeTest", RuntimeTestModule)
23 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/Widget/WebWidget.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/8/9.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace Editor {
11 | class WebWidget : public QWebEngineView {
12 | Q_OBJECT
13 |
14 | public:
15 | explicit WebWidget(QWidget* inParent = nullptr);
16 | ~WebWidget() override;
17 |
18 | void Load(const std::string& inUrl);
19 |
20 | protected:
21 | QWebChannel* GetWebChannel() const;
22 |
23 | private:
24 | QWebChannel* webChannel;
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/Editor/Web/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom/client';
3 | import { BrowserRouter } from 'react-router-dom';
4 |
5 | import App from './App.tsx';
6 | import { Provider } from './provider.tsx';
7 | import '@/styles/globals.css';
8 |
9 | ReactDOM.createRoot(document.getElementById('root')!).render(
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | ,
19 | );
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Include/RHI/DirectX12/DX12RHIModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/8/7.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI::DirectX12 {
11 | class RHI_DIRECTX12_API DX12RHIModule final : public RHIModule {
12 | public:
13 | DX12RHIModule();
14 | ~DX12RHIModule() override;
15 |
16 | void OnLoad() override;
17 | void OnUnload() override;
18 | Core::ModuleType Type() const override;
19 | Instance* GetRHIInstance() override;
20 | };
21 | }
22 |
--------------------------------------------------------------------------------
/Editor/Web/src/provider.tsx:
--------------------------------------------------------------------------------
1 | import type { NavigateOptions } from 'react-router-dom';
2 |
3 | import { HeroUIProvider } from '@heroui/system';
4 | import { useHref, useNavigate } from 'react-router-dom';
5 |
6 | declare module '@react-types/shared' {
7 | interface RouterConfig {
8 | routerOptions: NavigateOptions;
9 | }
10 | }
11 |
12 | export function Provider({ children }: { children: React.ReactNode }) {
13 | const navigate = useNavigate();
14 |
15 | return (
16 |
17 | {children}
18 |
19 | );
20 | }
21 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Texture.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace RHI::Dummy {
9 | DummyTexture::DummyTexture(const TextureCreateInfo& createInfo)
10 | : Texture(createInfo)
11 | {
12 | }
13 |
14 | DummyTexture::~DummyTexture() = default;
15 |
16 | Common::UniquePtr DummyTexture::CreateTextureView(const TextureViewCreateInfo& createInfo)
17 | {
18 | return Common::UniquePtr(new DummyTextureView(createInfo));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Asset/Level.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/19.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace Runtime {
13 | class RUNTIME_API EClass() Level final : public Asset {
14 | EPolyClassBody(Level)
15 |
16 | public:
17 | explicit Level(Core::Uri inUri);
18 | ~Level() override;
19 |
20 | EFunc() ECArchive& GetArchive();
21 |
22 | private:
23 | EProperty() ECArchive archive;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Pipeline.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::Dummy {
8 | DummyComputePipeline::DummyComputePipeline(const ComputePipelineCreateInfo& createInfo)
9 | : ComputePipeline(createInfo)
10 | {
11 | }
12 |
13 | DummyComputePipeline::~DummyComputePipeline() = default;
14 |
15 | DummyRasterPipeline::DummyRasterPipeline(const RasterPipelineCreateInfo& createInfo)
16 | : RasterPipeline(createInfo)
17 | {
18 | }
19 |
20 | DummyRasterPipeline::~DummyRasterPipeline() = default;
21 | }
22 |
--------------------------------------------------------------------------------
/Sample/RHI-Triangle/Triangle.esl:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | struct FragmentInput {
4 | float4 position : SV_POSITION;
5 | float4 color : COLOR;
6 | };
7 |
8 | FragmentInput VSMain(
9 | VkLocation(0) float4 position : POSITION,
10 | VkLocation(1) float4 color : COLOR)
11 | {
12 | FragmentInput fragmentInput;
13 | fragmentInput.position = position;
14 | #if VULKAN
15 | fragmentInput.position.y = - fragmentInput.position.y;
16 | #endif
17 | fragmentInput.color = color;
18 | return fragmentInput;
19 | }
20 |
21 | float4 PSMain(FragmentInput input) : SV_TARGET
22 | {
23 | return input.color;
24 | }
--------------------------------------------------------------------------------
/Engine/Source/Launch/Src/GameClient.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/19.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace Launch {
9 | GameClient::GameClient(GameViewport& inViewport)
10 | : viewport(inViewport)
11 | , world("GameWorld", this, Runtime::PlayType::game)
12 | {
13 | }
14 |
15 | GameClient::~GameClient() = default;
16 |
17 | Runtime::Viewport& GameClient::GetViewport()
18 | {
19 | return viewport;
20 | }
21 |
22 | Runtime::World& GameClient::GetWorld()
23 | {
24 | return world;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Engine/Source/Launch/Include/Launch/GameClient.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/19.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace Launch {
11 | class GameViewport;
12 |
13 | class GameClient final : public Runtime::Client {
14 | public:
15 | explicit GameClient(GameViewport& inViewport);
16 | ~GameClient() override;
17 |
18 | Runtime::Viewport& GetViewport() override;
19 | Runtime::World& GetWorld() override;
20 |
21 | private:
22 | GameViewport& viewport;
23 | Runtime::World world;
24 | };
25 | }
26 |
--------------------------------------------------------------------------------
/Engine/Source/Render/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME Render.Static
4 | TYPE STATIC
5 | SRC ${sources}
6 | PUBLIC_INC Include
7 | PUBLIC_LIB Core RHI
8 | PUBLIC_MERGE_LIB dxc::dxc spirv-cross::spirv-cross
9 | )
10 |
11 | file(GLOB shader_sources SharedSrc/*.cpp)
12 | exp_add_library(
13 | NAME Render
14 | TYPE SHARED
15 | SRC ${shader_sources}
16 | PUBLIC_LIB Render.Static
17 | )
18 |
19 | file(GLOB test_sources Test/*.cpp)
20 | exp_add_test(
21 | NAME Render.Test
22 | SRC ${test_sources}
23 | LIB RHI Render.Static
24 | DEP_TARGET RHI-Dummy
25 | )
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/clipp/test_package/test_package.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | using namespace clipp;
5 | using std::cout;
6 | using std::string;
7 |
8 | int main(int argc, char* argv[]) {
9 | bool rec = false, utf16 = false;
10 | string infile = "", fmt = "csv";
11 |
12 | auto cli = (
13 | value("input file", infile),
14 | option("-r", "--recursive").set(rec).doc("convert files recursively"),
15 | option("-o") & value("output format", fmt),
16 | option("-utf16").set(utf16).doc("use UTF-16 encoding")
17 | );
18 |
19 | parse(argc, argv, cli);
20 | return 0;
21 | }
22 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Include/RHI/Surface.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI {
10 | struct SurfaceCreateInfo {
11 | // Windows: HWND
12 | // macOS: NSView*
13 | void* window;
14 |
15 | explicit SurfaceCreateInfo(void* inWindow = nullptr);
16 | SurfaceCreateInfo& SetWindow(void* inWindow);
17 | };
18 |
19 | class Surface {
20 | public:
21 | NonCopyable(Surface)
22 | virtual ~Surface();
23 |
24 | protected:
25 | explicit Surface(const SurfaceCreateInfo& createInfo);
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/Editor/Src/EditorModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/8/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace Editor {
9 | void EditorModule::OnUnload()
10 | {
11 | Runtime::EngineHolder::Unload();
12 | }
13 |
14 | ::Core::ModuleType EditorModule::Type() const
15 | {
16 | return ::Core::ModuleType::mStatic;
17 | }
18 |
19 | Runtime::Engine* EditorModule::CreateEngine(const Runtime::EngineInitParams& inParams)
20 | {
21 | return new EditorEngine(inParams);
22 | }
23 | }
24 |
25 | IMPLEMENT_STATIC_MODULE(Editor, "Editor", Editor::EditorModule)
26 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Include/Common/File.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2022/7/25.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 |
11 | namespace Common {
12 | class FileUtils {
13 | public:
14 | static std::string ReadTextFile(const std::string& inFileName);
15 | static void WriteTextFile(const std::string& inFileName, const std::string& inContent);
16 | static rapidjson::Document ReadJsonFile(const std::string& inFileName);
17 | static void WriteJsonFile(const std::string& inFileName, const rapidjson::Document& inJsonDocument, bool inPretty = true);
18 | };
19 | }
20 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Src/Device.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 15/1/2022.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI {
8 | QueueRequestInfo::QueueRequestInfo(const QueueType inType, const uint8_t inNum)
9 | : type(inType)
10 | , num(inNum)
11 | {
12 | }
13 |
14 | DeviceCreateInfo::DeviceCreateInfo() = default;
15 |
16 | DeviceCreateInfo& DeviceCreateInfo::AddQueueRequest(const QueueRequestInfo& inQueue)
17 | {
18 | queueRequests.emplace_back(inQueue);
19 | return *this;
20 | }
21 |
22 | Device::Device(const DeviceCreateInfo&) {}
23 |
24 | Device::~Device() = default;
25 | }
26 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Component/Camera.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/10/14.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 | namespace Runtime {
13 | struct RUNTIME_API EClass(transient) Camera final {
14 | EClassBody(Camera)
15 |
16 | Camera();
17 |
18 | EProperty() bool perspective;
19 | EProperty() float nearPlane;
20 | EProperty() std::optional farPlane;
21 | // only need when perspective
22 | EProperty() std::optional fov;
23 | };
24 |
25 | // TODO scene capture
26 | }
27 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/WebUIServer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/8/8.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 | namespace Editor {
13 | class WebUIServer {
14 | public:
15 | static WebUIServer& Get();
16 |
17 | void Start();
18 | void Stop();
19 | const std::string& BaseUrl() const;
20 |
21 | private:
22 | WebUIServer();
23 |
24 | std::string baseUrl;
25 | Common::UniquePtr productServerThread;
26 | Common::UniquePtr productServer;
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/Tool/MirrorTool/Test/MirrorToolInput.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2022/12/12.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | enum class EEnum() TestEnum {
10 | a,
11 | b,
12 | max
13 | };
14 |
15 | EProperty()
16 | int gv0;
17 |
18 | EProperty()
19 | float gv1;
20 |
21 | EFunc()
22 | int gf0(int a, int b) {
23 | return a + b;
24 | }
25 |
26 | struct EClass() C0 {
27 | public:
28 | EProperty()
29 | static int sv0;
30 |
31 | EProperty(editorHide)
32 | int v0;
33 |
34 | EProperty()
35 | float v1;
36 |
37 | EFunc()
38 | static void sf0() {}
39 |
40 | EFunc()
41 | int f0() { return 0; }
42 | };
43 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Gpu.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI::Dummy {
11 | class DummyGpu final : public Gpu {
12 | public:
13 | NonCopyable(DummyGpu)
14 | explicit DummyGpu(DummyInstance& inInstance);
15 | ~DummyGpu() override;
16 | GpuProperty GetProperty() override;
17 | Common::UniquePtr RequestDevice(const DeviceCreateInfo& createInfo) override;
18 | DummyInstance& GetInstance() const override;
19 |
20 | private:
21 | DummyInstance& instance;
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/molten-vk/test_package/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.15)
2 | project(test_package LANGUAGES CXX)
3 |
4 | find_package(MoltenVK REQUIRED)
5 |
6 | add_executable(${PROJECT_NAME} test_package.cpp)
7 | target_link_libraries(${PROJECT_NAME} PRIVATE molten-vk::molten-vk)
8 | add_custom_command(
9 | TARGET ${PROJECT_NAME} POST_BUILD
10 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MoltenVK_INCLUDE_DIR}/../lib/libMoltenVK.dylib $/libMoltenVK.dylib
11 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MoltenVK_INCLUDE_DIR}/../lib/MoltenVK_icd.json $/MoltenVK_icd.json
12 | )
13 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Instance.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyGpu;
11 |
12 | extern Instance* gInstance;
13 |
14 | class DummyInstance final : public Instance {
15 | public:
16 | NonCopyable(DummyInstance)
17 | DummyInstance();
18 | ~DummyInstance() override;
19 | RHIType GetRHIType() override;
20 | uint32_t GetGpuNum() override;
21 | Gpu* GetGpu(uint32_t index) override;
22 | void Destroy() override;
23 |
24 | private:
25 | Common::UniquePtr dummyGpu;
26 | };
27 | }
28 |
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Include/Runtime/Settings/Game.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/2/28.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 |
11 | namespace Runtime {
12 | class RUNTIME_API EClass(gameReadOnly) GameSettings {
13 | public:
14 | EClassBody(GameSettings)
15 |
16 | GameSettings();
17 |
18 | EProperty(category=Player) uint8_t maxLocalPlayerNum;
19 | EProperty(category=Player) uint8_t initialLocalPlayerNum;
20 |
21 | EProperty(category=Map) Core::Uri editorStartupLevel;
22 | EProperty(category=Map) Core::Uri gameStartupLevel;
23 |
24 | // TODO more
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Buffer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | namespace RHI::Dummy {
11 | class DummyBuffer final : public Buffer {
12 | public:
13 | NonCopyable(DummyBuffer)
14 | explicit DummyBuffer(const BufferCreateInfo& createInfo);
15 | ~DummyBuffer() override;
16 |
17 | void* Map(MapMode mapMode, size_t offset, size_t length) override;
18 | void UnMap() override;
19 | Common::UniquePtr CreateBufferView(const BufferViewCreateInfo& createInfo) override;
20 | private:
21 | std::vector dummyData;
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Gpu.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace RHI::Dummy {
9 | DummyGpu::DummyGpu(DummyInstance& inInstance)
10 | : instance(inInstance)
11 | {
12 | }
13 |
14 | DummyGpu::~DummyGpu() = default;
15 |
16 | GpuProperty DummyGpu::GetProperty()
17 | {
18 | return {};
19 | }
20 |
21 | Common::UniquePtr DummyGpu::RequestDevice(const DeviceCreateInfo& createInfo)
22 | {
23 | return { new DummyDevice(*this, createInfo) };
24 | }
25 |
26 | DummyInstance& DummyGpu::GetInstance() const
27 | {
28 | return instance;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Pipeline.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyComputePipeline final : public ComputePipeline {
11 | public:
12 | NonCopyable(DummyComputePipeline)
13 | explicit DummyComputePipeline(const ComputePipelineCreateInfo& createInfo);
14 | ~DummyComputePipeline() override;
15 | };
16 |
17 | class DummyRasterPipeline final : public RasterPipeline {
18 | public:
19 | NonCopyable(DummyRasterPipeline)
20 | explicit DummyRasterPipeline(const RasterPipelineCreateInfo& createInfo);
21 | ~DummyRasterPipeline() override;
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Include/RHI/DirectX12/ShaderModule.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 16/3/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 |
11 | namespace RHI::DirectX12 {
12 | class DX12ShaderModule final : public ShaderModule {
13 | public:
14 | NonCopyable(DX12ShaderModule)
15 | explicit DX12ShaderModule(const ShaderModuleCreateInfo& inCreateInfo);
16 | ~DX12ShaderModule() override;
17 |
18 | const std::string& GetEntryPoint() override;
19 |
20 | const D3D12_SHADER_BYTECODE& GetNative() const;
21 |
22 | private:
23 | CD3DX12_SHADER_BYTECODE nativeShaderBytecode;
24 | std::string entryPoint;
25 | };
26 | }
27 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Include/RHI/Vulkan/Sampler.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Zach Lee on 2022/3/6.
3 | //
4 |
5 |
6 | #pragma once
7 |
8 | #include
9 | #include
10 | #include
11 |
12 | namespace RHI::Vulkan {
13 | class VulkanDevice;
14 |
15 | class VulkanSampler final : public Sampler {
16 | public:
17 | NonCopyable(VulkanSampler)
18 | VulkanSampler(VulkanDevice& inDevice, const SamplerCreateInfo& inCreateInfo);
19 | ~VulkanSampler() override;
20 |
21 | VkSampler GetNative() const;
22 |
23 | private:
24 | void CreateSampler(const SamplerCreateInfo& inCreateInfo);
25 |
26 | VulkanDevice& device;
27 | VkSampler nativeSampler;
28 | };
29 | }
--------------------------------------------------------------------------------
/Engine/Source/Runtime/Test/AssetTest.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/10/16.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | using namespace Common;
10 | using namespace Runtime;
11 |
12 | struct EClass() TestAsset : public Asset {
13 | EClassBody(TestAsset)
14 |
15 | explicit TestAsset(Core::Uri uri)
16 | : Asset(std::move(uri))
17 | , a(0)
18 | , b()
19 | {
20 | }
21 |
22 | TestAsset(Core::Uri inUri, uint32_t inA, std::string inB)
23 | : Asset(std::move(inUri))
24 | , a(inA)
25 | , b(std::move(inB))
26 | {
27 | }
28 |
29 | EProperty()
30 | uint32_t a;
31 |
32 | EProperty()
33 | std::string b;
34 | };
35 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Include/RHI/Vulkan/Surface.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/4/17.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 |
11 | namespace RHI::Vulkan {
12 | class VulkanDevice;
13 |
14 | VkSurfaceKHR CreateNativeSurface(const VkInstance& instance, const SurfaceCreateInfo& createInfo);
15 |
16 | class VulkanSurface final : public Surface {
17 | public:
18 | NonCopyable(VulkanSurface)
19 | VulkanSurface(VulkanDevice& inDevice, const SurfaceCreateInfo& inCreateInfo);
20 | ~VulkanSurface() override;
21 |
22 | VkSurfaceKHR GetNative() const;
23 |
24 | private:
25 | VulkanDevice& device;
26 | VkSurfaceKHR nativeSurface;
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Src/ShaderModule.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 16/3/2022.
3 | //
4 |
5 | #include
6 |
7 | namespace RHI::DirectX12 {
8 | DX12ShaderModule::DX12ShaderModule(const ShaderModuleCreateInfo& inCreateInfo)
9 | : ShaderModule(inCreateInfo)
10 | , nativeShaderBytecode(inCreateInfo.byteCode, inCreateInfo.size)
11 | , entryPoint(inCreateInfo.entryPoint)
12 | {
13 | }
14 |
15 | DX12ShaderModule::~DX12ShaderModule() = default;
16 |
17 | const std::string& DX12ShaderModule::GetEntryPoint()
18 | {
19 | return entryPoint;
20 | }
21 |
22 | const D3D12_SHADER_BYTECODE& DX12ShaderModule::GetNative() const
23 | {
24 | return nativeShaderBytecode;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Editor/Include/Editor/Widget/GraphicsWidget.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Kindem on 2025/3/16.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | #include
11 | #include
12 |
13 | namespace Editor {
14 | class GraphicsWidget : public QWidget {
15 | Q_OBJECT
16 |
17 | public:
18 | explicit GraphicsWidget(QWidget* inParent = nullptr);
19 | ~GraphicsWidget() override;
20 |
21 | RHI::Device& GetDevice() const;
22 | RHI::Surface& GetSurface() const;
23 |
24 | protected:
25 | QPaintEngine* paintEngine() const override;
26 |
27 | void WaitDeviceIdle() const;
28 |
29 | RHI::Device* device;
30 | Common::UniquePtr surface;
31 | };
32 | }
33 |
--------------------------------------------------------------------------------
/Editor/Web/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 | "paths": {
9 | "@/*": ["./src/*"]
10 | },
11 |
12 | /* Bundler mode */
13 | "moduleResolution": "bundler",
14 | "allowImportingTsExtensions": true,
15 | "resolveJsonModule": true,
16 | "isolatedModules": true,
17 | "noEmit": true,
18 | "jsx": "react-jsx",
19 |
20 | /* Linting */
21 | "strict": true,
22 | "noUnusedLocals": true,
23 | "noUnusedParameters": true,
24 | "noFallthroughCasesInSwitch": true
25 | },
26 | "include": ["src"],
27 | "references": [{ "path": "./tsconfig.node.json" }]
28 | }
29 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Synchronous.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace RHI::Dummy {
9 | DummyFence::DummyFence(DummyDevice& device, const bool bInitAsSignal)
10 | : Fence(device, bInitAsSignal)
11 | {
12 | }
13 |
14 | DummyFence::~DummyFence() = default;
15 |
16 | bool DummyFence::IsSignaled()
17 | {
18 | return false;
19 | }
20 |
21 | void DummyFence::Reset()
22 | {
23 | }
24 |
25 | void DummyFence::Wait()
26 | {
27 | }
28 |
29 | DummySemaphore::DummySemaphore(DummyDevice& device)
30 | : Semaphore(device)
31 | {
32 | }
33 |
34 | DummySemaphore::~DummySemaphore() = default;
35 | }
36 |
--------------------------------------------------------------------------------
/Engine/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(Source)
2 |
3 | function(get_engine_shader_resources)
4 | set(options "")
5 | set(singleValueArgs OUTPUT)
6 | set(multiValueArgs "")
7 | cmake_parse_arguments(arg "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})
8 |
9 | file(GLOB_RECURSE engine_shaders ${CMAKE_SOURCE_DIR}/${ENGINE_SUB_PROJECT_NAME}/Shader/*.es*)
10 | foreach (shader ${engine_shaders})
11 | get_filename_component(shader_absolute ${shader} ABSOLUTE)
12 | string(REPLACE ${CMAKE_SOURCE_DIR}/${ENGINE_SUB_PROJECT_NAME}/Shader ../Shader/${ENGINE_SUB_PROJECT_NAME} copy_dst ${shader_absolute})
13 | list(APPEND result ${shader}->${copy_dst})
14 | endforeach ()
15 |
16 | set(${arg_OUTPUT} ${result} PARENT_SCOPE)
17 | endfunction()
18 |
--------------------------------------------------------------------------------
/Engine/Source/Launch/Include/Launch/GameApplication.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2025/3/24.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | namespace Launch {
13 | class GameApplication {
14 | public:
15 | GameApplication(int argc, char* argv[]);
16 | ~GameApplication();
17 |
18 | void Tick();
19 | bool ShouldClose() const;
20 |
21 | private:
22 | double lastFrameTimeSeconds;
23 | double thisFrameTimeSeconds;
24 | float deltaTimeSeconds;
25 | Common::UniquePtr viewport;
26 | Runtime::Engine* engine;
27 | Runtime::GameModule* gameModule;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Include/RHI/Vulkan/Queue.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 16/1/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 | namespace RHI::Vulkan {
13 | class VulkanDevice;
14 |
15 | class VulkanQueue final : public Queue {
16 | public:
17 | NonCopyable(VulkanQueue)
18 | explicit VulkanQueue(VulkanDevice& inDevice, VkQueue inNativeQueue);
19 | ~VulkanQueue() override;
20 |
21 | void Submit(CommandBuffer* inCmdBuffer, const QueueSubmitInfo& inSubmitInfo) override;
22 | void Flush(Fence* inFenceToSignal) override;
23 |
24 | VkQueue GetNative() const;
25 |
26 | private:
27 | VkQueue nativeQueue;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Src/Hash.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/4/14.
3 | //
4 |
5 | #include
6 |
7 | namespace Common {
8 | uint32_t HashUtils::StrCrc32(const char* str, size_t length)
9 | {
10 | uint32_t result = 0xffffffff;
11 | for (auto i = 0; i < length; i++) {
12 | result = (result >> 8) ^ Internal::crcTable[(result ^ str[i]) & 0x000000ff];
13 | }
14 | return result ^ 0xffffffff;
15 | }
16 |
17 | uint32_t HashUtils::StrCrc32(const std::string& str)
18 | {
19 | return StrCrc32(str.c_str(), str.length());
20 | }
21 |
22 | uint64_t HashUtils::CityHash(const void* buffer, const size_t length)
23 | {
24 | return CityHash64(static_cast(buffer), length);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Include/RHI/Dummy/Synchronous.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace RHI::Dummy {
10 | class DummyDevice;
11 |
12 | class DummyFence final : public Fence {
13 | public:
14 | NonCopyable(DummyFence)
15 | explicit DummyFence(DummyDevice& device, bool bInitAsSignal);
16 | ~DummyFence() override;
17 |
18 | bool IsSignaled() override;
19 | void Reset() override;
20 | void Wait() override;
21 | };
22 |
23 | class DummySemaphore final : public Semaphore {
24 | public:
25 | NonCopyable(DummySemaphore)
26 | explicit DummySemaphore(DummyDevice& device);
27 | ~DummySemaphore() override;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Include/Common/Platform.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 13/3/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | namespace Common {
10 | enum class DevelopmentPlatform {
11 | windows,
12 | macos,
13 | linux,
14 | max
15 | };
16 |
17 | enum class TargetPlatform {
18 | windows,
19 | macos,
20 | linux,
21 | android,
22 | ios,
23 | xbox,
24 | playStation,
25 | nintendoSwitch,
26 | max
27 | };
28 |
29 | enum class CpuArch {
30 | x86,
31 | x64,
32 | max
33 | };
34 |
35 | class PlatformUtils {
36 | public:
37 | static void SetEnvVar(const std::string& inKey, const std::string& inValue);
38 | };
39 | }
40 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Include/RHI/RHI.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 19/4/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 |
28 | #if PLATFORM_WINDOWS
29 | #undef CreateSemaphore
30 | #endif
31 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/dxc/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/Engine/Source/RHI/Include/RHI/Gpu.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 12/1/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 | #include
11 |
12 | namespace RHI {
13 | class Device;
14 | class Instance;
15 | struct DeviceCreateInfo;
16 |
17 | struct GpuProperty {
18 | uint32_t vendorId;
19 | uint32_t deviceId;
20 | GpuType type;
21 | };
22 |
23 | class Gpu {
24 | public:
25 | NonCopyable(Gpu)
26 | virtual ~Gpu();
27 | virtual GpuProperty GetProperty() = 0;
28 | virtual Common::UniquePtr RequestDevice(const DeviceCreateInfo& createInfo) = 0;
29 | virtual Instance& GetInstance() const = 0;
30 |
31 | protected:
32 | Gpu();
33 | };
34 | }
35 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/assimp/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/clipp/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/glfw/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/libclang/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/debugbreak/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/molten-vk/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/rapidjson/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Dummy/Src/Buffer.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2023/3/21.
3 | //
4 |
5 | #include
6 | #include
7 |
8 | namespace RHI::Dummy {
9 | DummyBuffer::DummyBuffer(const BufferCreateInfo& createInfo)
10 | : Buffer(createInfo)
11 | , dummyData(1)
12 | {
13 | }
14 |
15 | DummyBuffer::~DummyBuffer() = default;
16 |
17 | void* DummyBuffer::Map(MapMode mapMode, size_t offset, size_t length)
18 | {
19 | return dummyData.data();
20 | }
21 |
22 | void DummyBuffer::UnMap()
23 | {
24 | }
25 |
26 | Common::UniquePtr DummyBuffer::CreateBufferView(const BufferViewCreateInfo& createInfo)
27 | {
28 | return Common::UniquePtr(new DummyBufferView(createInfo));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Include/RHI/DirectX12/Queue.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 15/1/2022.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 | #include
9 |
10 | #include
11 |
12 | using Microsoft::WRL::ComPtr;
13 |
14 | namespace RHI::DirectX12 {
15 | class DX12Queue final : public Queue {
16 | public:
17 | NonCopyable(DX12Queue)
18 | explicit DX12Queue(ComPtr&& inNativeCmdQueue);
19 | ~DX12Queue() override;
20 |
21 | void Submit(CommandBuffer* inCmdBuffer, const QueueSubmitInfo& inSubmitInfo) override;
22 | void Flush(Fence* inFenceToSignal) override;
23 |
24 | ID3D12CommandQueue* GetNative() const;
25 |
26 | private:
27 | ComPtr nativeCmdQueue;
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-Vulkan/Include/RHI/Vulkan/PipelineLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Zach Lee on 2022/4/2.
3 | //
4 |
5 | #pragma once
6 |
7 | #include
8 |
9 | #include
10 |
11 | namespace RHI::Vulkan {
12 | class VulkanDevice;
13 |
14 | class VulkanPipelineLayout final : public PipelineLayout {
15 | public:
16 | NonCopyable(VulkanPipelineLayout)
17 | VulkanPipelineLayout(VulkanDevice& inDevice, const PipelineLayoutCreateInfo& inCreateInfo);
18 | ~VulkanPipelineLayout() override;
19 |
20 | VkPipelineLayout GetNative() const;
21 |
22 | private:
23 | void CreateNativePipelineLayout(const PipelineLayoutCreateInfo& inCreateInfo);
24 |
25 | VulkanDevice& device;
26 | VkPipelineLayout nativePipelineLayout;
27 | };
28 | }
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-validationlayers/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Src/Debug.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2024/4/14.
3 | //
4 |
5 | #if BUILD_CONFIG_DEBUG
6 | #include
7 | #endif
8 |
9 | #include
10 | #include
11 |
12 | namespace Common {
13 | void Debug::AssertImpl(const bool expression, const std::string& name, const std::string& file, const uint32_t line, const std::string& reason)
14 | {
15 | AutoCerrFlush;
16 |
17 | if (expression) {
18 | return;
19 | }
20 | std::cerr << "Assert failed: " << name << ", " << file << ", " << line << newline;
21 | std::cerr << "Reason: " << reason << newline;
22 |
23 | #if BUILD_CONFIG_DEBUG
24 | debug_break();
25 | #endif
26 | }
27 |
28 | Debug::Debug() = default;
29 |
30 | Debug::~Debug() = default;
31 | }
32 |
--------------------------------------------------------------------------------
/ThirdParty/ConanRecipes/vulkan-utility-libraries/test_package/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.build import can_run
3 | from conan.tools.cmake import cmake_layout, CMake
4 | import os
5 |
6 |
7 | class TestPackageConan(ConanFile):
8 | settings = "os", "arch", "compiler", "build_type"
9 | generators = "CMakeDeps", "CMakeToolchain"
10 |
11 | def layout(self):
12 | cmake_layout(self)
13 |
14 | def requirements(self):
15 | self.requires(self.tested_reference_str)
16 |
17 | def build(self):
18 | cmake = CMake(self)
19 | cmake.configure()
20 | cmake.build()
21 |
22 | def test(self):
23 | if can_run(self):
24 | bin_path = os.path.join(self.cpp.build.bindir, "test_package")
25 | self.run(bin_path, env="conanrun")
26 |
--------------------------------------------------------------------------------
/Tool/MirrorTool/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | file(GLOB sources Src/*.cpp)
2 | exp_add_library(
3 | NAME MirrorTool.Static
4 | SRC ${sources}
5 | PUBLIC_INC Include
6 | PUBLIC_LIB Mirror
7 | PUBLIC_MERGE_LIB libclang::libclang clipp::clipp
8 | NOT_INSTALL
9 | )
10 |
11 | file(GLOB exe_sources ExeSrc/*.cpp)
12 | exp_add_executable(
13 | NAME MirrorTool
14 | SRC ${exe_sources}
15 | INC Include
16 | LIB MirrorTool.Static
17 | )
18 |
19 | exp_add_test(
20 | NAME MirrorTool.Test
21 | SRC Test/Main.cpp
22 | INC Include
23 | LIB MirrorTool.Static
24 | RES
25 | ${CMAKE_CURRENT_SOURCE_DIR}/Test/MirrorToolInput.h->../Test/Resource/Mirror/MirrorToolInput.h
26 | ${CMAKE_SOURCE_DIR}/${ENGINE_SUB_PROJECT_NAME}/Source/Mirror/Include/Mirror/Meta.h->../Test/Resource/Mirror/Mirror/Meta.h
27 | )
28 |
--------------------------------------------------------------------------------
/Engine/Source/Common/Test/HashTest.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 2022/7/3.
3 | //
4 |
5 | #include
6 |
7 | #include
8 |
9 | #include
10 |
11 | TEST(HashTest, CityHashTest)
12 | {
13 | constexpr std::string_view testString = "Hello, World";
14 | ASSERT_EQ(7750308374451649530, Common::HashUtils::CityHash(testString.data(), testString.size()));
15 | }
16 |
17 | TEST(HashTest, StrCrc32Test)
18 | {
19 | ASSERT_EQ(Common::HashUtils::StrCrc32("hello"), 0x3610a686);
20 | ASSERT_EQ(Common::HashUtils::StrCrc32("explosion game engine"), 0xdb39167f);
21 | }
22 |
23 | TEST(HashTest, StrCrc32DynTest)
24 | {
25 | ASSERT_EQ(Common::HashUtils::StrCrc32(std::string("hello")), 0x3610a686);
26 | ASSERT_EQ(Common::HashUtils::StrCrc32(std::string("explosion game engine")), 0xdb39167f);
27 | }
28 |
--------------------------------------------------------------------------------
/Engine/Source/RHI-DirectX12/Include/RHI/DirectX12/Sampler.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by johnk on 5/3/2022.
3 | //
4 |
5 | #pragma once
6 |
7 |
8 | #include