Merge branch 'main' into main

This commit is contained in:
Jasson 2024-07-17 19:56:24 -04:00 committed by GitHub
commit 386c49fb84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 96 additions and 77 deletions

View file

@ -113,7 +113,7 @@ pkg_check_modules(deps REQUIRED IMPORTED_TARGET
wayland-server wayland-client wayland-cursor wayland-protocols wayland-server wayland-client wayland-cursor wayland-protocols
cairo pango pangocairo pixman-1 cairo pango pangocairo pixman-1
libdrm libinput hwdata libseat libdisplay-info libliftoff libudev gbm libdrm libinput hwdata libseat libdisplay-info libliftoff libudev gbm
hyprlang>=0.3.2 hyprcursor>=0.1.7 hyprutils>=0.1.5 hyprlang>=0.3.2 hyprcursor>=0.1.7 hyprutils>=0.2.0
) )
find_package(hyprwayland-scanner 0.3.10 REQUIRED) find_package(hyprwayland-scanner 0.3.10 REQUIRED)

View file

@ -87,11 +87,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720545076, "lastModified": 1721071737,
"narHash": "sha256-Pxacc2uoxI00koXp5+CyNqHOTQlqNlK0rlRHDBHX4+g=", "narHash": "sha256-qmC9jGfbE4+EIBbbSAkrfR/p49wShjpv4/KztgE/P54=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "6174a2a25f4e216c0f1d0c4278adc23c476b1d09", "rev": "eb1ceff2b87f6820789249f63faa8e9dcb54d05f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -125,11 +125,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1720542800, "lastModified": 1720957393,
"narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", "narHash": "sha256-oedh2RwpjEa+TNxhg5Je9Ch6d3W1NKi7DbRO1ziHemA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "feb2849fdeb70028c70d73b848214b00d324a497", "rev": "693bc46d169f5af9c992095736e82c3488bf7dbb",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -90,9 +90,13 @@
stdenv = pkgsFor.${system}.gcc13Stdenv; stdenv = pkgsFor.${system}.gcc13Stdenv;
} { } {
name = "hyprland-shell"; name = "hyprland-shell";
nativeBuildInputs = with pkgsFor.${system}; [expat libxml2]; nativeBuildInputs = with pkgsFor.${system}; [
expat
libxml2
];
hardeningDisable = ["fortify"]; hardeningDisable = ["fortify"];
inputsFrom = [pkgsFor.${system}.hyprland]; inputsFrom = [pkgsFor.${system}.hyprland];
packages = [pkgsFor.${system}.clang-tools];
}; };
}); });

View file

@ -25,7 +25,6 @@ in {
inputs.hyprlang.overlays.default inputs.hyprlang.overlays.default
inputs.hyprutils.overlays.default inputs.hyprutils.overlays.default
inputs.hyprwayland-scanner.overlays.default inputs.hyprwayland-scanner.overlays.default
self.overlays.xwayland
# Hyprland packages themselves # Hyprland packages themselves
(final: prev: let (final: prev: let
@ -63,14 +62,4 @@ in {
hyprland-extras = lib.composeManyExtensions [ hyprland-extras = lib.composeManyExtensions [
inputs.xdph.overlays.xdg-desktop-portal-hyprland inputs.xdph.overlays.xdg-desktop-portal-hyprland
]; ];
# Patches XWayland's pkgconfig file to not include Cflags or includedir
# The above two variables trip up CMake and the build fails
xwayland = final: prev: {
xwayland = prev.xwayland.overrideAttrs (old: {
postInstall = ''
sed -i '/includedir/d' $out/lib/pkgconfig/xwayland.pc
'';
});
};
} }

View file

@ -9,8 +9,10 @@
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <hyprlang.hpp> #include <hyprlang.hpp>
#include <hyprutils/string/VarList.hpp> #include <hyprutils/string/VarList.hpp>
#include <string.h> #include <string.h>
#include <string> #include <string>
#include <sys/stat.h> #include <sys/stat.h>
@ -367,6 +369,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("misc:close_special_on_empty", Hyprlang::INT{1}); m_pConfig->addConfigValue("misc:close_special_on_empty", Hyprlang::INT{1});
m_pConfig->addConfigValue("misc:background_color", Hyprlang::INT{0xff111111}); m_pConfig->addConfigValue("misc:background_color", Hyprlang::INT{0xff111111});
m_pConfig->addConfigValue("misc:new_window_takes_over_fullscreen", Hyprlang::INT{0}); m_pConfig->addConfigValue("misc:new_window_takes_over_fullscreen", Hyprlang::INT{0});
m_pConfig->addConfigValue("misc:exit_window_retains_fullscreen", Hyprlang::INT{0});
m_pConfig->addConfigValue("misc:initial_workspace_tracking", Hyprlang::INT{1}); m_pConfig->addConfigValue("misc:initial_workspace_tracking", Hyprlang::INT{1});
m_pConfig->addConfigValue("misc:middle_click_paste", Hyprlang::INT{1}); m_pConfig->addConfigValue("misc:middle_click_paste", Hyprlang::INT{1});
@ -645,6 +648,7 @@ CConfigManager::CConfigManager() {
g_pHyprError->queueCreate(ERR.value(), CColor{1.0, 0.1, 0.1, 1.0}); g_pHyprError->queueCreate(ERR.value(), CColor{1.0, 0.1, 0.1, 1.0});
} }
/** /**
* @brief Retrieves the configuration directory path. * @brief Retrieves the configuration directory path.
* @return The absolute path to the configuration directory. * @return The absolute path to the configuration directory.
@ -653,15 +657,24 @@ CConfigManager::CConfigManager() {
std::string CConfigManager::getConfigDir() { std::string CConfigManager::getConfigDir() {
static const char* xdgConfigHome = getenv("XDG_CONFIG_HOME"); static const char* xdgConfigHome = getenv("XDG_CONFIG_HOME");
if (xdgConfigHome && std::filesystem::path(xdgConfigHome).is_absolute())
return xdgConfigHome;
static const char* home = getenv("HOME"); if (!std::filesystem::is_directory(parentPath)) {
Debug::log(WARN, "Creating config home directory");
try {
std::filesystem::create_directories(parentPath);
} catch (std::exception e) { throw e; }
}
if (!home) Debug::log(WARN, "No config file found; attempting to generate.");
throw std::runtime_error("Neither HOME nor XDG_CONFIG_HOME is set in the environment. Cannot determine config directory."); std::ofstream ofs;
ofs.open(configPath, std::ios::trunc);
ofs << AUTOCONFIG;
ofs.close();
return home + std::string("/.config"); if (!std::filesystem::exists(configPath))
return "Config could not be generated.";
return configPath;
} }
/** /**
@ -672,7 +685,23 @@ std::string CConfigManager::getMainConfigPath() {
if (!g_pCompositor->explicitConfigPath.empty()) if (!g_pCompositor->explicitConfigPath.empty())
return g_pCompositor->explicitConfigPath; return g_pCompositor->explicitConfigPath;
return getConfigDir() + "/hypr/" + (ISDEBUG ? "hyprlandd.conf" : "hyprland.conf"); static const auto paths = Hyprutils::Path::findConfig(ISDEBUG ? "hyprlandd" : "hyprland");
if (paths.first.has_value()) {
return paths.first.value();
} else if (paths.second.has_value()) {
auto configPath = Hyprutils::Path::fullConfigPath(paths.second.value(), ISDEBUG ? "hyprlandd" : "hyprland");
return generateConfig(configPath).value();
} else
throw std::runtime_error("Neither HOME nor XDG_CONFIG_HOME are set in the environment. Could not find config in XDG_CONFIG_DIRS or /etc/xdg.");
}
std::optional<std::string> CConfigManager::verifyConfigExists() {
std::string mainConfigPath = getMainConfigPath();
if (!std::filesystem::exists(mainConfigPath))
return "broken config dir?";
return {};
} }
/** /**
@ -778,32 +807,6 @@ void CConfigManager::setDefaultAnimationVars() {
CREATEANIMCFG("specialWorkspace", "workspaces"); CREATEANIMCFG("specialWorkspace", "workspaces");
} }
std::optional<std::string> CConfigManager::verifyConfigExists() {
std::string mainConfigPath = getMainConfigPath();
if (g_pCompositor->explicitConfigPath.empty() && !std::filesystem::exists(mainConfigPath)) {
std::string configPath = std::filesystem::path(mainConfigPath).parent_path();
if (!std::filesystem::is_directory(configPath)) {
Debug::log(WARN, "Creating config home directory");
try {
std::filesystem::create_directories(configPath);
} catch (...) { return "Broken config file! (Could not create config directory)"; }
}
Debug::log(WARN, "No config file found; attempting to generate.");
std::ofstream ofs;
ofs.open(mainConfigPath, std::ios::trunc);
ofs << AUTOCONFIG;
ofs.close();
}
if (!std::filesystem::exists(mainConfigPath))
return "broken config dir?";
return {};
}
std::optional<std::string> CConfigManager::resetHLConfig() { std::optional<std::string> CConfigManager::resetHLConfig() {
m_dMonitorRules.clear(); m_dMonitorRules.clear();
m_dWindowRules.clear(); m_dWindowRules.clear();

View file

@ -130,7 +130,6 @@ class CConfigManager {
void* const* getConfigValuePtr(const std::string&); void* const* getConfigValuePtr(const std::string&);
Hyprlang::CConfigValue* getHyprlangConfigValuePtr(const std::string& name, const std::string& specialCat = ""); Hyprlang::CConfigValue* getHyprlangConfigValuePtr(const std::string& name, const std::string& specialCat = "");
void onPluginLoadUnload(const std::string& name, bool load); void onPluginLoadUnload(const std::string& name, bool load);
static std::string getConfigDir();
static std::string getMainConfigPath(); static std::string getMainConfigPath();
const std::string getConfigString(); const std::string getConfigString();
@ -254,15 +253,18 @@ class CConfigManager {
std::vector<std::pair<std::string, std::string>> m_vFailedPluginConfigValues; // For plugin values of unloaded plugins std::vector<std::pair<std::string, std::string>> m_vFailedPluginConfigValues; // For plugin values of unloaded plugins
std::string m_szConfigErrors = ""; std::string m_szConfigErrors = "";
// Internal methods
void setAnimForChildren(SAnimationPropertyConfig* const); // internal methods
void updateBlurredLS(const std::string&, const bool); void setAnimForChildren(SAnimationPropertyConfig* const);
void setDefaultAnimationVars(); void updateBlurredLS(const std::string&, const bool);
std::optional<std::string> resetHLConfig(); void setDefaultAnimationVars();
std::optional<std::string> verifyConfigExists(); std::optional<std::string> resetHLConfig();
void postConfigReload(const Hyprlang::CParseResult& result); static std::optional<std::string> generateConfig(std::string configPath);
void reload(); static std::optional<std::string> verifyConfigExists();
SWorkspaceRule mergeWorkspaceRules(const SWorkspaceRule&, const SWorkspaceRule&); void postConfigReload(const Hyprlang::CParseResult& result);
void reload();
SWorkspaceRule mergeWorkspaceRules(const SWorkspaceRule&, const SWorkspaceRule&);
}; };
inline std::unique_ptr<CConfigManager> g_pConfigManager; inline std::unique_ptr<CConfigManager> g_pConfigManager;

View file

@ -1343,6 +1343,7 @@ void CWindow::onUpdateMeta() {
if (m_szTitle != NEWTITLE) { if (m_szTitle != NEWTITLE) {
m_szTitle = NEWTITLE; m_szTitle = NEWTITLE;
g_pEventManager->postEvent(SHyprIPCEvent{"windowtitle", std::format("{:x}", (uintptr_t)this)}); g_pEventManager->postEvent(SHyprIPCEvent{"windowtitle", std::format("{:x}", (uintptr_t)this)});
g_pEventManager->postEvent(SHyprIPCEvent{"windowtitlev2", std::format("{:x},{}", (uintptr_t)this, m_szTitle)});
EMIT_HOOK_EVENT("windowTitle", m_pSelf.lock()); EMIT_HOOK_EVENT("windowTitle", m_pSelf.lock());
if (m_pSelf == g_pCompositor->m_pLastWindow) { // if it's the active, let's post an event to update others if (m_pSelf == g_pCompositor->m_pLastWindow) { // if it's the active, let's post an event to update others

View file

@ -465,9 +465,11 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->m_bNoInitialFocus = true; PWINDOW->m_bNoInitialFocus = true;
else if (*PNEWTAKESOVERFS == 2) else if (*PNEWTAKESOVERFS == 2)
g_pCompositor->setWindowFullscreen(g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID), false, FULLSCREEN_INVALID); g_pCompositor->setWindowFullscreen(g_pCompositor->getFullscreenWindowOnWorkspace(PWINDOW->m_pWorkspace->m_iID), false, FULLSCREEN_INVALID);
else if (PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) else if (PWINDOW->m_pWorkspace->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
requestsMaximize = true; requestsMaximize = true;
else if (*PNEWTAKESOVERFS == 1)
overridingNoMaximize = true;
} else
requestsFullscreen = true; requestsFullscreen = true;
} }
@ -578,6 +580,11 @@ void Events::listener_unmapWindow(void* owner, void* data) {
Debug::log(LOG, "{:c} unmapped", PWINDOW); Debug::log(LOG, "{:c} unmapped", PWINDOW);
static auto PEXITRETAINSFS = CConfigValue<Hyprlang::INT>("misc:exit_window_retains_fullscreen");
const auto CURRENTWINDOWFSSTATE = PWINDOW->m_bIsFullscreen;
const auto CURRENTWINDOWFSMODE = PWINDOW->m_pWorkspace->m_efFullscreenMode;
if (!PWINDOW->m_pWLSurface->exists() || !PWINDOW->m_bIsMapped) { if (!PWINDOW->m_pWLSurface->exists() || !PWINDOW->m_bIsMapped) {
Debug::log(WARN, "{} unmapped without being mapped??", PWINDOW); Debug::log(WARN, "{} unmapped without being mapped??", PWINDOW);
PWINDOW->m_bFadingOut = false; PWINDOW->m_bFadingOut = false;
@ -636,8 +643,11 @@ void Events::listener_unmapWindow(void* owner, void* data) {
Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE); Debug::log(LOG, "On closed window, new focused candidate is {}", PWINDOWCANDIDATE);
if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow.lock() && PWINDOWCANDIDATE) if (PWINDOWCANDIDATE != g_pCompositor->m_pLastWindow.lock() && PWINDOWCANDIDATE) {
g_pCompositor->focusWindow(PWINDOWCANDIDATE); g_pCompositor->focusWindow(PWINDOWCANDIDATE);
if (*PEXITRETAINSFS && CURRENTWINDOWFSSTATE)
g_pCompositor->setWindowFullscreen(PWINDOWCANDIDATE, true, CURRENTWINDOWFSMODE);
}
if (!PWINDOWCANDIDATE && g_pCompositor->getWindowsOnWorkspace(PWINDOW->workspaceID()) == 0) if (!PWINDOWCANDIDATE && g_pCompositor->getWindowsOnWorkspace(PWINDOW->workspaceID()) == 0)
g_pInputManager->refocus(); g_pInputManager->refocus();

View file

@ -140,6 +140,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
return; return;
PWINDOW->unsetWindowData(PRIORITY_LAYOUT); PWINDOW->unsetWindowData(PRIORITY_LAYOUT);
PWINDOW->updateWindowData();
static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("dwindle:no_gaps_when_only"); static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("dwindle:no_gaps_when_only");
static auto PGAPSINDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:gaps_in"); static auto PGAPSINDATA = CConfigValue<Hyprlang::CUSTOMTYPE>("general:gaps_in");
@ -497,6 +498,7 @@ void CHyprDwindleLayout::onWindowRemovedTiling(PHLWINDOW pWindow) {
} }
pWindow->unsetWindowData(PRIORITY_LAYOUT); pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
if (pWindow->m_bIsFullscreen) if (pWindow->m_bIsFullscreen)
g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL); g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
@ -831,6 +833,7 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscre
pWindow->m_vRealSize = pWindow->m_vLastFloatingSize; pWindow->m_vRealSize = pWindow->m_vLastFloatingSize;
pWindow->unsetWindowData(PRIORITY_LAYOUT); pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
} }
} else { } else {
// if it now got fullscreen, make it fullscreen // if it now got fullscreen, make it fullscreen

View file

@ -543,6 +543,7 @@ void IHyprLayout::changeWindowFloatingMode(PHLWINDOW pWindow) {
g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)); g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID));
pWindow->unsetWindowData(PRIORITY_LAYOUT); pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
if (pWindow == m_pLastTiledWindow) if (pWindow == m_pLastTiledWindow)
m_pLastTiledWindow.reset(); m_pLastTiledWindow.reset();

View file

@ -265,6 +265,7 @@ void CHyprMasterLayout::onWindowRemovedTiling(PHLWINDOW pWindow) {
static auto SMALLSPLIT = CConfigValue<Hyprlang::INT>("master:allow_small_split"); static auto SMALLSPLIT = CConfigValue<Hyprlang::INT>("master:allow_small_split");
pWindow->unsetWindowData(PRIORITY_LAYOUT); pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL); g_pCompositor->setWindowFullscreen(pWindow, false, FULLSCREEN_FULL);
@ -647,6 +648,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
return; return;
PWINDOW->unsetWindowData(PRIORITY_LAYOUT); PWINDOW->unsetWindowData(PRIORITY_LAYOUT);
PWINDOW->updateWindowData();
static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("master:no_gaps_when_only"); static auto PNOGAPSWHENONLY = CConfigValue<Hyprlang::INT>("master:no_gaps_when_only");
static auto PANIMATE = CConfigValue<Hyprlang::INT>("misc:animate_manual_resizes"); static auto PANIMATE = CConfigValue<Hyprlang::INT>("misc:animate_manual_resizes");
@ -923,6 +925,7 @@ void CHyprMasterLayout::fullscreenRequestForWindow(PHLWINDOW pWindow, eFullscree
pWindow->m_vRealSize = pWindow->m_vLastFloatingSize; pWindow->m_vRealSize = pWindow->m_vLastFloatingSize;
pWindow->unsetWindowData(PRIORITY_LAYOUT); pWindow->unsetWindowData(PRIORITY_LAYOUT);
pWindow->updateWindowData();
} }
} else { } else {
// if it now got fullscreen, make it fullscreen // if it now got fullscreen, make it fullscreen

View file

@ -11,9 +11,9 @@ executable('Hyprland', src,
dependency('wayland-client'), dependency('wayland-client'),
wlroots.get_variable('wlroots'), wlroots.get_variable('wlroots'),
dependency('cairo'), dependency('cairo'),
dependency('hyprcursor'), dependency('hyprcursor', version: '>=0.1.7'),
dependency('hyprlang', version: '>= 0.3.2'), dependency('hyprlang', version: '>= 0.3.2'),
dependency('hyprutils', version: '>= 0.1.1'), dependency('hyprutils', version: '>= 0.2.0'),
dependency('libdrm'), dependency('libdrm'),
dependency('egl'), dependency('egl'),
dependency('xkbcommon'), dependency('xkbcommon'),

View file

@ -434,7 +434,7 @@ bool CHyprOpenGLImpl::passRequiresIntrospection(CMonitor* pMonitor) {
if (!w->m_bIsFloating && *POPTIM && !w->onSpecialWorkspace()) if (!w->m_bIsFloating && *POPTIM && !w->onSpecialWorkspace())
continue; continue;
if (w->m_sWindowData.noBlur.valueOrDefault() || !w->m_sWindowData.xray.hasValue() || w->m_sWindowData.xray.valueOrDefault()) if (w->m_sWindowData.noBlur.valueOrDefault() || w->m_sWindowData.xray.valueOrDefault())
continue; continue;
if (w->opaque()) if (w->opaque())
@ -842,7 +842,7 @@ void CHyprOpenGLImpl::applyScreenShader(const std::string& path) {
if (path == "" || path == STRVAL_EMPTY) if (path == "" || path == STRVAL_EMPTY)
return; return;
std::ifstream infile(absolutePath(path, g_pConfigManager->getConfigDir())); std::ifstream infile(absolutePath(path, g_pConfigManager->getMainConfigPath()));
if (!infile.good()) { if (!infile.good()) {
g_pConfigManager->addParseError("Screen shader parser: Screen shader path not found"); g_pConfigManager->addParseError("Screen shader parser: Screen shader path not found");
@ -858,9 +858,11 @@ void CHyprOpenGLImpl::applyScreenShader(const std::string& path) {
return; return;
} }
m_sFinalScreenShader.proj = glGetUniformLocation(m_sFinalScreenShader.program, "proj"); m_sFinalScreenShader.proj = glGetUniformLocation(m_sFinalScreenShader.program, "proj");
m_sFinalScreenShader.tex = glGetUniformLocation(m_sFinalScreenShader.program, "tex"); m_sFinalScreenShader.tex = glGetUniformLocation(m_sFinalScreenShader.program, "tex");
m_sFinalScreenShader.time = glGetUniformLocation(m_sFinalScreenShader.program, "time"); m_sFinalScreenShader.time = glGetUniformLocation(m_sFinalScreenShader.program, "time");
if (m_sFinalScreenShader.time != -1)
m_sFinalScreenShader.initialTime = m_tGlobalTimer.getSeconds();
m_sFinalScreenShader.wl_output = glGetUniformLocation(m_sFinalScreenShader.program, "wl_output"); m_sFinalScreenShader.wl_output = glGetUniformLocation(m_sFinalScreenShader.program, "wl_output");
m_sFinalScreenShader.fullSize = glGetUniformLocation(m_sFinalScreenShader.program, "screen_size"); m_sFinalScreenShader.fullSize = glGetUniformLocation(m_sFinalScreenShader.program, "screen_size");
if (m_sFinalScreenShader.fullSize == -1) if (m_sFinalScreenShader.fullSize == -1)
@ -1155,7 +1157,7 @@ void CHyprOpenGLImpl::renderTextureInternalWithDamage(SP<CTexture> tex, CBox* pB
glUniform1i(shader->tex, 0); glUniform1i(shader->tex, 0);
if ((usingFinalShader && *PDT == 0) || CRASHING) { if ((usingFinalShader && *PDT == 0) || CRASHING) {
glUniform1f(shader->time, m_tGlobalTimer.getSeconds()); glUniform1f(shader->time, m_tGlobalTimer.getSeconds() - shader->initialTime);
} else if (usingFinalShader && shader->time != -1) { } else if (usingFinalShader && shader->time != -1) {
// Don't let time be unitialised // Don't let time be unitialised
glUniform1f(shader->time, 0.f); glUniform1f(shader->time, 0.f);

View file

@ -42,9 +42,10 @@ class CShader {
GLint gradientLength = -1; GLint gradientLength = -1;
GLint angle = -1; GLint angle = -1;
GLint time = -1; float initialTime = 0;
GLint distort = -1; GLint time = -1;
GLint wl_output = -1; GLint distort = -1;
GLint wl_output = -1;
// Blur prepare // Blur prepare
GLint contrast = -1; GLint contrast = -1;
@ -64,4 +65,4 @@ class CShader {
private: private:
std::unordered_map<std::string, GLint> m_muUniforms; std::unordered_map<std::string, GLint> m_muUniforms;
}; };