1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-12-24 23:45:20 +01:00

Allow taking screenshots in main menu (#16749)

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: siliconsniffer <siliconsniffer@users.noreply.github.com>
This commit is contained in:
siliconsniffer
2025-12-21 12:08:16 +01:00
committed by GitHub
parent 17a33fccd7
commit f91e58abab
8 changed files with 162 additions and 63 deletions

20
src/util/screenshot.h Normal file
View File

@@ -0,0 +1,20 @@
// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
#pragma once
#include <string>
namespace video {
class IVideoDriver;
}
/**
* Take a screenshot and save it to disk
* @param driver Video driver to use for the screenshot
* @param filename_out Output parameter that receives the path to the saved screenshot
* @return true if the screenshot was saved successfully, false otherwise
*/
bool takeScreenshot(video::IVideoDriver *driver, std::string &filename_out);