diff --git a/src/config/config.cpp b/src/config/config.cpp index af0e704..9c7d214 100644 --- a/src/config/config.cpp +++ b/src/config/config.cpp @@ -10,7 +10,7 @@ bool isEnabled() { static auto* const* PENABLED = (Hyprlang::INT* const*) getConfig(CONFIG_ENABLED); - return **PENABLED && g_pHyprRenderer->m_pMostHzMonitor && g_pDynamicCursors; // make sure the compositor is properly initialized + return **PENABLED && g_pHyprRenderer->m_mostHzMonitor && g_pDynamicCursors; // make sure the compositor is properly initialized } Hyprlang::CConfigValue toHyprlang(std::variant value) { diff --git a/src/cursor.cpp b/src/cursor.cpp index 4892fc3..537f498 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -33,8 +33,8 @@ void tickRaw(SP self, void* data) { if (isEnabled()) g_pDynamicCursors->onTick(g_pPointerManager.get()); - const int TIMEOUT = g_pHyprRenderer->m_pMostHzMonitor && g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate > 0 - ? 1000.0 / g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate + const int TIMEOUT = g_pHyprRenderer->m_mostHzMonitor && g_pHyprRenderer->m_mostHzMonitor->m_refreshRate > 0 + ? 1000.0 / g_pHyprRenderer->m_mostHzMonitor->m_refreshRate : 16; self->updateTimeout(std::chrono::milliseconds(TIMEOUT)); } @@ -136,7 +136,7 @@ void CDynamicCursors::renderSoftware(CPointerManager* pointers, SP pMo data.stretchAngle = resultShown.stretch.angle; data.stretchMagnitude = resultShown.stretch.magnitude; - g_pHyprRenderer->m_sRenderPass.add(makeShared(data)); + g_pHyprRenderer->m_renderPass.add(makeShared(data)); if (pointers->m_currentCursorImage.surface) pointers->m_currentCursorImage.surface->resource()->frame(now); @@ -245,7 +245,7 @@ SP CDynamicCursors::renderHardware(CPointerManager* pointer CRegion damage = {0, 0, INT16_MAX, INT16_MAX}; g_pHyprRenderer->makeEGLCurrent(); - g_pHyprOpenGL->m_RenderData.pMonitor = state->monitor; + g_pHyprOpenGL->m_renderData.pMonitor = state->monitor; auto RBO = g_pHyprRenderer->getOrCreateRenderbuffer(buf, state->monitor->m_cursorSwapchain->currentOptions().format); @@ -272,7 +272,7 @@ SP CDynamicCursors::renderHardware(CPointerManager* pointer g_pHyprOpenGL->end(); glFlush(); - g_pHyprOpenGL->m_RenderData.pMonitor.reset(); + g_pHyprOpenGL->m_renderData.pMonitor.reset(); g_pHyprRenderer->onRenderbufferDestroy(RBO.get()); diff --git a/src/mode/ModeStretch.cpp b/src/mode/ModeStretch.cpp index b86fe6b..576875d 100644 --- a/src/mode/ModeStretch.cpp +++ b/src/mode/ModeStretch.cpp @@ -15,7 +15,7 @@ SModeResult CModeStretch::update(Vector2D pos) { auto limit = g_pShapeRuleHandler->getIntOr(CONFIG_STRETCH_LIMIT, **PLIMIT); // create samples array - int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0 + int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0 samples.resize(max, pos); // capture current sample diff --git a/src/mode/ModeTilt.cpp b/src/mode/ModeTilt.cpp index 715d98b..c3e0b00 100644 --- a/src/mode/ModeTilt.cpp +++ b/src/mode/ModeTilt.cpp @@ -15,7 +15,7 @@ SModeResult CModeTilt::update(Vector2D pos) { auto limit = g_pShapeRuleHandler->getIntOr(CONFIG_TILT_LIMIT, **PLIMIT); // create samples array - int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0 + int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate / 10)); // 100ms worth of history, avoiding divide by 0 samples.resize(max, pos); // capture current sample diff --git a/src/other/Shake.cpp b/src/other/Shake.cpp index a20c314..3530779 100644 --- a/src/other/Shake.cpp +++ b/src/other/Shake.cpp @@ -44,7 +44,7 @@ double CShake::update(Vector2D pos) { static auto* const* PIPC = (Hyprlang::INT* const*) getConfig(CONFIG_SHAKE_IPC); - int max = std::max(1, (int)(g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate)); // 1s worth of history, avoiding divide by 0 + int max = std::max(1, (int)(g_pHyprRenderer->m_mostHzMonitor->m_refreshRate)); // 1s worth of history, avoiding divide by 0 samples.resize(max); samples_distance.resize(max); @@ -73,7 +73,7 @@ double CShake::update(Vector2D pos) { // if diagonal sufficiently large and over threshold double amount = (trail / diagonal) - **PTHRESHOLD; if (diagonal > 100 && amount > 0) { - float delta = 1.F / g_pHyprRenderer->m_pMostHzMonitor->m_refreshRate; + float delta = 1.F / g_pHyprRenderer->m_mostHzMonitor->m_refreshRate; float next = this->zoom->goal(); diff --git a/src/render/CursorPassElement.cpp b/src/render/CursorPassElement.cpp index 6e5f79b..10b25f7 100644 --- a/src/render/CursorPassElement.cpp +++ b/src/render/CursorPassElement.cpp @@ -33,7 +33,7 @@ bool CCursorPassElement::needsPrecomputeBlur() { } std::optional CCursorPassElement::boundingBox() { - return data.box.copy().scale(1.F / g_pHyprOpenGL->m_RenderData.pMonitor->m_scale).round(); + return data.box.copy().scale(1.F / g_pHyprOpenGL->m_renderData.pMonitor->m_scale).round(); } CRegion CCursorPassElement::opaqueRegion() { diff --git a/src/render/renderer.cpp b/src/render/renderer.cpp index f8a4437..36f5d34 100644 --- a/src/render/renderer.cpp +++ b/src/render/renderer.cpp @@ -61,17 +61,17 @@ void renderCursorTextureInternalWithDamage(SP tex, CBox* pBox, const C return; CBox newBox = *pBox; - g_pHyprOpenGL->m_RenderData.renderModif.applyToBox(newBox); + g_pHyprOpenGL->m_renderData.renderModif.applyToBox(newBox); // get transform - const auto TRANSFORM = wlTransformToHyprutils(invertTransform(!g_pHyprOpenGL->m_bEndFrame ? WL_OUTPUT_TRANSFORM_NORMAL : g_pHyprOpenGL->m_RenderData.pMonitor->m_transform)); - Mat3x3 matrix = projectCursorBox(newBox, TRANSFORM, newBox.rot, g_pHyprOpenGL->m_RenderData.monitorProjection, hotspot, stretchAngle, stretch); + const auto TRANSFORM = wlTransformToHyprutils(invertTransform(!g_pHyprOpenGL->m_endFrame ? WL_OUTPUT_TRANSFORM_NORMAL : g_pHyprOpenGL->m_renderData.pMonitor->m_transform)); + Mat3x3 matrix = projectCursorBox(newBox, TRANSFORM, newBox.rot, g_pHyprOpenGL->m_renderData.monitorProjection, hotspot, stretchAngle, stretch); - Mat3x3 glMatrix = g_pHyprOpenGL->m_RenderData.projection.copy().multiply(matrix); + Mat3x3 glMatrix = g_pHyprOpenGL->m_renderData.projection.copy().multiply(matrix); CShader* shader = nullptr; - switch (tex->m_iType) { + switch (tex->m_type) { case TEXTURE_RGBA: shader = &g_pHyprOpenGL->m_shaders->m_shRGBA; break; case TEXTURE_RGBX: shader = &g_pHyprOpenGL->m_shaders->m_shRGBX; break; case TEXTURE_EXTERNAL: shader = &g_pHyprOpenGL->m_shaders->m_shEXT; break; @@ -79,14 +79,14 @@ void renderCursorTextureInternalWithDamage(SP tex, CBox* pBox, const C } glActiveTexture(GL_TEXTURE0); - glBindTexture(tex->m_iTarget, tex->m_iTexID); + glBindTexture(tex->m_target, tex->m_texID); - if (g_pHyprOpenGL->m_RenderData.useNearestNeighbor || nearest) { - glTexParameteri(tex->m_iTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(tex->m_iTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + if (g_pHyprOpenGL->m_renderData.useNearestNeighbor || nearest) { + glTexParameteri(tex->m_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(tex->m_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); } else { - glTexParameteri(tex->m_iTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(tex->m_iTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(tex->m_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(tex->m_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } glUseProgram(shader->program); @@ -103,7 +103,7 @@ void renderCursorTextureInternalWithDamage(SP tex, CBox* pBox, const C glUniform1i(shader->discardAlpha, 0); CBox transformedBox = newBox; - transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_RenderData.pMonitor->m_transform)), g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.x, g_pHyprOpenGL->m_RenderData.pMonitor->m_transformedSize.y); + transformedBox.transform(wlTransformToHyprutils(invertTransform(g_pHyprOpenGL->m_renderData.pMonitor->m_transform)), g_pHyprOpenGL->m_renderData.pMonitor->m_transformedSize.x, g_pHyprOpenGL->m_renderData.pMonitor->m_transformedSize.y); const auto TOPLEFT = Vector2D(transformedBox.x, transformedBox.y); const auto FULLSIZE = Vector2D(transformedBox.width, transformedBox.height); @@ -120,8 +120,8 @@ void renderCursorTextureInternalWithDamage(SP tex, CBox* pBox, const C glEnableVertexAttribArray(shader->posAttrib); glEnableVertexAttribArray(shader->texAttrib); - if (g_pHyprOpenGL->m_RenderData.clipBox.width != 0 && g_pHyprOpenGL->m_RenderData.clipBox.height != 0) { - CRegion damageClip{g_pHyprOpenGL->m_RenderData.clipBox.x, g_pHyprOpenGL->m_RenderData.clipBox.y, g_pHyprOpenGL->m_RenderData.clipBox.width, g_pHyprOpenGL->m_RenderData.clipBox.height}; + if (g_pHyprOpenGL->m_renderData.clipBox.width != 0 && g_pHyprOpenGL->m_renderData.clipBox.height != 0) { + CRegion damageClip{g_pHyprOpenGL->m_renderData.clipBox.x, g_pHyprOpenGL->m_renderData.clipBox.y, g_pHyprOpenGL->m_renderData.clipBox.width, g_pHyprOpenGL->m_renderData.clipBox.height}; damageClip.intersect(damage); if (!damageClip.empty()) { @@ -140,5 +140,5 @@ void renderCursorTextureInternalWithDamage(SP tex, CBox* pBox, const C glDisableVertexAttribArray(shader->posAttrib); glDisableVertexAttribArray(shader->texAttrib); - glBindTexture(tex->m_iTarget, 0); + glBindTexture(tex->m_target, 0); }