-
Notifications
You must be signed in to change notification settings - Fork 6
/
GameDisplay.h
62 lines (36 loc) · 1.99 KB
/
GameDisplay.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
54
55
56
57
58
59
60
61
#ifndef GAMEDISPLAY_H
#define GAMEDISPLAY_H
#include "Compatibility.h"
#include "GUIUtility.h"
#include <list>
#include <string>
extern const SDL_Color default_color_key_c;
const SDL_Color def_text_c = {255, 255, 255, 0};
const SDL_Rect def_rect_c = {0,0,0,0};
SDL_Surface * loadBMP(std::string file);
// Load a bmp into an image,
// Returns 0 on failure.
SDL_Surface * loadBMPAlpha(std::string file, SDL_Color color_key = default_color_key_c);
// with alpha support
void display_image (const SDL_Surface *src, SDL_Surface *dest, GUI::DispPoint pos, bool update, SDL_Rect rect = def_rect_c);
void display_image (const SDL_Surface *src, SDL_Surface *dest, int x, int y, bool update, SDL_Rect rect = def_rect_c);
void ShowBMP(std::string file, SDL_Surface *screen, int x, int y, bool update);
// adds a bmp to the screen at x,y). will update that portion of screen iff (update == 1).
void ShowBMP(std::string file, SDL_Surface *screen, SDL_Rect rect, bool update);
//overriden with display rect.
void updateScreen(SDL_Surface *screen);
// updates the entire screen, meaning that anything changed since the last update will now be displayed.
SDL_Surface* createDisplay(SDL_Surface *screen, int width, int height, int bpp,
SDL_Color colors[], const int numColors, const Uint32 flags = SDL_SWSURFACE);
// create a Display with the following properties.
void displayToScreen (const SDL_Surface *src, int x, int y, bool update, SDL_Rect rect = def_rect_c);
// Displays an image right onto the screen.
void displayTextToScreen (const std::string &a, int x, int y, int size, bool update);
// Displays text onto the screen.
SDL_Surface* createText2 (const std::string &a, int size, SDL_Color textColor = def_text_c);
// create text using sdl font.
SDL_Surface* createText (const std::string &a);
SDL_Surface* create_SDL_Surface(int w, int h);
Uint32 getpixel(const SDL_Surface *surface, int x, int y);
void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
#endif /* GAMEDISPLAY_H */