Format window title with copyright prefix and backend driver
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
// Nombre de la aplicación
|
||||
constexpr const char* APP_NAME = "Shadertoy";
|
||||
|
||||
// Prefijo del título de la ventana (estilo aee_2026).
|
||||
constexpr const char* WINDOW_TITLE_PREFIX = "\xC2\xA9 2025 Shadertoy \xE2\x80\x94 JailDesigner";
|
||||
|
||||
// Tamaño de ventana por defecto
|
||||
constexpr int WINDOW_WIDTH = 800;
|
||||
constexpr int WINDOW_HEIGHT = 800;
|
||||
|
||||
19
src/main.cpp
19
src/main.cpp
@@ -147,13 +147,24 @@ static void updateWindowTitle() {
|
||||
shaderName += " by " + shader_authors_[current_shader_index_];
|
||||
}
|
||||
|
||||
std::string title = std::string(APP_NAME) + " (" + shaderName + ")";
|
||||
std::string title = WINDOW_TITLE_PREFIX;
|
||||
title += " (";
|
||||
title += shaderName;
|
||||
|
||||
if (current_fps_ > 0.0f) {
|
||||
title += " - " + std::to_string(static_cast<int>(current_fps_ + 0.5f)) + " FPS";
|
||||
if (backend_) {
|
||||
title += " - ";
|
||||
title += backend_->driverName();
|
||||
}
|
||||
|
||||
title += Options_video.vsync ? " [VSync ON]" : " [VSync OFF]";
|
||||
if (current_fps_ > 0.0f) {
|
||||
title += " - ";
|
||||
title += std::to_string(static_cast<int>(current_fps_ + 0.5f)) + " FPS";
|
||||
}
|
||||
|
||||
if (Options_video.vsync) {
|
||||
title += " - VSync";
|
||||
}
|
||||
title += ")";
|
||||
|
||||
SDL_SetWindowTitle(window_, title.c_str());
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user