Skip to content

Commit

Permalink
moved source code into subdirectories, split webgpu and opengl
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigoryGraborenko committed Sep 24, 2024
1 parent 8954f67 commit ed3157d
Show file tree
Hide file tree
Showing 75 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions CMake/Jumbo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ target_include_directories(${PROJECT_NAME}
PRIVATE
${NESHNY_DIR}/External
${CMAKE_SOURCE_DIR}/src
${NESHNY_DIR}
${NESHNY_DIR}/Src
${SDL2_DIR}/include
)

Expand Down Expand Up @@ -155,22 +155,22 @@ if (NOT EMSCRIPTEN)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/src/EmbeddedFiles.cpp
COMMAND "${CMAKE_COMMAND}" -D BASE_DIR=${CMAKE_SOURCE_DIR} -P ${NESHNY_DIR}/CMake/EmbeddedFiles.txt
DEPENDS "${BASE_DIR}/${SHADER_PATH}/*.*" DEPENDS ${NESHNY_DIR}/Shaders/*.wgsl
DEPENDS "${BASE_DIR}/${SHADER_PATH}/*.*" DEPENDS ${NESHNY_DIR}/Src/Shaders/*.wgsl
)
else()
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/src/EmbeddedFiles.cpp
COMMAND "${CMAKE_COMMAND}" -D BASE_DIR=${CMAKE_SOURCE_DIR} -P ${NESHNY_DIR}/CMake/EmbeddedFiles.txt
DEPENDS ${BASE_DIR}/${SHADER_PATH}/*.vert DEPENDS ${BASE_DIR}/${SHADER_PATH}/*.frag DEPENDS ${BASE_DIR}/${SHADER_PATH}/*.comp DEPENDS ${BASE_DIR}/${SHADER_PATH}/*.glsl
DEPENDS ${NESHNY_DIR}/shaders/*.vert DEPENDS ${NESHNY_DIR}/shaders/*.frag DEPENDS ${NESHNY_DIR}/shaders/*.comp DEPENDS ${NESHNY_DIR}/shaders/*.glsl
DEPENDS ${NESHNY_DIR}/Src/Shaders/*.vert DEPENDS ${NESHNY_DIR}/Src/Shaders/*.frag DEPENDS ${NESHNY_DIR}/Src/Shaders/*.comp DEPENDS ${NESHNY_DIR}/Src/Shaders/*.glsl
)
endif()

# command that embeds list of unit tests and their names into a cpp file
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/src/UnitTestList.cpp
COMMAND "${CMAKE_COMMAND}" -D BASE_DIR=${CMAKE_SOURCE_DIR} -P ${NESHNY_DIR}/CMake/UnitTests.txt
DEPENDS ${NESHNY_DIR}/UnitTests/*.cpp
DEPENDS ${NESHNY_DIR}/Src/UnitTests/*.cpp
DEPENDS ${CMAKE_SOURCE_DIR}/src/UnitTests/*.cpp
)

Expand All @@ -182,7 +182,7 @@ else()
endif()

# adds list of shader directories to allow dynamic runtime loading in debug
file(WRITE "src/EmbeddedDirectories.cpp" "std::vector<std::string> g_ShaderBaseDirs={ \"${NESHNY_DIR}/shaders\", \"${CMAKE_CURRENT_SOURCE_DIR}/${SHADER_PATH}\" };\n")
file(WRITE "src/EmbeddedDirectories.cpp" "std::vector<std::string> g_ShaderBaseDirs={ \"${NESHNY_DIR}/Src/Shaders\", \"${CMAKE_CURRENT_SOURCE_DIR}/${SHADER_PATH}\" };\n")

###############################################################################
message(STATUS "Project Structure")
Expand All @@ -200,9 +200,9 @@ file(GLOB_RECURSE GeneratedList *.cxx *.hxx)

# all files from neshny
if (WEBGPU)
file(GLOB NeshnyList ${NESHNY_DIR}/*.h ${NESHNY_DIR}/*.cpp ${NESHNY_DIR}/UnitTests/*.cpp ${NESHNY_DIR}/shaders/*.wgsl)
file(GLOB NeshnyList ${NESHNY_DIR}/Src/*.* ${NESHNY_DIR}/Src/WebGPU/*.* ${NESHNY_DIR}/Src/UnitTests/*.cpp ${NESHNY_DIR}/Src/Shaders/*.wgsl)
else()
file(GLOB NeshnyList ${NESHNY_DIR}/*.h ${NESHNY_DIR}/*.cpp ${NESHNY_DIR}/UnitTests/*.cpp ${NESHNY_DIR}/shaders/*.*)
file(GLOB NeshnyList ${NESHNY_DIR}/Src/*.* ${NESHNY_DIR}/Src/OpenGL/*.* ${NESHNY_DIR}/Src/UnitTests/*.cpp ${NESHNY_DIR}/Src/Shaders/*.*)
endif()

list(APPEND FullList ${HeaderList} ${SourceList} ${ShaderList})
Expand All @@ -217,7 +217,7 @@ set_source_files_properties(src/main.cpp src/PreCompiledHeader.cpp PROPERTIES
)

if (APPLE)
list(APPEND NeshnyList ${NESHNY_DIR}/metal.mm)
list(APPEND NeshnyList ${NESHNY_DIR}/Src/metal.mm)
endif()

target_sources(${PROJECT_NAME}
Expand All @@ -229,7 +229,7 @@ target_sources(${PROJECT_NAME}
)

source_group(TREE ${CMAKE_SOURCE_DIR}/src PREFIX src FILES ${FullList})
source_group(TREE ${NESHNY_DIR} PREFIX neshny FILES ${NeshnyList})
source_group(TREE ${NESHNY_DIR}/Src PREFIX neshny FILES ${NeshnyList})
source_group("generated" FILES ${GeneratedList})

###############################################################################
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions IncludeAll.cpp → Src/IncludeAll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#include "Preprocessor.cpp"
#include "NeshnyUtils.cpp"
#ifdef NESHNY_WEBGPU
#include "WGPUUtils.cpp"
#include "EntityWebGPU.cpp"
#include "PipelineWebGPU.cpp"
#include "WebGPU/WGPUUtils.cpp"
#include "WebGPU/EntityWebGPU.cpp"
#include "WebGPU/PipelineWebGPU.cpp"
#elif defined(NESHNY_GL)
#include "GLUtils.cpp"
#include "EntityGL.cpp"
#include "PipelineGL.cpp"
#include "OpenGL/GLUtils.cpp"
#include "OpenGL/EntityGL.cpp"
#include "OpenGL/PipelineGL.cpp"
#endif
#include "Core.cpp"
#include "EditorViewers.cpp"
Expand Down
12 changes: 6 additions & 6 deletions IncludeAll.h → Src/IncludeAll.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@
#include "LinearAlgebra.h"
#include "Preprocessor.h"
#ifdef NESHNY_WEBGPU
#include "WGPUUtils.h"
#include "WebGPU/WGPUUtils.h"
#elif defined(NESHNY_GL)
#include "GLUtils.h"
#include "OpenGL/GLUtils.h"
#endif
#include "NeshnyStructs.h"
#include "Serialization.h"
#include "Core.h"
#include "Resources.h"
#ifdef NESHNY_WEBGPU
#include "EntityWebGPU.h"
#include "WebGPU/EntityWebGPU.h"
#elif defined(NESHNY_GL)
#include "EntityGL.h"
#include "OpenGL/EntityGL.h"
#endif
#include "EditorViewers.h"
#ifdef NESHNY_WEBGPU
#include "PipelineWebGPU.h"
#include "WebGPU/PipelineWebGPU.h"
#elif defined(NESHNY_GL)
#include "PipelineGL.h"
#include "OpenGL/PipelineGL.h"
#endif
#include "Geometry.h"
#ifndef NESHNY_SKIP_TESTS
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ed3157d

Please sign in to comment.