Skip to content

Commit 8d6f311

Browse files
Header Reorganization and submodule upgrade
- Remove Pre-Compiled Headers - Updated the version of Submodules to remove bugs and compiler errors already solved by the upstream projects such as Assimp and GLM. - The newer packages improve cross-platform compilation, particularly on linux
1 parent c12afed commit 8d6f311

259 files changed

Lines changed: 2977 additions & 2537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ PenaltyBreakTemplateDeclaration: 100
120120
PenaltyReturnTypeOnItsOwnLine: 300
121121
PointerAlignment: Left
122122
ReflowComments: true
123-
SortIncludes: true
123+
SortIncludes: false
124124
SortUsingDeclarations: true
125125
SpaceAfterCStyleCast: true
126126
SpaceAfterLogicalNot: false

.github/workflows/Engine-CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [ master, develop, arena-integration ]
3+
branches: [ master, develop, arena-integration, no-pch ]
44
pull_request:
55
branches: [ master, develop, arena-integration ]
66

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
path = __externals/stb
66
url = https://github.com/nothings/stb
77
[submodule "__externals/imgui/src"]
8-
path = __externals/imgui/src
8+
path = __externals/imgui/imgui
99
url = https://github.com/ocornut/imgui
1010
[submodule "__externals/spdlog"]
1111
path = __externals/spdlog
@@ -59,11 +59,11 @@
5959
path = __externals/Vulkan-Headers
6060
url = https://github.com/KhronosGroup/Vulkan-Headers
6161
[submodule "__externals/tlsf/src"]
62-
path = __externals/tlsf/src
62+
path = __externals/tlsf/tlsf
6363
url = https://github.com/mattconte/tlsf
6464
[submodule "__externals/CLI11"]
6565
path = __externals/CLI11
6666
url = https://github.com/CLIUtils/CLI11
6767
[submodule "__externals/rapidhash/src"]
68-
path = __externals/rapidhash/src
68+
path = __externals/rapidhash/rapidhash
6969
url = https://github.com/Nicoshev/rapidhash

CMakeLists.txt

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
cmake_minimum_required (VERSION 3.17 FATAL_ERROR)
22

3+
set (CMAKE_CXX_STANDARD_REQUIRED ON)
4+
set (CMAKE_CXX_STANDARD 20)
5+
set (CMAKE_CXX_EXTENSIONS OFF)
6+
37
project (RendererEngine
48
VERSION 1.0
59
DESCRIPTION "Renderer Engine is an open-source 2D - 3D rendering engine written in C/C++"
@@ -42,30 +46,10 @@ endif()
4246
# Externals dependencies
4347
#
4448
if (NOT LAUNCHER_ONLY)
45-
add_subdirectory (${EXTERNAL_DIR}/fmt)
46-
add_subdirectory (${EXTERNAL_DIR}/imgui)
47-
add_subdirectory (${EXTERNAL_DIR}/glfw)
48-
add_subdirectory (${EXTERNAL_DIR}/spdlog)
49-
add_subdirectory (${EXTERNAL_DIR}/glm)
50-
add_subdirectory (${EXTERNAL_DIR}/entt)
51-
add_subdirectory (${EXTERNAL_DIR}/assimp)
52-
add_subdirectory (${EXTERNAL_DIR}/stduuid)
53-
add_subdirectory (${EXTERNAL_DIR}/yaml-cpp)
54-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-headers)
55-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-Tools)
56-
add_subdirectory (${EXTERNAL_DIR}/glslang)
57-
add_subdirectory (${EXTERNAL_DIR}/SPIRV-Cross)
58-
add_subdirectory (${EXTERNAL_DIR}/gtest)
59-
add_subdirectory (${EXTERNAL_DIR}/VulkanMemoryAllocator)
60-
add_subdirectory (${EXTERNAL_DIR}/tlsf)
61-
add_subdirectory (${EXTERNAL_DIR}/rapidhash)
62-
add_subdirectory (${EXTERNAL_DIR}/CLI11)
63-
64-
set (CMAKE_PREFIX_PATH
65-
${CMAKE_PREFIX_PATH}
66-
${EXTERNAL_DIR}/Vulkan-Headers/build/install/share/cmake
67-
)
68-
add_subdirectory (${EXTERNAL_DIR}/Vulkan-Loader)
49+
50+
## Setup Dependencies
51+
52+
include(${EXTERNAL_DIR}/externals.cmake)
6953

7054
# Core engine lib is here
7155
#

Scripts/BuildEngine.ps1

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
113113
# Check the system name
114114
if ($IsLinux) {
115115
$systemName = "Linux"
116-
$cMakeGenerator
117116
}
118117
elseif ($IsMacOS) {
119118
$systemName = "Darwin"
@@ -152,7 +151,6 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
152151
'SPIRV_TOOLS' = @("-DSPIRV_SKIP_EXECUTABLES=ON", "-DSPIRV_SKIP_TESTS=ON")
153152
'SPIRV_CROSS' = @("-DSPIRV_CROSS_ENABLE_TESTS=OFF")
154153
'LAUNCHER_ONLY' = @("-DLAUNCHER_ONLY=ON")
155-
'GLM' = @("-DCMAKE_POLICY_VERSION_MINIMUM=3.5")
156154
}
157155

158156
$cMakeCacheVariableOverride = $cMakeOptions -join ' '
@@ -171,11 +169,7 @@ function Build([string]$configuration, [int]$VsVersion , [bool]$runBuild) {
171169
$cMakeCacheVariableOverride += ' -DCMAKE_CONFIGURATION_TYPES=Debug;Release '
172170
}
173171
"Linux" {
174-
$cMakeGenerator = "-G `"Unix Makefiles`""
175-
176-
# Set Linux build compiler
177-
$env:CC = '/usr/bin/gcc-11'
178-
$env:CXX = '/usr/bin/g++-11'
172+
$cMakeGenerator = "-G Ninja"
179173
}
180174
"Darwin" {
181175
$cMakeGenerator = "-G `"Xcode`""

Scripts/PostBuild.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ param (
2828
[string[]] $SystemName = 'Windows',
2929

3030
[Parameter(HelpMessage="Architecture type to build, default to x64")]
31-
[ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64')]
31+
[ValidateSet('win-x64', 'arm64', 'osx-x64', 'osx-arm64', 'linux-x64')]
3232
[string[]] $Architectures = 'win-x64',
3333

3434
[Parameter(HelpMessage="Configuration type to build, default to Debug")]
@@ -103,7 +103,7 @@ $ContentsToProcess = @(
103103
}
104104
}
105105
"Linux" {
106-
@{ From = "$OuputBuildDirectory\Tetragrama\$Configurations"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\Editor"}
106+
@{ From = "$OuputBuildDirectory\Tetragrama\"; To = "$OuputBuildDirectory\Panzerfaust\$Configurations\$TargetFramework\Editor"}
107107
}
108108
Default {
109109
throw 'This system is not supported'
@@ -133,4 +133,4 @@ foreach ($item in $ContentsToProcess) {
133133
[string]$ToDirectory = $content.To
134134
Write-Host "Copied $name --> $ToDirectory"
135135
}
136-
}
136+
}

Scripts/Shared.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ function Find-GlslangValidator () {
186186
function Find-ClangFormat () {
187187
$repoConfiguration = Get-RepositoryConfiguration
188188
$LLVMMinimumVersion = $repoConfiguration.Requirements.LLVM.Version
189-
$LLVMMaximumVersion = $repoConfiguration.Requirements.LLVM.MaximumVersion
190189

191190
$candidates = @(
192191
'clang-format'
@@ -204,7 +203,7 @@ function Find-ClangFormat () {
204203
if ($clangFormatCommand) {
205204
if ((& $clangFormatCommand --version | Out-String) -match "clang-format version ([\d\.]*)") {
206205
[Version] $clangFormatVersion = $Matches[1]
207-
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion) -and (CompareVersion $LLVMMaximumVersion $clangFormatVersion)) {
206+
if ((CompareVersion $clangFormatVersion $LLVMMinimumVersion)) {
208207
return $clangFormatCommand.Source
209208
}
210209
}
@@ -215,6 +214,9 @@ function Find-ClangFormat () {
215214
}
216215

217216
function Setup-ShaderCCompilerTool () {
217+
if ($IsLinux) {
218+
return
219+
}
218220
$repoConfiguration = Get-RepositoryConfiguration
219221
$repositoryToolPath = $repoConfiguration.Paths.Tools
220222

Tetragrama/CMakeLists.txt

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ project (Tetragrama
66
LANGUAGES CXX
77
)
88

9-
set (CMAKE_CXX_STANDARD_REQUIRED ON)
10-
set (CMAKE_CXX_STANDARD 20)
11-
129
file (GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
1310
file (GLOB_RECURSE CPP_FILES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
1411

@@ -22,7 +19,7 @@ else()
2219
add_executable (${TARGET_NAME})
2320
endif()
2421

25-
target_sources(${TARGET_NAME} PUBLIC ${HEADER_FILES} ${CPP_FILES})
22+
target_sources(${TARGET_NAME} PUBLIC ${CPP_FILES})
2623

2724
# We set this debugger directory to find assets and resources file
2825
# after being copied to Debug and Release output directories
@@ -31,25 +28,11 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
3128
set_target_properties(${TARGET_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "$(ProjectDir)$(Configuration)")
3229
endif ()
3330

34-
include(${EXTERNAL_DIR}/externals.cmake)
35-
3631
target_include_directories (${TARGET_NAME}
3732
PRIVATE
38-
.
39-
./Components
40-
./Components/Events
41-
./Controllers
42-
./Inputs
43-
./Layers
44-
./Messengers
45-
./Helpers
46-
./Importers
47-
./Serializers
48-
./Managers
49-
${ENLISTMENT_ROOT}/ZEngine
33+
${CMAKE_CURRENT_SOURCE_DIR}/..
5034
)
5135

52-
target_precompile_headers(${TARGET_NAME} PRIVATE pch.h)
5336
target_compile_definitions(${TARGET_NAME}
5437
PRIVATE
5538
NOMINMAX
@@ -62,4 +45,4 @@ target_link_libraries(${TARGET_NAME} PRIVATE
6245
imported::External_editorLibs
6346
)
6447

65-
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor")
48+
set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "zEngineEditor")

Tetragrama/Components/DemoUIComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include <UIComponent.h>
2+
#include <Tetragrama/Components/UIComponent.h>
33
#include <imgui.h>
44

55
namespace Tetragrama::Components

Tetragrama/Components/DockspaceUIComponent.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include <pch.h>
2-
#include <DockspaceUIComponent.h>
3-
#include <Editor.h>
4-
#include <Helpers/UIDispatcher.h>
5-
#include <Importers/AssimpImporter.h>
6-
#include <MessageToken.h>
7-
#include <Messengers/Messenger.h>
1+
#include <Tetragrama/Components/DockspaceUIComponent.h>
2+
#include <Tetragrama/Editor.h>
3+
#include <Tetragrama/Helpers/UIComponentDrawerHelper.h>
4+
#include <Tetragrama/Helpers/UIDispatcher.h>
5+
#include <Tetragrama/Importers/AssimpImporter.h>
6+
#include <Tetragrama/MessageToken.h>
7+
#include <Tetragrama/Messengers/Messenger.h>
88
#include <ZEngine/Logging/LoggerDefinition.h>
99
#include <fmt/format.h>
10-
#include <imgui/src/imgui_internal.h>
10+
#include <ImGuizmo/ImGuizmo.h>
1111

1212
namespace fs = std::filesystem;
1313

0 commit comments

Comments
 (0)