-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.h
53 lines (42 loc) · 1.13 KB
/
globals.h
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
#ifndef GLOBALS_H
#define GLOBALS_H
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_mixer.h>
#include <SDL/SDL_image.h>
#include <string>
#include <stdlib.h>
#include <sstream>
#include <stdio.h>
//Screen attributes
const int SCREEN_WIDTH = 1024;
const int SCREEN_HEIGHT = 768;
const int SCREEN_BPP = 32;
//The dimensions of objects
const int PADDLE_WIDTH = 16;
const int PADDLE_HEIGHT = 100;
const int BALL_WIDTH = 18;
const int BALL_HEIGHT =18;
const int SPEED = 1000;
//The surfaces
extern SDL_Surface *paddleSprite ;
extern SDL_Surface *ball ;
extern SDL_Surface *screen ;
extern SDL_Surface *button ;
extern SDL_Surface *button2 ;
extern SDL_Surface *score1 ;
extern SDL_Surface *score2;
extern SDL_Surface *winningMessage ;
//The event structure
extern SDL_Event event;
//The font in use
extern TTF_Font *font;
extern SDL_Color textColor;
//The collision sound
extern Mix_Chunk *collisionSound;
void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL );
bool init();
SDL_Surface *load_image( std::string filename );
bool load_files();
void clean_up();
#endif // GLOBALS_H