2020-07-21 11:34:39 +00:00
|
|
|
#ifndef TRIANGLES_STATE_HPP
|
|
|
|
#define TRIANGLES_STATE_HPP
|
|
|
|
|
|
|
|
#include <bitset>
|
2020-07-21 11:44:10 +00:00
|
|
|
#include <vector>
|
2020-07-21 11:34:39 +00:00
|
|
|
|
|
|
|
#include <SFML/System.hpp>
|
2020-07-21 11:44:10 +00:00
|
|
|
#include <SFML/Graphics.hpp>
|
2020-07-21 11:34:39 +00:00
|
|
|
|
|
|
|
namespace Tri {
|
|
|
|
struct State {
|
|
|
|
State();
|
2020-07-22 06:11:10 +00:00
|
|
|
~State();
|
2020-07-21 11:34:39 +00:00
|
|
|
/*
|
|
|
|
* 0 - display help
|
|
|
|
*/
|
|
|
|
std::bitset<64> flags;
|
|
|
|
const unsigned int width;
|
|
|
|
const unsigned int height;
|
|
|
|
const sf::Time dt;
|
|
|
|
|
2020-07-22 06:11:10 +00:00
|
|
|
sf::RenderWindow window;
|
2020-07-21 11:44:10 +00:00
|
|
|
std::vector<sf::ConvexShape> tris;
|
|
|
|
sf::ConvexShape currentTri;
|
|
|
|
enum CurrentState { NONE, FIRST, SECOND, THIRD } currentTri_state;
|
|
|
|
|
2020-07-22 06:11:10 +00:00
|
|
|
sf::Event event;
|
|
|
|
|
|
|
|
void handle_events();
|
2020-07-21 11:34:39 +00:00
|
|
|
void update();
|
|
|
|
void draw();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|