-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest1.cpp
More file actions
32 lines (27 loc) · 752 Bytes
/
test1.cpp
File metadata and controls
32 lines (27 loc) · 752 Bytes
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
#include <SFML/Graphics.hpp>
#include "InputManager.h"
using namespace sf;
int main()
{
RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
CircleShape shape(100.f);
InputManager monManager;
shape.setFillColor(Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event)){
// get the local mouse position (relative to a window)
if (monManager.isKeyPressed(sf::Keyboard::Left)) {
//if (monManager.isMouseCaptured()) {
window.close();
}
if (event.type == Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}