-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
41 lines (40 loc) · 1.34 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
38
39
40
41
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "ManagerManager.h"
#include "GameManager.h"
#include "MenuManager.h"
#include "Settings.h"
#include "DotZero.h"
#include <iostream>
using namespace sf;
int main() {
srand(time(0));
try{
RenderWindow window(VideoMode::getDesktopMode(), "SFML_Minesweeper", Style::Fullscreen);
Cursor cursor;
Image image;
if(image.loadFromFile("images\\cursor.png")){
cursor.loadFromPixels(image.getPixelsPtr(),image.getSize(),Vector2u(0,0));
window.setMouseCursor(cursor);
window.setMouseCursorVisible(true);
}
window.setVerticalSyncEnabled(true);
SoundManager soundManager;
ManagerManager manager(&window);
DotZero dotZero(window,manager);
Leaderboard leaderboard(window, manager);
GameManager gameManager(window, manager, soundManager,leaderboard);
MenuManager menu(window, manager);
Settings settings(window, manager,soundManager,leaderboard);
manager.setPointers(&gameManager, &settings, &leaderboard, &menu,&dotZero);
soundManager.play(SoundManager::MenuMusic);
manager.manage();
}
catch(exception& e){
std::cout << e.what () << std::endl;
return -1;
}
return 0;
}