diff --git a/.gitmodules b/.gitmodules index 90642bbc..abaf2dcd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "3rdpty/jsoncpp"] - path = 3rdpty/jsoncpp - url = https://github.com/open-source-parsers/jsoncpp [submodule "CMCMakeModule"] path = CMCMakeModule url = https://github.com/hyzboy/CMCMakeModule @@ -22,6 +19,3 @@ [submodule "CMUtil"] path = CMUtil url = https://github.com/hyzboy/CMUtil.git -[submodule "3rdpty/glm"] - path = 3rdpty/glm - url = https://github.com/g-truc/glm.git diff --git a/3rdpty/glm b/3rdpty/glm deleted file mode 160000 index 6ad79aae..00000000 --- a/3rdpty/glm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6ad79aae3eb5bf809c30bf1168171e9e55857e45 diff --git a/3rdpty/jsoncpp b/3rdpty/jsoncpp deleted file mode 160000 index 94a6220f..00000000 --- a/3rdpty/jsoncpp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 94a6220f7c738d6711d325fd29bb8a60b97fd77e diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 00000000..ce8f2b36 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,48 @@ +# Build on Windows + +Tested with Visual Studio 2019/2022 and Windows 11 + +please first install [Git](https://git-scm.com/download/win) and [CMake](https://cmake.org/download/) + +and then clone [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022) by git: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + bootstrap-vcpkg.bat + + +Install [vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022) to build required libraries: + + vcpkg install glm:x64-windows jsoncpp:x64-windows expat:x64-windows + vcpkg integrate install + +finish step you can use "cmake" create project file with vcpkg toolchain: + + cmake . -DCMAKE_TOOLCHAIN_FILE=\????\vcpkg\scripts\buildsystems\vcpkg.cmake + +or use "cmake-gui" with "Specify toolchain file for cross-compiling." + +# + +# 在Windows下编译工程 + +以下在Windows 11以及Visual Studio 2019/2022下测试通过 + +首先请安装[Git](https://git-scm.com/download/win)和[CMake](https://cmake.org/download/) + +然后使用git安装[vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022) + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + bootstrap-vcpkg.bat + +接着使用[vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg?view=vs-2022)来安装我们所需要的第三方依赖库: + + vcpkg install glm:x64-windows jsoncpp:x64-windows expat:x64-windows + vcpkg integrate install + +最后你就可以使用CMake创建工程文件了: + + cmake . -DCMAKE_TOOLCHAIN_FILE=\????\vcpkg\scripts\buildsystems\vcpkg.cmake + +或是使用cmake-gui以图形界面形式创建,但请在第一个界面选择“Specify toolchain file for cross-compiling”并指定使用vcpkg.cmake做为工具链。 diff --git a/CMUtil b/CMUtil index be9122db..ea20632a 160000 --- a/CMUtil +++ b/CMUtil @@ -1 +1 @@ -Subproject commit be9122db80512d3c046fe68b3b9948dd2078dec7 +Subproject commit ea20632a05ea458664cb00e92d2a0cff46cb626d diff --git a/CMakeLists.txt b/CMakeLists.txt index 5872eff6..68a1c76d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,12 +8,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMCMakeModule) set(ULRE_3RDPTY_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdpty) -include(vulkan) - include(math) -use_glm(${ULRE_3RDPTY_ROOT_PATH}/glm) - +include(vulkan) include(use_cm_module) + use_cm_module(Core) use_cm_module(Util) use_cm_module(Platform) @@ -22,14 +20,6 @@ use_cm_module(SceneGraph) OPTION(SUPPORT_QT_VULKAN OFF) -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - include_directories(${ULRE_3RDPTY_ROOT_PATH}/jsoncpp/include) - add_subdirectory(3rdpty/jsoncpp) - SET(JSONCPP_LIBRARY jsoncpp_lib) -ELSE() - SET(JSONCPP_LIBRARY jsoncpp) -ENDIF() - SET(ULRE CMCore CMPlatform CMAssetsManage diff --git a/README.md b/README.md index fdef9ca1..0b391649 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Platform: Windows,Linux (WIP: Android) Graphics API: Vulkan - +# ULRE是一个试验性质的工程,用于试验各种渲染相关的技术,以及做一些范例。在未来它的复杂化版本会被整合到CMGameEngine中,用于替代旧的渲染引擎。 平台: Windows,Linux (开发中: Android) diff --git a/inc/hgl/graph/VKDevice.h b/inc/hgl/graph/VKDevice.h index 6a118355..82f9f9f6 100644 --- a/inc/hgl/graph/VKDevice.h +++ b/inc/hgl/graph/VKDevice.h @@ -160,6 +160,8 @@ private: //texture bool CommitTexture2DMipmaps (Texture2D *,GPUBuffer *buf,uint32_t width,uint32_t height,uint32_t); bool CommitTexture2D (Texture2D *,GPUBuffer *buf,const VkBufferImageCopy *,const int count,VkPipelineStageFlags=VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT); + bool SubmitTexture (const VkCommandBuffer *cmd_bufs,const uint32_t count=1); ///<提交纹理处理到队列 + public: //Texture bool CheckFormatSupport(const VkFormat,const uint32_t bits,ImageTiling tiling=ImageTiling::Optimal)const; @@ -242,8 +244,6 @@ public: //FrameBuffer相关 Framebuffer *CreateFramebuffer(RenderPass *,ImageView *); public: - - bool SubmitTexture (const VkCommandBuffer *cmd_bufs,const uint32_t count=1); ///<提交纹理处理到队列 RenderTarget *CreateRenderTarget( const FramebufferInfo *fbi,RenderPass *,const uint32_t fence_count=1); RenderTarget *CreateRenderTarget( const FramebufferInfo *fbi,const uint32_t fence_count=1);