-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
45 lines (33 loc) · 697 Bytes
/
Copy pathmain.cpp
File metadata and controls
45 lines (33 loc) · 697 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
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "Core/include/GameSceneManager.hpp"
#include "Scenes/include/MainMenu.hpp"
void windowStateManager(sf::RenderWindow& window)
{
sf::Event state;
while(window.pollEvent(state))
{
switch(state.type)
{
case sf::Event::Closed:
window.close();
break;
default:
break;
}
}
}
int main()
{
sf::RenderWindow window(sf::VideoMode(1280, 720), "</> WorkName project", sf::Style::Close);
GameSceneManager gameScene(window, new MainMenu);
float deltaTime = 0.0f;
sf::Clock clock;
while(window.isOpen())
{
deltaTime = clock.restart().asSeconds();
windowStateManager(window);
window.clear();
gameScene.update(deltaTime);
window.display();
}
return 0;
}