Repository navigation
Expand file tree
/
Copy pathScreen.h
More file actions
79 lines (73 loc) · 2.27 KB
/
Copy pathScreen.h
File metadata and controls
79 lines (73 loc) · 2.27 KB
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
78
79
/*
* Copyright 2010 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_SCREEN_H
#define OPENXCOM_SCREEN_H
#include "SDL.h"
namespace OpenXcom
{
class Surface;
class Action;
/**
* A display screen, handles rendering onto the game window.
* In SDL a Screen is treated like a Surface, so this is just
* a specialized version of a Surface with functionality more
* relevant for display screens. Contains a Surface buffer
* where all the contents are kept, so any filters or conversions
* can be applied before rendering the screen.
*/
class Screen
{
private:
Surface *_surface;
SDL_Surface *_screen;
double _xScale, _yScale;
Uint32 _flags;
bool _fullscreen;
public:
/// Creates a new display screen with the specified resolution.
Screen(int width, int height, int bpp);
/// Cleans up the display screen.
~Screen();
/// Gets the internal buffer.
Surface *const getSurface() const;
/// Handles keyboard events.
void handle(Action *action);
/// Renders the screen onto the game window.
void flip();
/// Clears the screen.
void clear();
/// Sets the screen's 8bpp palette.
void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
/// Gets the screen's 8bpp palette.
SDL_Color *const getPalette() const;
/// Gets the screen's width.
int getWidth() const;
/// Gets the screen's height.
int getHeight() const;
/// Sets the screen's display resolution.
void setResolution(int width, int height);
/// Sets whether the screen is full-screen or windowed.
void setFullscreen(bool full);
/// Gets the screen's X scale;
double getXScale() const;
/// Gets the screen's Y scale;
double getYScale() const;
};
}
#endif