How mrsinho/shengine works
Main Components
• Core Engine and Libraries:
– The “collection” directory encompasses the engine’s core functionality. This includes modules such as:
▪ shengine – providing core engine services (rendering, window management, profiling, input, UI integration, etc.).
▪ shapplication-host – acting as a host layer for application logic.
▪ shcomponents – containing utility components like camera, transform, and identity.
▪ shenvironment – for file utilities and environment configuration.
▪ shterminal – for terminal I/O and logging.
▪ sheditor – if there’s any editor or live tweaking of the engine features.
– In addition, the “collection/externals” subfolder contains third-party or dependent libraries (like cglm, glfw, plyimporter, shgui, shserial, shthreads, shvulkan, smd). Represent these as either external dependencies or specialized libraries that the core engine calls upon.
• Sample Applications:
– The “applications” folder contains concrete examples (“noise”, “triangle”) that utilize the engine libraries. These serve to demonstrate and test engine functionalities.
– Each app has its own shaders (SPIR-V binaries, and human-readable shader sources), SMD scripts (for serialization or configuration), and C source files that integrate with the engine’s API.
• Build and CI Process:
– The presence of CMakeLists.txt files (both at the root and in multiple subdirectories) shows that CMake defines the build configuration.
– The “.shci” folder includes CI scripts and build logs for both Linux and Windows builds.
Relationships and Interactions
• The build system (CMake, export-application.py and CI scripts) orchestrates the compilation and configuration of all these components. Indicate the flow from build scripts to both engine libraries and sample apps.
Architectural Patterns and Design Principles
• Modular Architecture: The engine is designed as a series of loosely coupled libraries. Each module – such as rendering (shengine), application host, UI (via shgui), and utility components – can be joined together depending on the needs of a particular application.
• Clear Separation of Concerns: There is a distinct separation between the core engine functionality and concrete sample applications demonstrating usage.
• Build Automation: The integration of CMake and CI scripts implies a robust continuous integration system across multiple platforms.
• Native Scripting and Serialization: Note the handling of native scripting (C code scripts in SMD files) and serialization techniques which are integral parts of the design.
• Branch out to the “Sample Applications” that depend on these libraries.
• A side section for “External Dependencies” that feed into the core engine’s functionality.
• “Build and CI Infrastructure” as a pipeline that interacts with the entire code base.
• Keep the overall layout clear and not overly cluttered, so each module’s responsibilities and interactions are immediately understandable.