forked from falltergeist/falltergeist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (31 loc) · 903 Bytes
/
main.cpp
File metadata and controls
36 lines (31 loc) · 903 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
#include <memory>
#include "src/Exception.h"
#include "src/Game/Game.h"
#include "src/Logger.h"
#include "src/Settings.h"
#include "src/State/Start.h"
#include "src/UI/ResourceManager.h"
using namespace Falltergeist;
int main(int argc, char* argv[])
{
std::shared_ptr<ILogger> logger = std::make_shared<Logger>();
try
{
auto game = Game::Game::getInstance(logger);
auto uiResourceManager = std::make_shared<UI::ResourceManager>();
game->setUIResourceManager(uiResourceManager);
game->init(std::unique_ptr<Settings>(new Settings()));
game->setState(new State::Start(uiResourceManager, logger));
game->run();
game->shutdown();
return 0;
}
catch(const Exception &e)
{
logger->critical() << e.what() << std::endl;
#if defined(_WIN32) || defined(WIN32)
system("PAUSE");
#endif
}
return 1;
}