Skip to content

Commit fcdab14

Browse files
committed
feat: add docking system with layout presets and switcher
2 parents 437abd4 + 1a0273a commit fcdab14

67 files changed

Lines changed: 12548 additions & 3216 deletions

Some content is hidden

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

CMakeLists.txt

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ FetchContent_Declare(
1414
)
1515
FetchContent_MakeAvailable(googletest)
1616

17-
add_library(convoy_core)
18-
target_include_directories(convoy_core PUBLIC
19-
${CMAKE_CURRENT_SOURCE_DIR}/src
20-
)
21-
22-
find_package(GLFW3 3.4 QUIET)
2317
find_package(OpenGL QUIET)
18+
find_package(GLFW3 3.4 QUIET)
2419
find_package(GLAD QUIET)
2520
find_package(ImGui QUIET)
2621

22+
add_library(convoy_core)
23+
target_include_directories(convoy_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
24+
2725
if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
2826
target_sources(convoy_core PRIVATE
2927
src/core/window_manager.cpp
@@ -34,16 +32,23 @@ if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
3432
src/core/input/input_handler.cpp
3533
src/core/gfx/render_texture.cpp
3634
)
35+
target_include_directories(convoy_core PRIVATE
36+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui
37+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui/backends
38+
${CMAKE_CURRENT_SOURCE_DIR}/third_party/glad/include
39+
)
3740
target_link_libraries(convoy_core PUBLIC
38-
glfw
41+
GLFW3::GLFW3
3942
OpenGL::GL
4043
GLAD::GLAD
4144
ImGui::ImGui
4245
)
43-
else()
44-
target_sources(convoy_core PRIVATE
45-
src/core/event_bus.cpp
46+
target_compile_definitions(convoy_core PRIVATE
47+
GLFW_INCLUDE_NONE
48+
IMGUI_IMPL_OPENGL_LOADER_GLAD
4649
)
50+
else()
51+
target_sources(convoy_core PRIVATE src/core/event_bus.cpp)
4752
endif()
4853

4954
target_sources(convoy_core PRIVATE
@@ -53,6 +58,8 @@ target_sources(convoy_core PRIVATE
5358
src/core/commands/pixel_command.cpp
5459
src/core/plugins/plugin_registry.cpp
5560
src/core/plugins/hook_system.cpp
61+
src/core/export/caf_exporter.cpp
62+
src/shared/brush.cpp
5663
)
5764

5865
add_library(mod_architect
@@ -63,6 +70,7 @@ add_library(mod_architect
6370
src/modules/mod_architect/tools/bucket_tool.cpp
6471
src/modules/mod_architect/tools/pivot_tool.cpp
6572
src/modules/mod_architect/tools/hitbox_tool.cpp
73+
src/modules/mod_architect/tools/brush_stroke.cpp
6674
)
6775
target_include_directories(mod_architect PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src)
6876
target_link_libraries(mod_architect PUBLIC convoy_core)
@@ -94,7 +102,17 @@ if(GLFW3_FOUND AND OpenGL_FOUND AND GLAD_FOUND AND ImGui_FOUND)
94102
add_executable(convoy
95103
src/convoy/main.cpp
96104
)
97-
target_link_libraries(convoy PRIVATE convoy_core mod_architect mod_walker mod_forge mod_sequencer)
105+
target_link_libraries(convoy PRIVATE
106+
convoy_core
107+
mod_architect
108+
mod_walker
109+
mod_forge
110+
mod_sequencer
111+
GLFW3::GLFW3
112+
glfw
113+
OpenGL::GL
114+
GLAD::GLAD
115+
)
98116
endif()
99117

100118
if(MSVC)
@@ -110,4 +128,4 @@ else()
110128
endif()
111129

112130
enable_testing()
113-
add_subdirectory(tests)
131+
add_subdirectory(tests)

convoy_layout.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[Window][##ConvoyShell]
2+
Pos=0,38
3+
Size=1600,862
4+
5+
[Window][Debug##Default]
6+
Pos=60,60
7+
Size=400,400
8+
9+
[Window][Tools##Architect]
10+
Pos=69,519
11+
Size=195,253
12+
13+
[Window][Canvas##Architect]
14+
Pos=324,112
15+
Size=925,686
16+
17+
[Window][Layers##Architect]
18+
Pos=60,250
19+
Size=150,180
20+
21+
[Window][Properties##Architect]
22+
Pos=1395,81
23+
Size=135,160
24+

docs/BUILD.md

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
# Building Convoy
2+
3+
> Complete build instructions for the Convoy project.
4+
5+
## Table of Contents
6+
7+
1. [System Requirements](#system-requirements)
8+
2. [Dependencies](#dependencies)
9+
3. [Build Steps](#build-steps)
10+
4. [Troubleshooting](#troubleshooting)
11+
12+
---
13+
14+
## System Requirements
15+
16+
- **OS**: Linux (x86-64)
17+
- **C++ Standard**: C++17 or later
18+
- **Compiler**: g++ 11+ or clang++ 13+
19+
- **CMake**: Version 3.18 to 3.28 (versions 4.x have issues with this project)
20+
- **RAM**: Minimum 4GB (for linking)
21+
22+
---
23+
24+
## Dependencies
25+
26+
### Required System Packages
27+
28+
```bash
29+
sudo apt-get install -y \
30+
build-essential \
31+
cmake \
32+
libglfw3-dev \
33+
libgl1-mesa-dev \
34+
libxrandr-dev \
35+
libxinerama-dev \
36+
libxcursor-dev \
37+
libxi-dev
38+
```
39+
40+
### Included Dependencies (via Conan or Git Submodules)
41+
42+
- **GLFW3** - Window and input management
43+
- **OpenGL** - 3D graphics API (via GLAD loader)
44+
- **ImGui** - Immediate mode UI framework
45+
- **GoogleTest** - Testing framework
46+
- **GLAD** - OpenGL function loader
47+
48+
---
49+
50+
## Build Steps
51+
52+
### 1. Clone the Repository
53+
54+
```bash
55+
git clone https://github.com/your-org/Convoy.git
56+
cd Convoy
57+
```
58+
59+
### 2. Create Build Directory
60+
61+
```bash
62+
mkdir -p build
63+
cd build
64+
```
65+
66+
### 3. Configure with CMake
67+
68+
```bash
69+
cmake .. -DCMAKE_BUILD_TYPE=Release
70+
```
71+
72+
**Options:**
73+
- `-DCMAKE_BUILD_TYPE=Debug` - Debug build with symbols
74+
- `-DCMAKE_BUILD_TYPE=Release` - Optimized release build
75+
- `-DCMAKE_BUILD_TYPE=RelWithDebInfo` - Release with debug symbols
76+
77+
### 4. Build the Project
78+
79+
```bash
80+
cmake --build . --config Release --parallel 4
81+
```
82+
83+
**Or using make directly:**
84+
85+
```bash
86+
make -j4
87+
```
88+
89+
**Expected output:**
90+
```
91+
[ 2%] Built target convoy_glad
92+
[ 34%] Built target convoy_core
93+
[ 67%] Built target mod_architect
94+
[ 78%] Built target mod_walker
95+
[ 89%] Built target mod_forge
96+
[100%] Built target convoy
97+
```
98+
99+
### 5. Verify Build Success
100+
101+
```bash
102+
ls -lh ./convoy
103+
file ./convoy
104+
ldd ./convoy
105+
```
106+
107+
**Expected:**
108+
- Binary size: ~1.7MB
109+
- Type: ELF 64-bit LSB pie executable
110+
- All dependencies resolved (libglfw.so.3, libOpenGL.so.0, libc.so.6, etc.)
111+
112+
---
113+
114+
## Running the Application
115+
116+
### Execute the Binary
117+
118+
```bash
119+
./convoy
120+
```
121+
122+
**Expected output:**
123+
```
124+
[INFO] WindowManager initialized 1600x900
125+
```
126+
127+
The window should open and display the ImGui interface.
128+
129+
---
130+
131+
## Build Artifacts
132+
133+
After successful build:
134+
135+
```
136+
Convoy/build/
137+
├── convoy # Main executable (1.7MB)
138+
├── libconvoy_core.a # Core library
139+
├── libmod_architect.a # Architect module
140+
├── libmod_walker.a # Walker module
141+
├── libmod_forge.a # Forge module
142+
├── libmod_sequencer.a # Sequencer module
143+
├── libconvoy_glad.a # OpenGL loader
144+
└── CMakeFiles/ # Build configuration
145+
```
146+
147+
---
148+
149+
## Development Build
150+
151+
For faster iteration during development:
152+
153+
```bash
154+
cd build
155+
cmake .. -DCMAKE_BUILD_TYPE=Debug
156+
cmake --build . --config Debug --parallel 4
157+
```
158+
159+
Then run with debugger:
160+
161+
```bash
162+
gdb ./convoy
163+
(gdb) run
164+
```
165+
166+
---
167+
168+
## Clean Build
169+
170+
To remove all build artifacts and start fresh:
171+
172+
```bash
173+
cd Convoy
174+
rm -rf build
175+
mkdir build
176+
cd build
177+
cmake .. -DCMAKE_BUILD_TYPE=Release
178+
cmake --build .
179+
```
180+
181+
---
182+
183+
## Build on macOS
184+
185+
macOS build has different dependency paths. Install via Homebrew:
186+
187+
```bash
188+
brew install cmake glfw3 glad
189+
```
190+
191+
Then follow the standard build steps above. Note: OpenGL version may differ (use `-DGLFW_INCLUDE_NONE`).
192+
193+
---
194+
195+
## Build on Windows
196+
197+
For Windows (experimental):
198+
199+
1. Install Visual Studio 2019 or newer
200+
2. Install CMake 3.18+
201+
3. Install GLFW3 and dependencies via vcpkg:
202+
```bash
203+
vcpkg install glfw3 glad imgui
204+
```
205+
4. Configure with Visual Studio generator:
206+
```bash
207+
cmake .. -G "Visual Studio 17 2022"
208+
cmake --build . --config Release
209+
```
210+
211+
---
212+
213+
## Troubleshooting
214+
215+
### CMake Configuration Fails
216+
217+
**Error:** `CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.28 or higher is required.`
218+
219+
**Solution:** Update CMake or explicitly use supported version:
220+
```bash
221+
cmake .. -DCMAKE_BUILD_TYPE=Release # Version 3.18-3.28 only
222+
```
223+
224+
### OpenGL/GLAD Initialization Error
225+
226+
**Error:** `error: OpenGL header already included`
227+
228+
**Solution:** Ensure `#define GLFW_INCLUDE_NONE` comes BEFORE `#include <GLFW/glfw3.h>` in all .cpp files.
229+
230+
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for more issues.
231+
232+
---
233+
234+
## Next Steps
235+
236+
- **Run the application**: `./convoy`
237+
- **Read development guide**: See [DEVELOPMENT.md](DEVELOPMENT.md)
238+
- **Understand architecture**: See [ARCHITECTURE.md](ARCHITECTURE.md)
239+
- **Get started coding**: See [QUICK_START.md](QUICK_START.md)

0 commit comments

Comments
 (0)