From d8b865366af9d5ed30d2ee0a437b9a3ed43c10bd Mon Sep 17 00:00:00 2001 From: Vaxry Date: Fri, 1 Nov 2024 15:52:03 +0000 Subject: renderer: Add a missing texture asset and a user check When an asset is missing, instead of a black screen, render an obnoxious, yet standard, missing texture. Additionally, warn the user assets failed to load. Shoutout to Arch for having their assets broken for months. Fix your shit. I am tired of it, and it's negatively impacting users. --- src/render/OpenGL.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/render/OpenGL.hpp') diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 115dcac7..c594a7cc 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -215,11 +215,12 @@ class CHyprOpenGLImpl { GLint m_iCurrentOutputFb = 0; - int m_iGBMFD = -1; - gbm_device* m_pGbmDevice = nullptr; - EGLContext m_pEglContext = nullptr; - EGLDisplay m_pEglDisplay = nullptr; - EGLDeviceEXT m_pEglDevice = nullptr; + int m_iGBMFD = -1; + gbm_device* m_pGbmDevice = nullptr; + EGLContext m_pEglContext = nullptr; + EGLDisplay m_pEglDisplay = nullptr; + EGLDeviceEXT m_pEglDevice = nullptr; + uint failedAssetsNo = 0; bool m_bReloadScreenShader = true; // at launch it can be set @@ -277,7 +278,7 @@ class CHyprOpenGLImpl { CShader m_sFinalScreenShader; CTimer m_tGlobalTimer; - SP m_pBackgroundTexture, m_pLockDeadTexture, m_pLockDead2Texture, m_pLockTtyTextTexture; + SP m_pMissingAssetTexture, m_pBackgroundTexture, m_pLockDeadTexture, m_pLockDead2Texture, m_pLockTtyTextTexture; void logShaderError(const GLuint&, bool program = false); GLuint createProgram(const std::string&, const std::string&, bool dynamic = false); @@ -290,6 +291,7 @@ class CHyprOpenGLImpl { SP loadAsset(const std::string& file); SP renderText(const std::string& text, CColor col, int pt, bool italic = false); void initAssets(); + void initMissingAssetTexture(); // std::optional> getModsForFormat(EGLint format); -- cgit v1.2.3