mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
remove Viewport class
This commit is contained in:
parent
105561ad77
commit
9843a1fc27
17 changed files with 60 additions and 115 deletions
|
|
@ -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 *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue