How fazlibeqir/kompjuterska-grafika-projekt works
Main Components
• Game Application Core: At the heart lies the game loop, managed in main.cpp and game-related files (Game.cpp/h, GlobalVariables, MainMenu, etc.) which coordinate navigation between game states.
• Rendering Engine: This handles graphics (using OpenGL via the Glitter boilerplate), shader management (see the Shaders directory with car.frag, skybox.vert, etc.), camera handling (camera.hpp), and mesh/model management (mesh.hpp, Model.hpp).
• Physics Engine: Integration with the Bullet physics library is evident from the Physics files (Physics.cpp/h). This component simulates collisions, car dynamics, and environmental physics.
• Audio System: Managed via Audio.cpp/h files along with irrKlang library integration—this handles music and sound effects.
• Input Handling: The project uses GLFW (as configured via CMake and GLFW dependencies) to capture keyboard inputs for controlling the car, camera, and menu options.
• Asset Management: With well-organized asset folders for models, textures, shaders, and audio files, this component handles resource loading (models from .obj, textures from .bmp, etc.), often facilitated by libraries like assimp and stb.
• Utility Modules: These include ancillary modules like GlobalVariables for configuration, scoring/logging (Score.hpp), and initialization (init.h/cpp) routines.
Relationships and Interactions
• The Game Application Core coordinates the game loop and interacts with the Rendering Engine (for display), the Physics Engine (to update physics), and the Audio System (to play sounds).
• The Rendering Engine uses shaders and handles the drawing of the Scene, meshes, skybox, and terrain.
• Physics updates from Bullet are applied to the state of the game objects which then affects rendering outputs.
• Input events captured via GLFW are passed to the Game Core for processing (e.g., car movement, camera control).
• The Asset Management module supplies models, textures, and audio resources to the graphics and audio subsystems.
Important Architectural Patterns
• Separation of Concerns: The project divides responsibilities among distinct modules (graphics, physics, audio, input, assets), promoting modularity.
• Hierarchical Layering: Lower-level systems (asset loading, shader management) support higher-level game logic.
• Integration of External Libraries: Notice how external libraries are incorporated as specialized modules within the system, reflecting a plug-in-like design where each library manages its dedicated functionality.
Relevant Technologies and Frameworks
• C++ for core application logic.
• OpenGL for rendering, with the Glitter boilerplate facilitating setup.
• Bullet for the physics engine.
• GLFW for window management and input handling.
• irrKlang for audio.
• Additional libraries assimp, glm, and stb for model, math, and texture support.
Specific Elements
• Clear Labels: Name each block (Game Core, Rendering Engine, Physics Engine, Audio System, Input Handler, Asset Manager).
• External Libraries: Represent these as annotated external modules (e.g., “Bullet Physics”, “irrKlang Audio”) connected with integration lines to their respective subsystems.