Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add back-end for Asset management #63

Draft
wants to merge 18 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8de2d1d
feat(asset-manager): add start of Asset Manager, window + class
Thyodas Nov 19, 2024
8cef7c1
fix(asset-manager): update layout ini for asset manager window
Thyodas Nov 24, 2024
6e9de47
feat(asset-manager): add AssetRef
Thyodas Nov 29, 2024
20f8668
feat(asset-back): move graphics API implementations to a subfolder
Thyodas Dec 5, 2024
a5f88fe
feat(asset-back): add start of assets backend
Thyodas Dec 5, 2024
3fd6594
fix(asset-back): invalid include + useless init list
Thyodas Dec 5, 2024
4a73292
ci(asset-back): temp fail test to check CI failure on windows
Thyodas Dec 5, 2024
b6ec323
ci(asset-back): add temp verbose to check windows tests output
Thyodas Dec 5, 2024
9107729
fix(asset-back): now check if tests at least ran with gtest
Thyodas Dec 5, 2024
eb32ce5
feat(asset-back): add Mesa install to run headless tests on Windows
Thyodas Dec 5, 2024
a234148
feat(asset-back): prevent Visual Studio from creating per config sub dir
Thyodas Dec 5, 2024
62dd58c
feat(asset-back): fix back the temp failed test
Thyodas Dec 5, 2024
2b4e3be
feat(asset-back): reduce verbosity for passed tests
Thyodas Dec 5, 2024
32b433e
feat(asset-back): add AssetName and tests
Thyodas Dec 7, 2024
30a8650
feat(asset-back): fix symlink errors on Windows, add troubleshooting doc
Thyodas Dec 11, 2024
2cb5755
fix(asset-back): missing deps
Thyodas Dec 11, 2024
86cc453
chore(asset-back): add more troubleshooting doc for cmake infinite loop
Thyodas Dec 11, 2024
2693045
feat(asset-back): add ValidatedName (string wrapper to guarantee name)
Thyodas Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ jobs:
CMAKE_C_COMPILER: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clang || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gcc || '' }}
CMAKE_CXX_COMPILER: ${{ matrix.compiler == 'clang' && steps.set-up-clang.outputs.clangxx || matrix.compiler == 'gcc' && steps.set-up-gcc.outputs.gxx || '' }}

- name: Install Mesa for Windows
shell: cmd
if: ${{ matrix.os == 'windows-latest' }}
run: |
curl.exe -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/20.3.2/mesa3d-20.3.2-release-msvc.7z
"C:\Program Files\7-Zip\7z.exe" x mesa.7z
mklink opengl32.dll "x64\opengl32.dll"
mklink libglapi.dll "x64\libglapi.dll"
working-directory: 'build'

- name: Run headless test
uses: coactions/setup-xvfb@v1
with:
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 20)
set(NEXO_COVERAGE OFF CACHE BOOL "Enable coverage for binaries")
set(NEXO_GIT_SUBMODULE OFF CACHE BOOL "Enable git submodules init and update")
set(NEXO_BOOTSTRAP_VCPKG OFF CACHE BOOL "Enable vcpkg bootstrap")
set(NEXO_BUILD_TESTS ${BUILD_TESTING} CACHE BOOL "Enable tests")
set(NEXO_BUILD_TESTS ON CACHE BOOL "Enable tests")
set(NEXO_BUILD_EXAMPLES OFF CACHE BOOL "Enable examples")
set(NEXO_GRAPHICS_API "OpenGL" CACHE STRING "Graphics API to use")

Expand All @@ -32,6 +32,10 @@ add_compile_options(
"$<$<CONFIG:Release>:${NEXO_COMPILER_FLAGS_RELEASE}>"
)

# Prevent Visual Studio (or other build tools) from creating per config sub-directories (e.g. Debug, Release)
# Useful to look for resource files relative to the executable path
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_BINARY_DIR}>)

if (NEXO_COVERAGE)
message(STATUS "Coverage enabled, adding flags: ${NEXO_COVERAGE_FLAGS}")
add_compile_options("$<$<CONFIG:Debug>:${NEXO_COVERAGE_FLAGS}>")
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ cd build
ctest -C Debug
```

## Troubleshooting

If you encounter any issues, please refer to our [Troubleshooting Guide](docs/troubleshooting/troubleshooting.md).

## The Team

NEXO Engine is brought to life by a dedicated team of fourth-year students from EPITECH Strasbourg:
Expand Down
146 changes: 65 additions & 81 deletions config/default-layout.ini
Original file line number Diff line number Diff line change
@@ -1,115 +1,95 @@
[Window][DockSpaceViewport_11111111]
Pos=0,24
Size=1920,1056
Collapsed=0

[Window][Debug##Default]
Pos=60,60
Pos=118,38
Size=400,400
Collapsed=0

[Window][3D View]
Pos=368,24
Size=609,645
[Window][Scene Tree]
Pos=1499,45
Size=421,1035
Collapsed=0
DockId=0x00000005,0
DockId=0x00000002,0

[Window][Dear ImGui Demo]
Pos=0,42
Size=365,1038
Collapsed=0
DockId=0x00000003,0

[Window][Example: Console]
Pos=374,648
Size=1080,352
Collapsed=0
DockId=0x00000005,0

[Window][Example: Custom rendering]
Pos=197,282
Size=531,414
[Window][Console]
Pos=0,643
Size=1496,437
Collapsed=0
DockId=0x0000000A,0

[Window][Dear ImGui Style Editor]
Pos=0,766
Size=1460,234
[Window][Default scene]
Pos=0,45
Size=1496,595
Collapsed=0
DockId=0x00000009,0

[Window][Dear ImGui ID Stack Tool]
Pos=601,19
Size=796,467
[Window][WindowOverViewport_11111111]
Pos=0,45
Size=1920,1035
Collapsed=0

[Window][Example: Log]
Pos=347,534
Size=500,400
[Window][Example: Assets Browser]
Pos=60,60
Size=800,480
Collapsed=0

[Window][Example: Property editor]
Pos=60,60
Pos=156,340
Size=430,450
Collapsed=1
Collapsed=0

[Window][Example: Auto-resizing window]
Pos=828,476
Size=377,369
[Window][Example: Property editor/##tree_73339443]
IsChild=1
Size=300,410

[Window][DockSpace Demo]
Pos=0,24
Size=3000,1852
Collapsed=0

[Window][Example: Long text display]
[Window][Example: Console]
Pos=60,60
Size=520,600
Collapsed=0

[Window][Example: Constrained Resize]
Pos=295,346
Size=421,401
[Window][Example: Simple layout]
Pos=60,60
Size=500,440
Collapsed=0

[Window][Dear ImGui Demo/ResizableChild_D5443E47]
[Window][Example: Simple layout/left pane_AED60EF8]
IsChild=1
Size=484,192
Size=150,376

[Window][Dear ImGui Demo/Red_1D4E05CE]
IsChild=1
Size=200,100

[Window][Dear ImGui Debug Log]
[Window][Example: Auto-resizing window]
Pos=60,60
Size=470,216
Size=398,320
Collapsed=0

[Window][Example: Documents]
Pos=155,83
Size=616,1050
[Window][Create New Scene]
Pos=732,456
Size=540,200
Collapsed=0

[Window][Scene Tree]
Pos=1499,45
Size=421,1035
Collapsed=0
DockId=0x00000002,0

[Window][Properties]
Pos=979,405
Size=421,495
[Window][test]
Pos=802,42
Size=838,721
Collapsed=0
DockId=0x00000008,0

[Window][DockSpaceViewport_11111111]
Pos=0,24
Size=1400,876
Collapsed=0

[Window][DockSpace Demo]
Pos=0,24
Size=1920,985
Collapsed=0

[Window][Dear ImGui Metrics/Debugger]
Pos=598,209
Size=780,651
Collapsed=0

[Window][Console]
Pos=0,643
Size=1496,437
[Window][Dear ImGui ID Stack Tool]
Pos=605,120
Size=839,766
Collapsed=0
DockId=0x0000000A,0

[Window][Import]
Pos=76,121
Expand All @@ -133,19 +113,23 @@ Collapsed=0

[Window][ImGui in Raylib Example]
Pos=421,64
Size=800,800
Collapsed=0

[Window][WindowOverViewport_11111111]
Pos=0,45
Size=1920,1035
Collapsed=0

[Window][Default scene]
Pos=0,45
Size=1496,595
[Window][Asset Manager]
Pos=0,643
Size=1496,437
Collapsed=0
DockId=0x00000009,0
DockId=0x0000000A,1

[Table][0xDDC24BCA,2]
RefScale=18
Column 0 Sort=0v

[Table][0xAC9A836A,2]
RefScale=18
Column 0 Width=4
Column 1 Weight=2.0000

[Table][0xC9935533,3]
Column 0 Weight=1.0000
Expand Down Expand Up @@ -284,7 +268,7 @@ DockSpace ID=0x11111111 Window=0xA87D555D Pos=0,45 Size=1920,1035 Split=X
DockNode ID=0x00000004 Parent=0x11111111 SizeRef=1552,1038 Split=X
DockNode ID=0x00000001 Parent=0x00000004 SizeRef=1496,1038 Split=Y
DockNode ID=0x00000009 Parent=0x00000001 SizeRef=1128,598 CentralNode=1 Selected=0xDBE0A5BF
DockNode ID=0x0000000A Parent=0x00000001 SizeRef=1128,437 Selected=0x49278EEE
DockNode ID=0x0000000A Parent=0x00000001 SizeRef=1128,437 Selected=0x0E238246
DockNode ID=0x00000002 Parent=0x00000004 SizeRef=421,1038 Selected=0x3576480E
DockSpace ID=0x8B93E3BD Pos=0,24 Size=1400,876 Split=X Selected=0x3576480E
DockNode ID=0x00000007 Parent=0x8B93E3BD SizeRef=977,876 Split=Y
Expand Down
86 changes: 86 additions & 0 deletions docs/troubleshooting/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
\page troubleshooting Troubleshooting

# Build Troubleshooting

## Table of Contents

- [Common Issues](#common-issues)
- [Couldn't create symlink](#couldnt-create-symlink)
- [CPackDeb: file utility is not available](#cpackdeb-file-utility-is-not-available)
- [CMake configure/build infinite loop](#cmake-configurebuild-infinite-loop)
- [Still having issues? Any other questions?](#still-having-issues-any-other-questions)

## Common Issues

### Couldn't create symlink

If you encounter the following error message when packing with `cpack -G DEB`:

```bash
NEXO Engine symlink couldn't be created. Required for the DEB package generator. See README's troubleshooting section.
```

To create an installer using the cpack DEB generator, our scripts try to create
a symlink to NEXO's binary. This symlink is
required for installing NEXO in the path of a DEB compatible linux distribution.

#### Solution

If you are running Windows:
- Either ignore this message, since you may not want to generate a DEB package.
- If you still want to generate a DEB package, you should enable Windows Developer Mode,
see [Microsoft Documentaion](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development).
And rerun the cmake configure, build and cpack commands.

> [!WARNING]
> If you are running Windows, you may not want to generate a DEB package. It may not be supported.

If you are running another OS, it is unexpected, so please submit an issue [here](https://github.com/NexoEngine/game-engine/issues)
with the details of your OS and the error message; we will help you from there.

### CPackDeb: file utility is not available

If you encounter the following error message when packing with `cpack -G DEB`:

```bash
CPackDeb: file utility is not available. CPACK_DEBIAN_PACKAGE_SHLIBDEPS
and CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS options are not available.
```

The DEB generator couldn't find the `file` command.

#### Solution

You need to install the `file` command on your system.

On Ubuntu/Debian, you can install it with the following command:

```bash
sudo apt update && sudo apt install file
```

On Windows (using chocolatey), you can install it with the following command on an elevated PowerShell:

```bash
choco install file
```

> [!WARNING]
> If you are running Windows, you may not want to generate a DEB package. It may not be supported.

### CMake configure/build infinite loop

If you encounter an infinite loop when running the `cmake` command, it may be due to various reasons.

#### Solution

- Check if date and time are set correctly on your system.
- Something is modifying cmake files after each run. Check if you have any scripts or tools that modify the CMake files.
- Try to delete the `build` (might be another name) directory and rerun the `cmake` command.

## Still having issues? Any other questions?

If you are still having issues, please submit an issue [here](https://github.com/NexoEngine/game-engine/issues)
with the details of your problem. Thank you!


28 changes: 16 additions & 12 deletions editor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(SRCS
common/Exception.cpp
common/math/Matrix.cpp
editor/main.cpp
editor/src/backends/ImGuiBackend.cpp
editor/src/backends/opengl/openglImGuiBackend.cpp
editor/src/Editor.cpp
editor/src/SceneManagerBridge.cpp
editor/src/DocumentWindows/ConsoleWindow.cpp
editor/src/DocumentWindows/MainScene.cpp
editor/src/DocumentWindows/SceneTreeWindow.cpp
editor/src/DocumentWindows/PopupManager.cpp
editor/src/DocumentWindows/SceneViewManager.cpp
common/Exception.cpp
common/math/Matrix.cpp
editor/main.cpp
editor/src/backends/ImGuiBackend.cpp
editor/src/backends/opengl/openglImGuiBackend.cpp
editor/src/Editor.cpp
editor/src/SceneManagerBridge.cpp
editor/src/DocumentWindows/ConsoleWindow.cpp
editor/src/DocumentWindows/MainScene.cpp
editor/src/DocumentWindows/SceneTreeWindow.cpp
editor/src/DocumentWindows/PopupManager.cpp
editor/src/DocumentWindows/SceneViewManager.cpp
editor/src/DocumentWindows/AssetManagerWindow.cpp
)

# Windows App Icon
Expand Down Expand Up @@ -79,6 +80,9 @@ target_link_libraries(nexoEditor PRIVATE tinyfiledialogs::tinyfiledialogs)
find_package(Boost CONFIG REQUIRED COMPONENTS dll)
target_link_libraries(nexoEditor PRIVATE Boost::dll)

# Boost UUID
find_package(boost_uuid CONFIG REQUIRED)

include_directories(include)

if(NEXO_GRAPHICS_API STREQUAL "OpenGL")
Expand Down
Loading
Loading