OpenTTD: src/video/video_driver.hpp Source File

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

video_driver.hpp
Go to the documentation of this file.
1 /* $Id: video_driver.hpp 27775 2017-03-11 13:05:54Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * OpenTTD 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, version 2.
6 * OpenTTD 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.
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 */
9
12 #ifndef VIDEO_VIDEO_DRIVER_HPP
13 #define VIDEO_VIDEO_DRIVER_HPP
14
15 #include "../driver.h"
16 #include "../core/geometry_type.hpp"
17
19 class VideoDriver : public Driver {
20 public:
28 virtual void MakeDirty(int left, int top, int width, int height) = 0;
29
33 virtual void MainLoop() = 0;
34
41 virtual bool ChangeResolution(int w, int h) = 0;
42
48 virtual bool ToggleFullscreen(bool fullscreen) = 0;
49
55 virtual bool AfterBlitterChange()
56 {
57 return true;
58 }
59
64 virtual void AcquireBlitterLock() { }
65
70 virtual void ReleaseBlitterLock() { }
71
72 virtual bool ClaimMousePointer()
73 {
74 return true;
75 }
76
85 virtual bool HasGUI() const
86 {
87 return true;
88 }
89
93 virtual void EditBoxLostFocus() {}
94
98 static VideoDriver *GetInstance() {
99 return static_cast<VideoDriver*>(*DriverFactoryBase::GetActiveDriver(Driver::DT_VIDEO));
100 }
101 };
102
103 extern char *_ini_videodriver;
104 extern int _num_resolutions;
105 extern Dimension _resolutions[32];
106 extern Dimension _cur_resolution;
107 extern bool _rightclick_emulate;
108
109 #endif /* VIDEO_VIDEO_DRIVER_HPP */