OpenTTD Source 20250220-master-gf89924a727
screenshot_type.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 SCREENSHOT_TYPE_H
11#define SCREENSHOT_TYPE_H
12
13#include "gfx_type.h"
14#include "provider_manager.h"
15
24using ScreenshotCallback = void(void *userdata, void *buf, uint y, uint pitch, uint n);
25
27class ScreenshotProvider : public PriorityBaseProvider<ScreenshotProvider> {
28public:
29 ScreenshotProvider(std::string_view name, std::string_view description, int priority) : PriorityBaseProvider<ScreenshotProvider>(name, description, priority)
30 {
32 }
33
34 virtual ~ScreenshotProvider()
35 {
37 }
38
39 virtual bool MakeImage(const char *name, ScreenshotCallback *callb, void *userdata, uint w, uint h, int pixelformat, const Colour *palette) = 0;
40};
41
42#endif /* SCREENSHOT_TYPE_H */
The ProviderManager manages a single Provider-type.
Base interface for a SoundLoader implementation.
Types related to the graphics and/or input devices.
Definition of the ProviderManager.
void(void *userdata, void *buf, uint y, uint pitch, uint n) ScreenshotCallback
Callback function signature for generating lines of pixel data to be written to the screenshot file.