-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
62 lines (42 loc) · 1.74 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
53
54
55
56
57
58
#include "SDL/SDL.h"
#ifndef _PLAYER_H
#include "player.h"
#endif
#ifndef _MAP_H
#include "map.h"
#endif
#ifndef _OPS_H
#include "ops.h"
#endif
#ifndef _EVENTS_H
#include "events.h"
#endif
#ifndef _PLAYER_H
#include "player.h"
#endif
#ifndef _VEC_H
#include "SimpVec.h"
#endif
#ifndef _TREE_H
#include "tree.h"
#endif
#ifndef _TIMER_H
#include "timer.h"
#endif
#include <string>
extern "C" int main(int argc, char** argv) {
SDL_Init( SDL_INIT_EVERYTHING ); //Inicjacja SDL
ekran = SDL_SetVideoMode( 800, 600, 32, SDL_SWSURFACE); //Ustawienie sterownika okna SDL
CMap *world = new CMap("data/mapa.japierdole"); //Konstruktor œwiata
CPlayer *player = new CPlayer( "data/grog.japierdole",150,150,1); //Konstruktor gracza
CEvents *events = new CEvents; //Konstruktor pêtli
player->draw(); //rysowanie gracza
world->draw(); //rysowanie œwiata
SDL_Flip( ekran ); //"przerzucenie" ekranu - podwójny bufor
events->loop(); //pêtla
delete world; //Destruktor œwiata
delete player; //destruktor gracza
delete events; //destruktor pêtli
SDL_Quit(); //wy³¹cza SDL
return 0;
}