How nexoengine/game-engine works
Project Type and Purpose
• Type: A C++ desktop & VR game engine with an integrated scene editor.
• Purpose: Provide a modular, high-performance platform for game development (runtime engine) and a WYSIWYG editor (UX/UI layer).
File Structure
Top‐level directories:
• common: Shared utilities (logging, exceptions, math).
• engine: Core runtime (ECS, events, rendering, asset management).
• editor: UI application (ImGui-based windows, docking, document windows).
• external: Third-party libs/submodules (ImGui port, stb_image).
• scripts: Build/packaging (CMake/CPack for Windows NSIS & Linux DEB).
• examples & tests: Sample usages and unit tests (gtest).
Extract Insights from README
• Build system: CMake with presets, vcpkg integration.
• Targets: nexoEditor (GUI), engine library, tests.
• Dependencies: CMake, C++17+, OpenGL, ImGui, JSON.hpp, stb_image, gtest.
Main Components & Their Relationships
a. Components
– Editor Application
• UI Layer (ImGuiBackend → Editor windows & widgets)
• Document Windows (Scene, Assets, Inspector)
– Engine Library
• Core/Event Subsystem (event dispatch, input, window events)
• ECS Subsystem (Entities, Components, Systems, Coordinator)
• Rendering Subsystem
• Renderer API (abstraction) → OpenGLBackend
• Resources: Shaders, Textures, Buffers, Framebuffers
• Asset Management
• AssetImporter, Catalog, Context
• Factory Modules (CameraFactory, EntityFactory2D/3D, LightFactory)
• Component Definitions (Transform, Render2D/3D, Light, Camera)
– Common Utilities (Logger, Exception, Timer, Math)
– External Dependencies
• ImGui, stb_image, JSON.hpp, OpenGL drivers
– Resources (models, textures, shaders)
– Build & Packaging (CMake scripts, CPack)
– Tests & Examples
b. Interactions
1. User → Editor UI → ImGuiBackend
2. Editor → Engine API calls
3. Engine uses Common utilities for logging, timing, math
4. Engine’s Core Event subsystem propagates input/window events to ECS and UI
5. ECS orchestrates Systems; RenderSystem issues RenderCommands to Renderer API
6. Renderer API → OpenGLBackend → GPU via OS window context
7. AssetImporter loads resources from disk (resources/) into AssetCatalog for runtime
8. Build scripts compile modules, link dependencies, produce binaries and installers
Architectural Patterns & Technologies
• Layered Modular Architecture: UI (editor) vs. Core (engine) vs. Utilities vs. External libs
• ECS Pattern: decouples data (Components) from logic (Systems)
• Factory Pattern: centralized creation of cameras, lights, entities
• Adapter Pattern: RendererAPI abstracts OpenGL backend
• Publisher/Subscriber: event system (Signals, Listeners)
• Build/CI: CMake presets, vcpkg, GitHub Actions, CodeQL, Doxygen
Capturing Essential Details
• Be exhaustive: include even small modules (e.g., backends/opengl, utils/String).
• Separation of concerns (UI vs. engine logic vs. low-level APIs).