Implement Vulkan surface snapshot (#4314)

This commit is contained in:
Adrian Cojocaru
2026-06-06 02:06:40 +03:00
committed by GitHub
parent 8a393c5b2c
commit 9fa80b37d2
9 changed files with 147 additions and 8 deletions

View File

@@ -977,7 +977,7 @@ void GLFWView::makeSnapshot(bool withOverlay) {
oss << "Made snapshot './snapshot.png' with size w:" << image.size.width << "px h:" << image.size.height
<< "px";
mbgl::Log::Info(mbgl::Event::General, oss.str());
std::ofstream file("./snapshot.png");
std::ofstream file("./snapshot.png", std::ios::out | std::ios::binary);
file << mbgl::encodePNG(image);
} else {
mbgl::Log::Error(mbgl::Event::General, "Failed to make a snapshot!");