aboutsummaryrefslogtreecommitdiff
path: root/src/Theme.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-02 00:45:27 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-02 00:45:27 +0200
commit495bd6bed85c85650620dc2ae91f7f058ae2da5c (patch)
tree6029ae984bc3b76ab6d01cf7942abc650de25db2 /src/Theme.cpp
parentbe0ad41e745c3e6177d1159e25f7d23e45b02738 (diff)
Add audio devices
Diffstat (limited to 'src/Theme.cpp')
-rw-r--r--src/Theme.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/Theme.cpp b/src/Theme.cpp
index 0f44126..0c99320 100644
--- a/src/Theme.cpp
+++ b/src/Theme.cpp
@@ -3,32 +3,39 @@
#include <assert.h>
namespace gsr {
- static Theme theme;
- static bool initialized = false;
+ static Theme *theme = nullptr;
void init_theme(const gsr::GsrInfo &gsr_info) {
+ assert(!theme);
+ theme = new Theme();
+
switch(gsr_info.gpu_info.vendor) {
case gsr::GpuVendor::UNKNOWN: {
break;
}
case gsr::GpuVendor::AMD: {
- theme.tint_color = mgl::Color(221, 0, 49);
+ theme->tint_color = mgl::Color(221, 0, 49);
break;
}
case gsr::GpuVendor::INTEL: {
- theme.tint_color = mgl::Color(8, 109, 183);
+ theme->tint_color = mgl::Color(8, 109, 183);
break;
}
case gsr::GpuVendor::NVIDIA: {
- theme.tint_color = mgl::Color(118, 185, 0);
+ theme->tint_color = mgl::Color(118, 185, 0);
break;
}
}
- initialized = true;
+ }
+
+ void deinit_theme() {
+ assert(theme);
+ delete theme;
+ theme = nullptr;
}
const Theme& get_theme() {
- assert(initialized);
- return theme;
+ assert(theme);
+ return *theme;
}
} \ No newline at end of file