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/>.
8 /** @file sdl_v.h Base of the SDL video driver. */
13 #include "video_driver.hpp"
15 /** The SDL video driver. */
16 class VideoDriver_SDL
: public VideoDriver
{
18 std::optional
<std::string_view
> Start(const StringList
¶m
) override
;
22 void MakeDirty(int left
, int top
, int width
, int height
) override
;
24 void MainLoop() override
;
26 bool ChangeResolution(int w
, int h
) override
;
28 bool ToggleFullscreen(bool fullscreen
) override
;
30 bool AfterBlitterChange() override
;
32 bool ClaimMousePointer() override
;
34 std::string_view
GetName() const override
{ return "sdl"; }
37 void InputLoop() override
;
38 void Paint() override
;
39 void CheckPaletteAnim() override
;
40 bool PollEvent() override
;
43 bool CreateMainSurface(uint w
, uint h
);
47 /** Factory for the SDL video driver. */
48 class FVideoDriver_SDL
: public DriverFactoryBase
{
50 FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO
, 5, "sdl", "SDL Video Driver") {}
51 Driver
*CreateInstance() const override
{ return new VideoDriver_SDL(); }
54 #endif /* VIDEO_SDL_H */