Merge branch 'blender2.7'
[blender.git] / intern / ghost / intern / GHOST_DisplayManagerSDL.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
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 Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * Contributor(s): Campbell Barton
19  *
20  * ***** END GPL LICENSE BLOCK *****
21  */
22
23 /** \file ghost/intern/GHOST_DisplayManagerSDL.h
24  *  \ingroup GHOST
25  * Declaration of GHOST_DisplayManagerSDL class.
26  */
27
28 #ifndef __GHOST_DISPLAYMANAGERSDL_H__
29 #define __GHOST_DISPLAYMANAGERSDL_H__
30
31 #include "GHOST_DisplayManager.h"
32
33 extern "C" {
34         #include "SDL.h"
35 }
36
37 #if !SDL_VERSION_ATLEAST(2, 0, 0)
38 #  error "SDL 2.0 or newer is needed to build with Ghost"
39 #endif
40
41 class GHOST_SystemSDL;
42
43 class GHOST_DisplayManagerSDL : public GHOST_DisplayManager
44 {
45 public:
46         GHOST_DisplayManagerSDL(GHOST_SystemSDL *system);
47
48         GHOST_TSuccess
49         getNumDisplays(GHOST_TUns8& numDisplays) const;
50
51         GHOST_TSuccess
52         getNumDisplaySettings(GHOST_TUns8 display,
53                               GHOST_TInt32& numSettings) const;
54
55         GHOST_TSuccess
56         getDisplaySetting(GHOST_TUns8 display,
57                           GHOST_TInt32 index,
58                           GHOST_DisplaySetting& setting) const;
59
60         GHOST_TSuccess
61         getCurrentDisplaySetting(GHOST_TUns8 display,
62                                  GHOST_DisplaySetting& setting) const;
63
64         GHOST_TSuccess
65         getCurrentDisplayModeSDL(SDL_DisplayMode &mode) const;
66
67         GHOST_TSuccess
68         setCurrentDisplaySetting(GHOST_TUns8 display,
69                                  const GHOST_DisplaySetting& setting);
70
71 private:
72         GHOST_SystemSDL *m_system;
73         SDL_DisplayMode m_mode;
74 };
75
76 #endif /* __GHOST_DISPLAYMANAGERSDL_H__ */