OpenTTD
video_driver.hpp
Go to the documentation of this file.
1 /* $Id: video_driver.hpp 26538 2014-04-28 21:06:51Z rubidium $ */
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 
54  virtual bool AfterBlitterChange()
55  {
56  return true;
57  }
58 
59  virtual bool ClaimMousePointer()
60  {
61  return true;
62  }
63 
72  virtual bool HasGUI() const
73  {
74  return true;
75  }
76 
80  virtual void EditBoxLostFocus() {}
81 
87  }
88 };
89 
90 extern char *_ini_videodriver;
91 extern int _num_resolutions;
92 extern Dimension _resolutions[32];
94 extern bool _rightclick_emulate;
95 
96 #endif /* VIDEO_VIDEO_DRIVER_HPP */