# virtualdrivers/virtual-display-driver architecture

> Architecture diagram of the GitHub repository virtualdrivers/virtual-display-driver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/virtualdrivers/virtual-display-driver
- Repository: https://github.com/virtualdrivers/virtual-display-driver

## Overview

##### Main Components
- Driver Core Module: Represented by the “Virtual Display Driver (HDR)” directory. This is where the main driver implementation lives (e.g., Driver.cpp, Driver.h, MttVDD.sln, and other related files). This component is responsible for interfacing with Windows, presenting the virtual display, and managing EDID settings.
- Common Library/Shared Components: The “Common” directory holds shared include files (such as AdapterOption.h) that likely define configurations and common utilities used by the driver.
- Community Scripts: In the “Community Scripts” folder, you have various PowerShell and batch scripts that help change settings (e.g., refresh rates, rotation, scaling, etc.) and assist with dependency setup. These scripts can be considered auxiliary modules that interact with the driver post-installation.
- Build and Integration Pipeline: The .github folder and its workflows (e.g., compile.yml, Submit-To-SignPath.yml) illustrate the continuous integration and build/signing pipeline. This component covers automated compilation, testing, and code-signing integration with services like SignPath.
- External Dependencies and Environment: Noted in the README (such as the Microsoft Visual C++ Redistributable requirement) and the dependency on specific Windows components (Device Manager and display subsystem). Include also the driver signing infrastructure such as SignPath.io.

##### Relationships and Interactions
- The Driver Core uses shared functionality defined in the Common libraries.
- Community Scripts interact with the installed driver to change configurations at runtime or assist in testing and troubleshooting.
- The build pipeline (triggered via GitHub workflows) compiles the driver source and may automatically trigger signing and packaging processes.
- External dependencies such as the Visual C++ Redistributable ensure the build runs successfully and provide runtime support.
- User interactions occur during installation (through official installers available via the Releases page) and post-install configuration (via manual checks in Device Manager or executing community scripts).

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project clearly separates core driver logic, shared components, and management scripts.
- Modularity: Organized directories hint at modular development—with the driver code isolated from the configuration scripts and community contributions.
- Continuous Integration/Deployment: GitHub workflows facilitate automated build and signing processes.
- Extensibility: The presence of a community scripts folder and modular include files suggests the design is intended to be extensible and configurable for various use cases (streaming, VR, headless server setups).

##### Components and Technology Stack
- Programming Language: C++ for the driver (as evidenced by Visual Studio solution files and C++ project files).
- Build/CI Environment: GitHub Actions governing the compile process, submission for signing, etc.
- Scripting: Powershell and batch scripts for auxiliary functionalities.
- Windows Driver Model and EDID standards for virtual display management.
- External services: SignPath for code signing and dependency handling.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Components Subgraph
    subgraph "Driver System"
        DC["Driver Core\n(Virtual Display Driver (HDR))"]:::driverCore
        CL["Common Libraries\n(Common)"]:::common
        MS["Management & Utility Scripts\n(Community Scripts)"]:::scripts
        CI["Build & CI Pipeline\n(.github/workflows)"]:::ci
        ED["External Dependencies\n(Visual C++ Redistributable, SignPath.io, Windows OS)"]:::external
    end

    %% Relationships and Interactions
    CI -->|"build&sign"| DC
    CL -->|"sharedConfig"| DC
    MS -->|"runtimeInteraction"| DC
    ED -->|"runtimeSupport"| DC

    %% Click Events
    click DC "https://github.com/virtualdrivers/virtual-display-driver/tree/master/Virtual Display Driver (HDR)/MttVDD"
    click CL "https://github.com/virtualdrivers/virtual-display-driver/tree/master/Common/Include"
    click MS "https://github.com/virtualdrivers/virtual-display-driver/tree/master/Community Scripts"
    click CI "https://github.com/virtualdrivers/virtual-display-driver/tree/master/.github/workflows"

    %% Styles
    classDef driverCore fill:#f9c,stroke:#333,stroke-width:2px;
    classDef common fill:#ff9,stroke:#333,stroke-width:2px;
    classDef scripts fill:#9f9,stroke:#333,stroke-width:2px;
    classDef ci fill:#9ff,stroke:#333,stroke-width:2px;
    classDef external fill:#f99,stroke:#333,stroke-width:2px;
```
