-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
47 lines (46 loc) · 932 Bytes
/
Copy pathmain.cpp
File metadata and controls
47 lines (46 loc) · 932 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
46
47
#define _GLIBCXX_USE_CXX11_ABI 0
#include <stdio.h>
#include <SDL2/SDL.h>
#include "definition.h"
#include "initial.h"
#include "Map.h"
Map m;
initial i;//initial window and music
int get_mode();
int main( int argc, char* args[] )
{
if( !i.init() )
{
printf( "Failed to initialize!\n" );
}
else
{
//Main loop flag
static bool quit = false;
m.Map_ini();
//Event handler
SDL_Event e;
//initialization
BATTLE_SCENE **DUCK=new BATTLE_SCENE* [12];
//While application is running
while( !quit )
{
//Handle events on queue
while( SDL_PollEvent( &e ) != 0 )
{
//User requests quit
if( e.type == SDL_QUIT )
{
quit = true;
}
}
m.Map_mode(e,DUCK,quit);
}
//Free resources and close SDL
i.close();
}
return 0;
}
int get_mode(){
return m.mode;
}