-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
37 lines (33 loc) · 1.03 KB
/
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
/*
* Copyright (c) 2021 ishakd00
* All rights reserved.
* Cpplint made me put this supid copyright header, I swear :'(
*/
#include <vector>
#include <SFML/Graphics.hpp>
#include "World.h"
#include "Player.h"
int main() {
static const std::vector<sf::VideoMode> &videoModes =
sf::VideoMode::getFullscreenModes();
sf::RenderWindow *window = new sf::RenderWindow(
videoModes[0],
"raycasting_fps",
sf::Style::Fullscreen);
window->setVerticalSyncEnabled(true);
window->setFramerateLimit(60);
sf::VertexArray lines;
World world("worlds/testWorld.json");
Player player(window, &world, {3, 3}, 0);
while (window->isOpen()) {
sf::Event event;
while (window->pollEvent(event)) {
player.handleEvent(event);
if (event.type == sf::Event::Closed)
window->close();
}
window->clear(sf::Color::Black);
window->draw(player.playerView.getFrame());
window->display();
}
}