Format window title with copyright prefix and backend driver

This commit is contained in:
2026-05-04 11:55:34 +02:00
parent f18d6143d1
commit 8d42d5741f
4 changed files with 29 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ namespace Rendering {
void render(const ShaderUniforms& uniforms) override;
void setVSync(bool vsync) override;
void cleanup() override;
[[nodiscard]] auto driverName() const -> std::string override { return "OpenGL 3.3"; }
[[nodiscard]] auto driverName() const -> std::string override { return "OpenGL"; }
private:
auto createFeedbackFBO(int width, int height) -> bool;

View File

@@ -49,7 +49,16 @@ namespace Rendering {
SDL_SetGPUSwapchainParameters(device_, window_, SDL_GPU_SWAPCHAINCOMPOSITION_SDR, bestPresentMode());
const char* name = SDL_GetGPUDeviceDriver(device_);
driver_name_ = (name != nullptr) ? std::string("SDL3 GPU/") + name : "SDL3 GPU";
const std::string raw = (name != nullptr) ? name : "GPU";
if (raw == "vulkan") { driver_name_ = "Vulkan"; }
else if (raw == "metal") { driver_name_ = "Metal"; }
else if (raw == "d3d12") { driver_name_ = "D3D12"; }
else if (!raw.empty()) {
driver_name_ = raw;
driver_name_[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(driver_name_[0])));
} else {
driver_name_ = "GPU";
}
logInfo("GPU driver: " + driver_name_);
return true;
}