How barrier15300/cxxgametemplate works
Key System Components
• Application Entry & Core Engine:
• The main entry point (Source/Main.cpp and Source/EntryPoint.cpp) and the central game loop (evident in Game/GameMain.cpp) form the core.
• Scene Management:
• The project supports “シーン分け” (scene separation) as seen by the dedicated Scenes folder (Source/Game/Scenes) and template-based scene objects. This module controls transitions between different states or levels.
• Configuration Management:
• Use of JSON files through the Storage::Data system (as detailed in the README) indicates a subsystem dedicated to auto-generating and editing configurations.
• DxLib Wrapper Subsystem:
• Under Source/Library/Local/DxLib_wrapper there is a comprehensive wrapper around DxLib functionality. This wrapper is subdivided into:
• Media modules (GraphData, SoundData, ScreenData, FontData, etc.)
• Input modules (Keyboard, Mouse, InputState, etc.)
• Geometry and Helper modules (e.g., Geometry classes for Square, Triangle, Vertex, and helper classes for managing DXHandles).
• System and Utility Components:
• Timer, Window, and SoundDevice classes (under the “システム” section) indicate utility and system-level support.
• External Libraries:
• SDL3 serves as an external multimedia library, as found in the SDL3 directory. Its component files, CMake configuration, header files, and libraries (organized by platform) should be noted as external dependencies used by the engine.
Depicting Relationships and Data Flow
• A Game Core or Engine Core block that directs the flow of execution:
• It calls the Scene Manager to switch or update scenes.
• The Scene Manager interacts with:
• The Rendering/Graphics module (using the DxLib wrappers for Graph and Media components)
• The Input module (which processes keyboard/mouse events via DxLib’s input wrappers)
• The Configuration Manager that loads and saves game state via JSON.
• The DxLib Wrapper block should be illustrated as an abstraction layer that encapsulates low-level DirectX or DxLib interactions. This block is further subdivided into:
• Media (Graph, Sound, Screen, Font …)
• Input (Keyboard, Mouse, etc.)
• Geometry (Square, Triangle, Vertex data)
• System utilities (Timer, Window, SoundDevice)
Architectural Patterns, Component Design, and Important Principles
• Modularity and separation of concerns:
• The project is clearly organized by subsystem (scene, configuration, media, input, etc.), so group them as separate components.
• Use abstraction (wrapper pattern) for DxLib functionality. This encapsulates lower-level library calls while providing a cleaner interface for game-engine code.
• Use of template parameters in the scene system to allow flexible scene configuration.
• The configuration system leverages a “construct-if-not-found” pattern, where JSON files are loaded or generated as needed.
As Many Components as Possible
• Don’t hesitate to break down further internal structures:
• Annotations that mention “Wip” (work in progress) for components that are not fully implemented, as per the README comments.