Skip to content

Commit

Permalink
Merge pull request #14 from fszewczyk/ecs
Browse files Browse the repository at this point in the history
Entity Component System, Rendering and Asset Management
  • Loading branch information
fszewczyk authored Oct 22, 2024
2 parents dd7327c + 54c3874 commit 3e4ac1a
Show file tree
Hide file tree
Showing 149 changed files with 45,822 additions and 3,758 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ resources/*.py
*.clang-format
*.ini
*.vscode
.DS_Store
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
path = extern/pybind11
url = ../../pybind/pybind11
branch = stable
[submodule "extern/tinyobjloader"]
path = extern/tinyobjloader
url = git@github.com:tinyobjloader/tinyobjloader.git
126 changes: 19 additions & 107 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,121 +19,33 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

find_package(PythonLibs REQUIRED)
find_package (Python3 COMPONENTS Interpreter Development)
include_directories(${PYTHON_INCLUDE_DIRS})

include(${CMAKE_CURRENT_SOURCE_DIR}/extern/extern.cmake)

add_library(
ui
src/ui/UI.cpp
src/ui/Widget.cpp
src/ui/UIComponent.cpp

src/ui/widgets/PreviewWidget.cpp
src/ui/widgets/ObjectsWidget.cpp
src/ui/widgets/ConsoleWidget.cpp
src/ui/widgets/PropertiesWidget.cpp
src/ui/widgets/FilesystemWidget.cpp
src/ui/widgets/SceneWidget.cpp

src/ui/components/TransformUIComponent.cpp
src/ui/components/ScriptUIComponent.cpp
src/ui/components/shapes/ShapeUIComponent.cpp
src/ui/components/shapes/ShapeCircleUIComponent.cpp
src/ui/components/shapes/ShapeRectangleUIComponent.cpp
src/ui/components/shapes/ShapeLineUIComponent.cpp
)

add_library(
core
src/core/Entity.cpp
src/core/Image.cpp
src/core/Filesystem.cpp
src/core/UUID.cpp
)


add_library(
game
src/game/Game.cpp
src/game/GameObject.cpp
src/game/Component.cpp

src/game/components/ScriptComponent.cpp
src/game/components/shapes/ShapeComponent.cpp
src/game/components/shapes/ShapeCircleComponent.cpp
src/game/components/shapes/ShapeRectangleComponent.cpp
src/game/components/shapes/ShapeLineComponent.cpp
)

add_library(
renderer
src/renderer/Renderer.cpp
)

add_library(
python
src/python/Interpreter.cpp
src/python/Events.cpp
src/python/StaticAnalysis.cpp
)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/AssetManager)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/Components)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/ECS)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/Rendering)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/Runtime)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/UI)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/InputManager)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src/Systems)

add_executable(ShkyeraEngine src/main.cpp)

target_include_directories(ShkyeraEngine PRIVATE src)
target_include_directories(ui PRIVATE
src
${CMAKE_CURRENT_SOURCE_DIR}/extern/imgui
${CMAKE_CURRENT_SOURCE_DIR}/extern/glfw/include
)
target_include_directories(core PRIVATE
src
${CMAKE_CURRENT_SOURCE_DIR}/extern/glm
${CMAKE_CURRENT_SOURCE_DIR}/extern/stbi
)
target_include_directories(game PRIVATE
src
${CMAKE_CURRENT_SOURCE_DIR}/extern/glm
)
target_include_directories(renderer PRIVATE
src
)
target_include_directories(python PRIVATE
src
${CMAKE_CURRENT_SOURCE_DIR}/extern/pybind11/include
)
target_include_directories(
ShkyeraEngine
PUBLIC

target_link_libraries(ShkyeraEngine ui)
target_link_libraries(ui
imgui
glfw
glad
game
python
renderer
)
target_link_libraries(game
core
python
renderer
)
target_link_libraries(renderer
glfw
glad
glm::glm
)
target_link_libraries(core
stb_image
glfw
glad
glm::glm
)
target_link_libraries(python
${PYTHON_LIBRARIES}
pybind11::embed
renderer
ui
${CMAKE_SOURCE_DIR}/src
)

target_link_libraries(
ShkyeraEngine
PUBLIC

UI
Runtime
)
1 change: 1 addition & 0 deletions extern/buildTinyobjloader.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(extern/tinyobjloader)
1 change: 1 addition & 0 deletions extern/extern.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/extern/buildGlad.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/extern/buildGlm.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/extern/buildStbi.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/extern/buildPybind.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/extern/buildTinyobjloader.cmake)
2 changes: 1 addition & 1 deletion extern/glm
Submodule glm updated 1663 files
1 change: 1 addition & 0 deletions extern/tinyobjloader
Submodule tinyobjloader added at 50461d
Loading

0 comments on commit 3e4ac1a

Please sign in to comment.