video_driver.hpp

Go to the documentation of this file.
00001 /* $Id: video_driver.hpp 26544 2014-04-29 18:41:19Z frosch $ */
00002 
00003 /*
00004  * This file is part of OpenTTD.
00005  * 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.
00006  * 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.
00007  * 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/>.
00008  */
00009 
00012 #ifndef VIDEO_VIDEO_DRIVER_HPP
00013 #define VIDEO_VIDEO_DRIVER_HPP
00014 
00015 #include "../driver.h"
00016 #include "../core/geometry_type.hpp"
00017 
00019 class VideoDriver : public Driver {
00020 public:
00028   virtual void MakeDirty(int left, int top, int width, int height) = 0;
00029 
00033   virtual void MainLoop() = 0;
00034 
00041   virtual bool ChangeResolution(int w, int h) = 0;
00042 
00048   virtual bool ToggleFullscreen(bool fullscreen) = 0;
00049 
00054   virtual bool AfterBlitterChange()
00055   {
00056     return true;
00057   }
00058 
00059   virtual bool ClaimMousePointer()
00060   {
00061     return true;
00062   }
00063 
00072   virtual bool HasGUI() const
00073   {
00074     return true;
00075   }
00076 
00080   virtual void EditBoxLostFocus() {}
00081 
00085   static VideoDriver *GetInstance() {
00086     return static_cast<VideoDriver*>(*DriverFactoryBase::GetActiveDriver(Driver::DT_VIDEO));
00087   }
00088 };
00089 
00090 extern char *_ini_videodriver;
00091 extern int _num_resolutions;
00092 extern Dimension _resolutions[32];
00093 extern Dimension _cur_resolution;
00094 extern bool _rightclick_emulate;
00095 
00096 #endif /* VIDEO_VIDEO_DRIVER_HPP */