2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 17:11:33 +02:00
|
|
|
/** @file sdl_v.h Base of the SDL video driver. */
|
|
|
|
|
2005-07-23 17:16:57 +02:00
|
|
|
#ifndef VIDEO_SDL_H
|
|
|
|
#define VIDEO_SDL_H
|
|
|
|
|
2007-07-05 14:23:54 +02:00
|
|
|
#include "video_driver.hpp"
|
2005-07-23 17:16:57 +02:00
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** The SDL video driver. */
|
2013-11-25 15:30:22 +01:00
|
|
|
class VideoDriver_SDL : public VideoDriver {
|
2007-07-05 14:23:54 +02:00
|
|
|
public:
|
|
|
|
/* virtual */ const char *Start(const char * const *param);
|
|
|
|
|
|
|
|
/* virtual */ void Stop();
|
|
|
|
|
|
|
|
/* virtual */ void MakeDirty(int left, int top, int width, int height);
|
|
|
|
|
|
|
|
/* virtual */ void MainLoop();
|
|
|
|
|
|
|
|
/* virtual */ bool ChangeResolution(int w, int h);
|
|
|
|
|
2008-01-01 15:20:48 +01:00
|
|
|
/* virtual */ bool ToggleFullscreen(bool fullscreen);
|
2011-10-04 23:35:40 +02:00
|
|
|
|
|
|
|
/* virtual */ bool AfterBlitterChange();
|
|
|
|
|
2017-03-11 14:05:54 +01:00
|
|
|
/* virtual */ void AcquireBlitterLock();
|
|
|
|
|
|
|
|
/* virtual */ void ReleaseBlitterLock();
|
|
|
|
|
2011-11-17 22:09:08 +01:00
|
|
|
/* virtual */ bool ClaimMousePointer();
|
|
|
|
|
2009-09-05 23:26:51 +02:00
|
|
|
/* virtual */ const char *GetName() const { return "sdl"; }
|
2013-02-14 12:06:06 +01:00
|
|
|
private:
|
|
|
|
int PollEvent();
|
|
|
|
bool CreateMainSurface(uint w, uint h);
|
2013-06-04 08:36:59 +02:00
|
|
|
void SetupKeyboard();
|
2007-07-05 14:23:54 +02:00
|
|
|
};
|
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** Factory for the SDL video driver. */
|
2013-11-25 15:26:46 +01:00
|
|
|
class FVideoDriver_SDL : public DriverFactoryBase {
|
2007-07-05 14:23:54 +02:00
|
|
|
public:
|
2013-11-25 15:26:46 +01:00
|
|
|
FVideoDriver_SDL() : DriverFactoryBase(Driver::DT_VIDEO, 5, "sdl", "SDL Video Driver") {}
|
|
|
|
/* virtual */ Driver *CreateInstance() const { return new VideoDriver_SDL(); }
|
2007-07-05 14:23:54 +02:00
|
|
|
};
|
2005-07-23 17:16:57 +02:00
|
|
|
|
2007-02-12 22:55:10 +01:00
|
|
|
#endif /* VIDEO_SDL_H */
|