diff options
| author | UjinT34 <41110182+UjinT34@users.noreply.github.com> | 2025-03-29 03:19:35 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-29 01:19:35 +0100 |
| commit | 7374a023eff964817c9e5fbe75a661540516f798 (patch) | |
| tree | e20baf1be8b1affbda443e34126da15f116b4d64 /src/debug/HyprCtl.cpp | |
| parent | a46576afc32d7fbad6c358cc72ead7f4489d8ea8 (diff) | |
renderer/opengl: Extract shaders from source (#9600)
---------
Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Diffstat (limited to 'src/debug/HyprCtl.cpp')
| -rw-r--r-- | src/debug/HyprCtl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 3f955f6c..23385be8 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -51,6 +51,7 @@ using namespace Hyprutils::OS; #include "../managers/AnimationManager.hpp" #include "../debug/HyprNotificationOverlay.hpp" #include "../render/Renderer.hpp" +#include "../render/OpenGL.hpp" static void trimTrailingComma(std::string& str) { if (!str.empty() && str.back() == ',') @@ -1643,6 +1644,13 @@ static std::string submapRequest(eHyprCtlOutputFormat format, std::string reques return format == FORMAT_JSON ? std::format("{{\"{}\"}}\n", escapeJSONStrings(submap)) : (submap + "\n"); } +static std::string reloadShaders(eHyprCtlOutputFormat format, std::string request) { + if (g_pHyprOpenGL->initShaders()) + return format == FORMAT_JSON ? "{\"ok\": true}" : "ok"; + else + return format == FORMAT_JSON ? "{\"ok\": false}" : "error"; +} + CHyprCtl::CHyprCtl() { registerCommand(SHyprCtlCommand{"workspaces", true, workspacesRequest}); registerCommand(SHyprCtlCommand{"workspacerules", true, workspaceRulesRequest}); @@ -1665,6 +1673,7 @@ CHyprCtl::CHyprCtl() { registerCommand(SHyprCtlCommand{"locked", true, getIsLocked}); registerCommand(SHyprCtlCommand{"descriptions", true, getDescriptions}); registerCommand(SHyprCtlCommand{"submap", true, submapRequest}); + registerCommand(SHyprCtlCommand{.name = "reloadshaders", .exact = true, .fn = reloadShaders}); registerCommand(SHyprCtlCommand{"monitors", false, monitorsRequest}); registerCommand(SHyprCtlCommand{"reload", false, reloadRequest}); |
