MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SaveScreenshot

Method SaveScreenshot

TombEngine/Renderer/RendererHelper.cpp:635–652  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633 }
634
635 void Renderer::SaveScreenshot()
636 {
637 char buffer[64];
638 time_t rawtime;
639
640 time(&rawtime);
641 auto time = localtime(&rawtime);
642 strftime(buffer, sizeof(buffer), "/TEN-%Y-%m-%d_%H-%M-%S.png", time);
643
644 auto screenPath = g_GameFlow->GetGameDir() + "Screenshots";
645
646 if (!std::filesystem::is_directory(screenPath))
647 std::filesystem::create_directory(screenPath);
648
649 screenPath += buffer;
650 SaveWICTextureToFile(_context.Get(), _backBuffer.Texture.Get(), GUID_ContainerFormatPng, TEN::Utils::ToWString(screenPath).c_str(),
651 &GUID_WICPixelFormat24bppBGR, nullptr, true);
652 }
653
654 std::optional<Vector2> Renderer::ProjectDisplayItemPointToScreen(const Vector3& worldPos) const
655 {

Callers 1

HandleHotkeyActionsFunction · 0.80

Calls 6

localtimeFunction · 0.85
strftimeFunction · 0.85
ToWStringFunction · 0.85
GetGameDirMethod · 0.80
GetMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected