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 invcpkg.json:
Version Override
The project explicitly pins SFML to version 2.6.2 using theoverrides 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
Thevcpkg-configuration.json file specifies the package registry settings:
Understanding the Configuration
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.
Baseline Commit
The baseline
b1b19307e2d2ec1eefbdb7ea069de7d4bcd31f01 represents a specific snapshot of the vcpkg registry, ensuring all packages are resolved to compatible versions.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
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:-
SFML DLLs (if not statically linked):
sfml-graphics-2.dllsfml-window-2.dllsfml-system-2.dll
- Visual C++ Redistributable for the target platform
-
Assets folder containing:
Roboto-Regular.ttfAlgo.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
External Links
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