Debian Codegraph @

code/apis/resolution_manager.hpp

raw
1 /*
2 Copyright (C) 2016 wxLauncher Team
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19 #ifndef APIS_RESOLUTION_MANAGER_H
20 #define APIS_RESOLUTION_MANAGER_H
21
22 #include <wx/wx.h>
23 #include <wx/dynarray.h>
24
25 namespace ResolutionMan {
26 enum ApiType {
27 API_WIN32,
28 API_SDL
29 };
30
31 class Resolution : public wxClientData {
32 public:
33 Resolution(const int width, const int height, const bool isHeader);
34 virtual ~Resolution() {}
35 const int GetWidth() const { return this->width; }
36 const int GetHeight() const { return this->height; }
37 const bool IsHeader() const { return this->isHeader; }
38 const wxString &GetResString() const { return this->resString; }
39 bool IsSameResolution(const Resolution& other) const {
40 return ((this->width == other.width) &&
41 (this->height == other.height));
42 }
43 Resolution* New() const;
44
45 private:
46 int width;
47 int height;
48 bool isHeader;
49 wxString resString;
50 };
51
52 WX_DEFINE_ARRAY_PTR(Resolution *, ResolutionArray);
53
54 void EnumerateGraphicsModes(ApiType type, ResolutionArray& out_modes,
55 const long minHorizontalRes, const long minVerticalRes);
56 };
57
58 #endif