mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-10-16 06:55:58 +00:00
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.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
#include "OpenGL.hpp"
|
||||
|
||||
CFramebuffer::CFramebuffer() {
|
||||
m_cTex = makeShared<CTexture>();
|
||||
;
|
||||
}
|
||||
|
||||
bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
|
||||
@@ -12,6 +12,9 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
|
||||
uint32_t glFormat = FormatUtils::drmFormatToGL(drmFormat);
|
||||
uint32_t glType = FormatUtils::glFormatToType(glFormat);
|
||||
|
||||
if (!m_cTex)
|
||||
m_cTex = makeShared<CTexture>();
|
||||
|
||||
if (!m_iFbAllocated) {
|
||||
firstAlloc = true;
|
||||
glGenFramebuffers(1, &m_iFb);
|
||||
@@ -54,7 +57,8 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) {
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, g_pHyprOpenGL->m_iCurrentOutputFb);
|
||||
if (g_pHyprOpenGL)
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, g_pHyprOpenGL->m_iCurrentOutputFb);
|
||||
|
||||
m_vSize = Vector2D(w, h);
|
||||
|
||||
@@ -85,14 +89,17 @@ void CFramebuffer::bind() {
|
||||
#else
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_iFb);
|
||||
#endif
|
||||
glViewport(0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecPixelSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecPixelSize.y);
|
||||
if (g_pHyprOpenGL)
|
||||
glViewport(0, 0, g_pHyprOpenGL->m_RenderData.pMonitor->vecPixelSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->vecPixelSize.y);
|
||||
else
|
||||
glViewport(0, 0, m_vSize.x, m_vSize.y);
|
||||
}
|
||||
|
||||
void CFramebuffer::release() {
|
||||
if (m_iFbAllocated)
|
||||
glDeleteFramebuffers(1, &m_iFb);
|
||||
|
||||
m_cTex->destroyTexture();
|
||||
m_cTex.reset();
|
||||
m_iFbAllocated = false;
|
||||
m_vSize = Vector2D();
|
||||
}
|
||||
|
Reference in New Issue
Block a user