Merge pull request #3 from SteveGremory/main
- Fixed ShaderConductor for gcc - Fixed CMake issues on linux
This commit is contained in:
commit
d703c8330a
12 changed files with 37 additions and 24 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
|||
.vs/
|
||||
bin/
|
||||
bin-obj/
|
||||
build/
|
||||
|
||||
# VS Files
|
||||
**.vcxproj**
|
||||
|
@ -25,4 +26,4 @@ Makefile
|
|||
**.ini
|
||||
!**/default_gui_layout.ini
|
||||
|
||||
CMake/
|
||||
CMake/
|
||||
|
|
2
.gitmodules
vendored
2
.gitmodules
vendored
|
@ -15,4 +15,4 @@
|
|||
url = https://github.com/skypjack/entt
|
||||
[submodule "Dependencies/ShaderConductor"]
|
||||
path = Dependencies/ShaderConductor
|
||||
url = https://github.com/microsoft/shaderconductor
|
||||
url = https://github.com/Light3039/shaderconductor
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
cmake_minimum_required(VERSION 3.21.2)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(Light VERSION 1.0.0)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(SPIRV_CROSS_ENABLE_TESTS OFF)
|
||||
set(INSTALL_GTEST OFF)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error")
|
||||
add_subdirectory(Dependencies/ShaderConductor) # <-- this project should not use "cxx_standard 17"
|
||||
|
||||
# directories
|
||||
|
@ -14,8 +18,13 @@ set(ENGINE_DIR ${CMAKE_BINARY_DIR}/../Engine/)
|
|||
set(DEPENDENCIES_DIR ${CMAKE_BINARY_DIR}/../Dependencies/)
|
||||
|
||||
# projects
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
if(WIN32)
|
||||
add_compile_definitions(LIGHT_PLATFORM_WINDOWS)
|
||||
elseif(UNIX)
|
||||
add_compile_definitions(LIGHT_PLATFORM_LINUX)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${ENGINE_DIR}/)
|
||||
add_subdirectory(${MIRROR_DIR}/)
|
||||
|
@ -42,4 +51,4 @@ target_link_libraries(Mirror Engine)
|
|||
|
||||
if(MSVC)
|
||||
set_property(DIRECTORY ${CMAE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Mirror)
|
||||
endif()
|
||||
endif()
|
||||
|
|
4
Dependencies/GLAD/CMakeLists.txt
vendored
4
Dependencies/GLAD/CMakeLists.txt
vendored
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.21.2)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
|
@ -15,4 +15,4 @@ file(GLOB_RECURSE GLAD_HEADERS true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/include
|
|||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
|
||||
add_library(glad STATIC ${GLAD_SOURCES} ${GLAD_HEADERS})
|
||||
add_library(glad STATIC ${GLAD_SOURCES} ${GLAD_HEADERS})
|
||||
|
|
2
Dependencies/ShaderConductor
vendored
2
Dependencies/ShaderConductor
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 30a77c78d24fa08f4fe5fc4428f10dbfc92717a6
|
||||
Subproject commit 9420a9b06a059e7def5e5da15e357281f4382015
|
4
Dependencies/stb_image/CMakeLists.txt
vendored
4
Dependencies/stb_image/CMakeLists.txt
vendored
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.21.2)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
|
@ -10,4 +10,4 @@ endif()
|
|||
|
||||
file(GLOB STB_IMAGES_FILES true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/*)
|
||||
|
||||
add_library(stb_image STATIC ${STB_IMAGES_FILES})
|
||||
add_library(stb_image STATIC ${STB_IMAGES_FILES})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.21.2)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
|
@ -62,8 +62,10 @@ endif()
|
|||
|
||||
message(BINARY DIRECTORY IS IN ${CMAKE_BINARY_DIR})
|
||||
|
||||
add_custom_command(
|
||||
TARGET Engine
|
||||
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_BINARY_DIR}/Dependencies/ShaderConductor/Bin/Debug/ShaderConductor.dll
|
||||
${CMAKE_BINARY_DIR}/bin/Debug)
|
||||
if(WIN32)
|
||||
add_custom_command(
|
||||
TARGET Engine
|
||||
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
${CMAKE_BINARY_DIR}/Dependencies/ShaderConductor/Bin/Debug/ShaderConductor.dll
|
||||
${CMAKE_BINARY_DIR}/bin/Debug)
|
||||
endif()
|
|
@ -35,7 +35,6 @@ namespace Light {
|
|||
void GameLoop();
|
||||
|
||||
// To be defined in client project
|
||||
friend Application* CreateApplication();
|
||||
|
||||
protected:
|
||||
Application();
|
||||
|
@ -46,4 +45,6 @@ namespace Light {
|
|||
void LogDebugData();
|
||||
};
|
||||
|
||||
Application* CreateApplication();
|
||||
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace Light { namespace Math {
|
||||
|
||||
float Math::Rand(int min, int max, int decimals /* = 0 */)
|
||||
float Rand(int min, int max, int decimals /* = 0 */)
|
||||
{
|
||||
const int dec = std::pow(10, decimals);
|
||||
min *= dec;
|
||||
|
@ -14,7 +14,7 @@ namespace Light { namespace Math {
|
|||
return (min + (rand() % (max)-min)) / (float)dec;
|
||||
}
|
||||
|
||||
glm::vec2 Math::RandVec2(int min, int max, int decimals /* = 0 */)
|
||||
glm::vec2 RandVec2(int min, int max, int decimals /* = 0 */)
|
||||
{
|
||||
const int dec = std::pow(10, decimals);
|
||||
min *= dec;
|
||||
|
@ -26,7 +26,7 @@ namespace Light { namespace Math {
|
|||
return glm::vec2(r1, r2);
|
||||
}
|
||||
|
||||
glm::vec3 Math::RandVec3(int min, int max, int decimals /* = 0 */)
|
||||
glm::vec3 RandVec3(int min, int max, int decimals /* = 0 */)
|
||||
{
|
||||
const int dec = std::pow(10, decimals);
|
||||
min *= dec;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.21.2)
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCC)
|
||||
add_compile_options(-w)
|
||||
|
@ -26,4 +26,4 @@ ${DEPENDENCIES_DIR}stb_image/
|
|||
|
||||
file(GLOB_RECURSE MIRROR_FILES true ABSOLUTE ${CMAKE_CURRENT_SOURCE_DIR}/src/* ${CMAKE_CURRENT_SOURCE_DIR}/res/*)
|
||||
source_group(TREE ${MIRROR_DIR} FILES ${MIRROR_FILES})
|
||||
add_executable(Mirror ${MIRROR_FILES})
|
||||
add_executable(Mirror ${MIRROR_FILES})
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace Light {
|
|||
|
||||
const glm::vec4 tint = glm::vec4(Math::RandVec3(0, 1, 2), 1.0f);
|
||||
|
||||
auto& entity = m_Scene->CreateEntity("quad" + std::to_string(i), { translation, scale, rotation });
|
||||
auto entity = m_Scene->CreateEntity("quad" + std::to_string(i), { translation, scale, rotation });
|
||||
entity.AddComponent<SpriteRendererComponent>(texture, tint);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue