| 1094 | } |
| 1095 | |
| 1096 | void DeviceManager::SetInformativeWindowTitle(const char* applicationName, bool includeFramerate, const char* extraInfo) |
| 1097 | { |
| 1098 | std::stringstream ss; |
| 1099 | ss << applicationName; |
| 1100 | ss << " (" << nvrhi::utils::GraphicsAPIToString(GetDevice()->getGraphicsAPI()); |
| 1101 | |
| 1102 | if (m_DeviceParams.enableDebugRuntime) |
| 1103 | { |
| 1104 | if (GetGraphicsAPI() == nvrhi::GraphicsAPI::VULKAN) |
| 1105 | ss << ", VulkanValidationLayer"; |
| 1106 | else |
| 1107 | ss << ", DebugRuntime"; |
| 1108 | } |
| 1109 | |
| 1110 | if (m_DeviceParams.enableNvrhiValidationLayer) |
| 1111 | { |
| 1112 | ss << ", NvrhiValidationLayer"; |
| 1113 | } |
| 1114 | |
| 1115 | ss << ")"; |
| 1116 | |
| 1117 | double frameTime = GetAverageFrameTimeSeconds(); |
| 1118 | if (includeFramerate && frameTime > 0) |
| 1119 | { |
| 1120 | double const fps = 1.0 / frameTime; |
| 1121 | int const precision = (fps <= 20.0) ? 1 : 0; |
| 1122 | ss << " - " << std::fixed << std::setprecision(precision) << fps << " FPS "; |
| 1123 | } |
| 1124 | |
| 1125 | if (extraInfo) |
| 1126 | ss << extraInfo; |
| 1127 | |
| 1128 | SetWindowTitle(ss.str().c_str()); |
| 1129 | } |
| 1130 | |
| 1131 | const char* donut::app::DeviceManager::GetWindowTitle() |
| 1132 | { |
nothing calls this directly
no outgoing calls
no test coverage detected