-
Notifications
You must be signed in to change notification settings - Fork 0
/
screen.h
78 lines (65 loc) · 1.82 KB
/
screen.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef __SCREEN_H__
#define __SCREEN_H__
#include "SDL.h"
#include <vector>
#include <list>
class VideoMode
{
private:
int width;
int height;
int bpp;
bool fullScreen;
public:
VideoMode(int w, int h, int bpp, bool fullscreen)
{
width = w;
height = h;
this->bpp = bpp;
this->fullScreen = fullscreen;
}
public:
int getWidth() const { return width; };
int getHeight() const { return height; };
int getBpp() const { return bpp; };
bool isFullScreen() const { return fullScreen; };
};
class Screen
{
private:
SDL_Surface *screen;
bool fullScreen;
SDL_Surface *mouseImage;
SDL_Surface *mouseSave;
std::list<SDL_Rect> regions;
bool mouseVisible;
SDL_Rect *regionsList;
int maxRegionsList;
int saveX, saveY;
bool niceCursor;
SDL_Cursor *cursor, *emptyCursor;
public:
Screen();
~Screen();
public:
const VideoMode getVideoMode() const;
int getWidth() const;
int getHeight() const;
void setMode(const VideoMode& mode);
std::vector<VideoMode> getFullScreenModes() const;
void centerMouse();
void setMouseImage(SDL_Surface *image);
void hideMouse();
void showMouse();
void updateMouse();
void flush();
void addRegionToUpdate(int x, int y, int w, int h);
void setPixel(int x, int y, int r, int g, int b);
SDL_Surface* getSurface() { return screen; };
void draw(int x, int y, SDL_Surface *surface);
void setCursor(bool nice);
void initCursors();
void doneCursors();
SDL_Surface* createSubimage(int x, int y, int width, int height);
};
#endif