-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
34 lines (26 loc) · 828 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "HexGrid.hpp"
int main(){
sf::VideoMode desktop = sf::VideoMode::getDesktopMode();
sf::RenderWindow app(sf::VideoMode(desktop.width, desktop.height, desktop.bitsPerPixel),"Tyrion: TCoW");
sf::View player1;
sf::View deck;
sf::View hexgrid;
sf::View player2;
player1.setViewport(sf::FloatRect(0.f, 0.f, 0.25f, 1.f));
deck.setViewport(sf::FloatRect(0.25f,0.75f, 0.5f, 0.25f));
hexgrid.setViewport(sf::FloatRect(0.25f,0.f,0.5f,0.75f));
player2.setViewport(sf::FloatRect(0.75f,0.f,0.25f,1.f));
HexGrid hex(8,8,30.f,sf::Color(250,0,0));
while(app.isOpen()){
sf::Event evt;
while(app.pollEvent(evt)){
if(evt.type == sf::Event::Closed)
app.close();
}
app.clear(sf::Color::Black);
hex.draw(app);
hex.handleMouse(app,evt);
app.display();
}
return 0;
}