-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
52 lines (43 loc) · 1.02 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
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <string>
#include <ctime>
#include "SDL.h"
#include "SDL_image.h"
#include "AN/ANDeclarations.hpp"
#include "AN/Helpers.hpp"
#include "AN/GameLoop.hpp"
#include "AN/GameLogic.hpp"
#include "Game/GameDeclarations.hpp"
#include "Game/Game.hpp"
#include "Game/Extras/ExtraDeclarations.hpp"
#include "Game/Extras/CardSpriteManager.hpp"
int main(int argc, char *args[])
{
// State
an::GameLoop *loop = new an::GameLoop(960, 640, "SDL 2.0 Hearts Game");
game::CardSpriteManager *csm = new game::CardSpriteManager();
game::Game *game = new game::Game(csm);
int ret = 1;
// Setup
if (loop->setup(game))
{
ret = 0;
// Main loop
while (loop->is_running())
{
loop->handleEvents();
loop->update();
loop->render();
loop->frameCap();
}
}
// Cleanup
loop->cleanup();
delete loop;
csm->cleanup();
delete csm;
game->cleanup();
delete game;
// Done
return ret;
}