How benpm/gl_playground works
Main Components
a. Core Application & Main Loop
• Components such as main.cpp and app.cpp/app.hpp which initialize the application, manage the main loop, and orchestrate interactions between systems.
• This as the central “Application Controller” block.
b. Rendering Engine
• Components such as gfx.cpp/gfx.hpp, camera.cpp/camera.hpp, model.cpp/model.hpp, mesh.cpp, and light.cpp belong to the rendering system.
• Shader files (found in the resources/shaders directory) as part of the rendering pipeline.
• How models, textures, and lighting information are processed and rendered.
c. Physics & Simulation
• The physics module (physics.cpp/physics.hpp) indicates an interactive physics engine, with additional support for rigid body and soft body simulation.
d. Asset & Resource Management
• Assets such as models, textures, fonts, and shaders are stored in the resources directory.
• Script components (download_assets.sh, package_assets.sh, and upload_assets.sh) that manage external assets.
• This block as the “Asset Manager,” which provides data (models, textures, materials) to the rendering engine and possibly the physics system.
e. Utility Libraries & Third-Party Dependencies
• The project integrates numerous external libraries: GLFW for window/context management; eigen for math operations; glad for OpenGL extension loading; spdlog for logging; EnTT for entity-component management; and others.
• Additionally, note the use of a “lib” folder containing custom (or vendor-supplied) code that supports the project’s functionality.
f. Build & Configuration Infrastructure
• The presence of the CMakeLists.txt file, the cmake directory with several cmake configuration scripts, and platform-specific build instructions in the README should be represented as the “Build System.”
• This block can indicate preprocessing, dependency resolution, and build configuration that generates the executable.
Relationships and Data Flows
• From the "Core Application" to the "Rendering Engine" (to pass scene updates, camera positions, and command calls).
• From the "Core Application" to the "Physics Engine" (to update simulation and retrieve new object positions).
• From the "Asset Manager" to both "Rendering Engine" and "Physics Engine" (indicating that assets such as models and textures are loaded and used in these systems).
• From the "Build System" to all modules, illustrating how configuration and build scripts bring together all modules and external dependencies.
• From the "External Libraries/Dependencies" block into the "Rendering" and "Physics" blocks indicating that these libraries are integrated throughout the system.
Architectural Patterns and Design Principles
• A modular design:
• The separation between the application controller, rendering, physics simulation, and asset management suggests a modular design where each component has distinct responsibilities.
• Dependency injection and configuration via CMake:
• How the project uses CMake scripts (in the cmake folder) to integrate third-party libraries such as GLFW, Eigen, and so on.
• If applicable, point out design aspects like a scene graph approach in the interplay between the rendering and physics systems (although not explicitly a scene graph, the separation of assets and transformation data gives a similar conceptual model).
Putting It All Together
• The separation between key subsystems: the Core Application, Rendering, Physics, and Asset Management.
• The build and dependency integration layer via CMake and external libraries.
• The flow of data from asset resources through to final rendered output and physics simulation.