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-11-25 20:32:12 +01:00
|
|
|
/** @file allegro_v.h Base of the Allegro video driver. */
|
|
|
|
|
|
|
|
#ifndef VIDEO_ALLEGRO_H
|
|
|
|
#define VIDEO_ALLEGRO_H
|
|
|
|
|
|
|
|
#include "video_driver.hpp"
|
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** The allegro video driver. */
|
2013-11-25 15:30:22 +01:00
|
|
|
class VideoDriver_Allegro : public VideoDriver {
|
2008-11-25 20:32:12 +01:00
|
|
|
public:
|
2020-05-17 23:32:08 +02:00
|
|
|
const char *Start(const StringList ¶m) override;
|
2008-11-25 20:32:12 +01:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
void Stop() override;
|
2008-11-25 20:32:12 +01:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
void MakeDirty(int left, int top, int width, int height) override;
|
2008-11-25 20:32:12 +01:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
void MainLoop() override;
|
2008-11-25 20:32:12 +01:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
bool ChangeResolution(int w, int h) override;
|
2008-11-25 20:32:12 +01:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
bool ToggleFullscreen(bool fullscreen) override;
|
2011-10-04 23:35:40 +02:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
bool AfterBlitterChange() override;
|
2011-10-04 23:35:40 +02:00
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
bool ClaimMousePointer() override;
|
2011-11-17 22:09:08 +01:00
|
|
|
|
2021-03-09 10:22:52 +01:00
|
|
|
std::vector<int> GetListOfMonitorRefreshRates() override;
|
|
|
|
|
2019-03-03 23:25:13 +01:00
|
|
|
const char *GetName() const override { return "allegro"; }
|
2021-02-19 11:01:49 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void InputLoop() override;
|
2021-02-20 11:08:20 +01:00
|
|
|
void Paint() override;
|
2021-02-20 11:15:15 +01:00
|
|
|
void CheckPaletteAnim() override;
|
2021-02-24 14:45:10 +01:00
|
|
|
bool PollEvent() override;
|
2008-11-25 20:32:12 +01:00
|
|
|
};
|
|
|
|
|
2011-05-02 18:14:23 +02:00
|
|
|
/** Factory for the allegro video driver. */
|
2013-11-25 15:26:46 +01:00
|
|
|
class FVideoDriver_Allegro : public DriverFactoryBase {
|
2008-11-25 20:32:12 +01:00
|
|
|
public:
|
2013-11-25 15:26:46 +01:00
|
|
|
FVideoDriver_Allegro() : DriverFactoryBase(Driver::DT_VIDEO, 4, "allegro", "Allegro Video Driver") {}
|
2019-03-03 23:25:13 +01:00
|
|
|
Driver *CreateInstance() const override { return new VideoDriver_Allegro(); }
|
2008-11-25 20:32:12 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* VIDEO_ALLEGRO_H */
|