| 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 | { |
no test coverage detected