OpenTTD
dedicated_v.h
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * 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.
4  * 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.
5  * 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/>.
6  */
7 
10 #ifndef VIDEO_DEDICATED_H
11 #define VIDEO_DEDICATED_H
12 
13 #include "video_driver.hpp"
14 
17 public:
18  const char *Start(const char * const *param) override;
19 
20  void Stop() override;
21 
22  void MakeDirty(int left, int top, int width, int height) override;
23 
24  void MainLoop() override;
25 
26  bool ChangeResolution(int w, int h) override;
27 
28  bool ToggleFullscreen(bool fullscreen) override;
29  const char *GetName() const override { return "dedicated"; }
30  bool HasGUI() const override { return false; }
31 };
32 
35 public:
36 #ifdef DEDICATED
37  /* Automatically select this dedicated driver when making a dedicated
38  * server build. */
39  static const int PRIORITY = 10;
40 #else
41  static const int PRIORITY = 0;
42 #endif
43  FVideoDriver_Dedicated() : DriverFactoryBase(Driver::DT_VIDEO, PRIORITY, "dedicated", "Dedicated Video Driver") {}
44  Driver *CreateInstance() const override { return new VideoDriver_Dedicated(); }
45 };
46 
47 #endif /* VIDEO_DEDICATED_H */
Driver * CreateInstance() const override
Create an instance of this driver-class.
Definition: dedicated_v.h:44
Base of all video drivers.
void MainLoop() override
Perform the actual drawing.
The dedicated server video driver.
Definition: dedicated_v.h:16
bool ToggleFullscreen(bool fullscreen) override
Change the full screen setting.
void Stop() override
Stop this driver.
bool HasGUI() const override
Whether the driver has a graphical user interface with the end user.
Definition: dedicated_v.h:30
bool ChangeResolution(int w, int h) override
Change the resolution of the window.
Base for all driver factories.
Definition: driver.h:58
A driver for communicating with the user.
Definition: driver.h:22
The base of all video drivers.
Factory for the dedicated server video driver.
Definition: dedicated_v.h:34
A video driver.
Definition: driver.h:43
void MakeDirty(int left, int top, int width, int height) override
Mark a particular area dirty.
const char * GetName() const override
Get the name of this driver.
Definition: dedicated_v.h:29
const char * Start(const char *const *param) override
Start this driver.