remove Viewport class

This commit is contained in:
MihailRis
2025-04-02 17:35:17 +03:00
parent 105561ad77
commit 9843a1fc27
17 changed files with 60 additions and 115 deletions
+3 -5
View File
@@ -64,8 +64,6 @@ void GuidesRenderer::renderDebugLines(
) {
DrawContext ctx = pctx.sub(&batch);
const auto& viewport = ctx.getViewport();
uint displayWidth = viewport.getWidth();
uint displayHeight = viewport.getHeight();
ctx.setDepthTest(true);
@@ -91,15 +89,15 @@ void GuidesRenderer::renderDebugLines(
}
float length = 40.f;
glm::vec3 tsl(displayWidth / 2, displayHeight / 2, 0.f);
glm::vec3 tsl(viewport.x / 2, viewport.y / 2, 0.f);
glm::mat4 model(glm::translate(glm::mat4(1.f), tsl));
linesShader.uniformMatrix(
"u_projview",
glm::ortho(
0.f,
static_cast<float>(displayWidth),
static_cast<float>(viewport.x),
0.f,
static_cast<float>(displayHeight),
static_cast<float>(viewport.y),
-length,
length
) * model *