Skip to main content

Overview

The Sorting Algorithms Visualiser has minimal dependencies, relying primarily on SFML for graphics and multimedia functionality. Dependencies are managed through vcpkg, Microsoft’s C++ package manager.

Core Dependencies

SFML (Simple and Fast Multimedia Library)

Version 2.6.2 - A multimedia library providing graphics, window management, and event handling

SFML Components Used

The project utilizes several SFML modules:

Graphics

sf::RenderWindow - Main application windowsf::RectangleShape - Used to visualize data elements as vertical barssf::Color - Color management for visual elements and buttons

Text & Fonts

sf::Font - Font loading and managementsf::Text - Rendering text for UI elements (button labels, counters, algorithm names)

Window Management

sf::VideoMode - Window configuration and display settingssf::View - Camera and viewport management

Event Handling

sf::Event - Processing user input (mouse clicks, keyboard input)sf::Mouse - Mouse position and button state tracking

Dependency Configuration

The project uses vcpkg manifest mode for dependency management. Dependencies are declared in vcpkg.json:
{
  "dependencies": [
    "sfml"
  ],
  "overrides": [
    {
      "name": "sfml",
      "version": "2.6.2"
    }
  ]
}

Version Override

The project explicitly pins SFML to version 2.6.2 using the overrides section. This ensures consistent builds across different environments and prevents potential breaking changes from newer SFML versions.
The version override guarantees that all developers and build systems use the exact same SFML version, avoiding compatibility issues.

vcpkg Configuration

The vcpkg-configuration.json file specifies the package registry settings:
{
  "default-registry": {
    "kind": "git",
    "baseline": "b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01",
    "repository": "https://github.com/microsoft/vcpkg"
  },
  "registries": [
    {
      "kind": "artifact",
      "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
      "name": "microsoft"
    }
  ]
}

Understanding the Configuration

1

Default Registry

Points to the official Microsoft vcpkg repository with a specific baseline commit. This ensures reproducible builds by locking to a known-good state of the package registry.
2

Baseline Commit

The baseline b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01 represents a specific snapshot of the vcpkg registry, ensuring all packages are resolved to compatible versions.
3

Artifact Registry

The Microsoft artifact registry provides additional packages and tools through the vcpkg-ce-catalog.

Asset Dependencies

In addition to code dependencies, the project requires asset files:

Font Files

Roboto-Regular.ttf

Located in assets/Roboto-Regular.ttfUsed for rendering all UI text including:
  • Button labels
  • List size counter
  • Algorithm names and status
  • Help text
The font is loaded at startup:
font.loadFromFile("assets/Roboto-Regular.ttf");
The application will fail to display text properly if the font file is missing. Ensure the assets folder is accessible from the executable’s working directory.

Image Assets

  • assets/Algo.png - Application icon displayed in the title bar and taskbar

Build-Time Dependencies

The project requires the following build tools:
  • Visual Studio 2019 or later with C++20 support
  • Windows 10 SDK
  • Platform Toolset v143+ (configured as v145 in project)
  • vcpkg for package management

C++ Standard

The project uses C++20 (stdcpp20) for x64 builds, providing access to modern C++ features.

Runtime Dependencies

When distributing the compiled application, ensure the following are included:
  1. SFML DLLs (if not statically linked):
    • sfml-graphics-2.dll
    • sfml-window-2.dll
    • sfml-system-2.dll
  2. Visual C++ Redistributable for the target platform
  3. Assets folder containing:
    • Roboto-Regular.ttf
    • Algo.png
vcpkg automatically handles DLL copying during the build process when using manifest mode and Visual Studio integration.

Why SFML?

SFML was chosen for this project because:
  • Simplicity: Easy-to-use API for 2D graphics and window management
  • Performance: Hardware-accelerated rendering for smooth animations
  • Cross-platform: Although this project targets Windows, SFML supports Linux and macOS
  • Active Development: Well-maintained with regular updates
  • Minimal Dependencies: SFML itself has few external dependencies

SFML Documentation

Official SFML 2.6.2 documentation

SFML Tutorials

Learn how to use SFML

vcpkg Repository

Microsoft’s C++ package manager

vcpkg Documentation

vcpkg usage guide and reference

Build docs developers (and LLMs) love