-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.cpp
40 lines (35 loc) · 1.02 KB
/
README.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
35
36
37
38
39
40
#include "README.h"
#define RM_W 800
#define RM_H RM_W
void showReadMe()
{
sf::Texture texture;
if (!texture.loadFromFile("data/backup.png")) {
std::cerr << "Couldn’t load readme..." << std::endl;
return;
}
sf::RenderWindow window(sf::VideoMode(RM_W, RM_H), "ReadMe");
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
switch (event.type) {
case sf::Event::Closed:
window.close();
break;
case sf::Event::KeyPressed:
window.close();
break;
case sf::Event::MouseButtonPressed:
window.close();
break;
default: break;
}
}
sf::RectangleShape rsh(sf::Vector2f(RM_W, RM_H));
rsh.setPosition(0,0);
rsh.setTexture(&texture, true);
window.clear(sf::Color::White);
window.draw(rsh);
window.display();
}
}