# dxftoro/aim-trainer architecture

> Architecture diagram of the GitHub repository dxftoro/aim-trainer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dxftoro/aim-trainer
- Repository: https://github.com/dxftoro/aim-trainer

## Overview

##### Project type and purpose
- This is a native desktop application (“Aim Trainer”) written in C++ using OpenGL for rendering and the Win32 resource system for dialogs/textures. It’s not a web or microservice system but a single‐executable game that runs on Windows.

##### File structure
- Top‐level solution and project files (.sln, .vcxproj).
- Source.cpp: the application entry point and game loop.
- player_controls.h / user_interface.h: input handling and UI abstraction.
- textures.h / stb_image.h: resource loading for textures/fonts.
- resources/ and x64/{Debug,Release}/resources: asset folders for images, fonts.
- .rc and .aps/.psd files: Win32 resource scripts and art assets.

##### README for additional insights
- Describes two difficulty modes, target generation and scoring.
- No external services or databases—everything is in-memory, per run.

##### Elements
– Labels: “Win32 API”, “Game Loop”, “Input Manager”, “Renderer”, “Resource Manager”, “UI Layer”
- Window messages → Input Manager
- Input Manager → Game Logic
- Game Logic → Renderer (state in)
- Resource Manager → Renderer/UI (asset data in)
- Blue rectangles for in-process modules (Game Logic, Input, Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% OS Boundary
    subgraph "Windows OS / Win32 API"
        Win32API["Win32 API"]:::os
    end

    %% Main Executable Container
    subgraph "AimTrainer.exe"
        ApplicationCore["Application Core\n(Source.cpp)"]:::module
        InputManager["Input Manager\n(player_controls.h)"]:::module
        GameLogic["Game Logic / State\n(Source.cpp)"]:::module
        Renderer["Renderer (OpenGL)"]:::module
        ResourceManager["Resource Manager\n(stb_image.h & textures.h)"]:::module
        UILayer["UI Layer\n(user_interface.h)"]:::module
        subgraph "Third-Party Library"
            direction TB
            stb_image["stb_image"]:::thirdparty
        end
    end

    %% Assets on Disk
    AssetsDisk["Assets (images, fonts)"]:::asset

    %% Data Flow Arrows
    Win32API -->|"window messages"| ApplicationCore
    ApplicationCore -->|"dispatch events"| InputManager
    InputManager -->|"input data"| GameLogic
    GameLogic -->|"game state"| Renderer
    ApplicationCore -->|"render call"| Renderer
    Renderer -->|"draw frame"| UILayer
    ResourceManager -->|"load textures/fonts"| Renderer
    ResourceManager -->|"load resources"| UILayer
    AssetsDisk -->|"asset files"| ResourceManager

    %% Click Events
    click Win32API "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/AimTrainer.rc"
    click ApplicationCore "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/Source.cpp"
    click InputManager "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/player_controls.h"
    click GameLogic "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/Source.cpp"
    click ResourceManager "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/stb_image.h"
    click UILayer "https://github.com/dxftoro/aim-trainer/blob/main/AimTrainer/user_interface.h"
    click AssetsDisk "https://github.com/dxftoro/aim-trainer/tree/main/AimTrainer/resources/"

    %% Styles
    classDef module fill:#D0E6FF,stroke:#339,stroke-width:2px
    classDef os fill:#EEEEEE,stroke:#666,stroke-width:2px
    classDef asset fill:#E6FFE6,stroke:#2A8F2A,stroke-width:2px,shape:cylinder
    classDef thirdparty stroke-dasharray: 5 5,stroke:#999,fill:#FFF
```
