-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
41 lines (29 loc) · 790 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
35
36
37
38
39
40
// Author: Bob Rubbens - Knights of the Compiler
// Creation date: 4-01-2014
// Contact: http://plusminos.nl - @broervanlisa - gmail (bobrubbens)
// Includes I didn't make myself
#include <SFML/Graphics.hpp>
// Includes I did make myself
#include "AnimatedSprite.hpp"
int main() {
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
nb::AnimatedSprite as("AnimatedSpriteInfo.nbas");
as.setPosition(200, 200);
as.play("spinningswitching");
while (window.isOpen()) {
// Handle events
sf::Event e;
while (window.pollEvent(e)) {
if (e.type == sf::Event::Closed) {
window.close();
}
}
as.logic(1000/60);
window.clear();
window.draw(as);
window.display();
sf::sleep(sf::milliseconds(1000/60));
}
return 0;
}