This commit is contained in:
2026-03-02 15:48:49 +03:00
parent 7cdd2068be
commit d87484393d
21 changed files with 986 additions and 7 deletions
+23
View File
@@ -1,6 +1,10 @@
#pragma once
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <memory>
#include "Array.hpp"
#include "Sorter.hpp"
#include "UI.hpp"
class App {
public:
@@ -11,7 +15,26 @@ private:
void handleEvents();
void update(float dt);
void render();
void switchSorter(std::unique_ptr<Sorter> newSorter);
void generateBeepSound();
void playBeep(float pitch);
sf::RenderWindow window_;
Array array_;
std::unique_ptr<Sorter> currentSorter_;
UI ui_;
bool isPlaying_;
float timeSinceLastStep_;
float stepDelay_;
sf::SoundBuffer beepBuffer_;
sf::Sound beepSound_;
bool isSweeping_;
int sweepIndex_;
float sweepTimer_;
float sweepDelay_;
size_t lastComparisons_;
size_t lastSwaps_;
};