-
Notifications
You must be signed in to change notification settings - Fork 4
/
Deader_than_Dead.cpp
74 lines (59 loc) · 1.16 KB
/
Deader_than_Dead.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
Deader-than-Dead Main
Screen Manager
Project Manager:
Shane Satterfield
Collaborators:
Christopher Gomez
Joshua Liong
*/
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include <iostream>
#include <string>
#include "src/MGame.h"
#include "src/GameScreen.h"
#include "src/StartScreen.h"
const int SCREEN_WIDTH = 800;
const int SCREEN_HEIGHT = 600;
const int SCREEN_BPP = 32;
SDL_Surface *screen = NULL;
SDL_Event event;
//Function Prototpyes
bool init();
void cleanup();
int main(int argc, char* argv[]){
bool quit = false;
if(init() == false)
return 1;
StartScreen starScream(event, SCREEN_WIDTH, SCREEN_HEIGHT);
MGame mgame(event);
while(!quit){
if(starScream.main() == true){
quit = true;
break;
}
if(mgame.main() == false){
quit = true;
break;
}
}
cleanup();
return 0;
}
bool init(){
if(SDL_Init(SDL_INIT_EVERYTHING) == -1)
return false;
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE);
if(screen == NULL)
return false;
if(TTF_Init() == -1)
return false;
SDL_WM_SetCaption("Deader than Dead", NULL);
return true;
}
void cleanup(){
TTF_Quit();
SDL_Quit();
}