You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

37 lines
805 B
C++

#include <iostream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "slider.hpp"
int main()
{
int result;
sf::RenderWindow window(sf::VideoMode(800, 600), "Slider");
window.setFramerateLimit(60);
sf::Font font;
if (!font.loadFromFile("consolas.ttf")) {
std::cout << "Can't load button font" << std::endl;
}
Slider slider(window, font);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed) {
window.close();
}
result = slider.handleEvent(event);
std::cout << result << std::endl;
}
window.clear(sf::Color::Black);
slider.draw();
window.display();
}
return 0;
}