summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-02-05 07:51:36 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-02-05 07:51:36 +0100
commit408ced619330e7eb0bc4ea0c08243abb4690c86b (patch)
tree89ecc1007e526fb163ad4b1a2a436a53d71f379a /src/RendererWorld.cpp
parentBlock selection implemented with mouse-look (diff)
downloadAltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar.gz
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar.bz2
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar.lz
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar.xz
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.tar.zst
AltCraft-408ced619330e7eb0bc4ea0c08243abb4690c86b.zip
Diffstat (limited to 'src/RendererWorld.cpp')
-rw-r--r--src/RendererWorld.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index 88d289f..895661f 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -250,6 +250,24 @@ void RendererWorld::Render(RenderState & renderState) {
glLineWidth(1.0);
glCheckError();
+ //Render selected block
+ Vector selectedBlock = gs->selectedBlock;
+ if (selectedBlock != Vector()) {
+ glLineWidth(2.0f);
+ {
+ glm::mat4 model;
+ model = glm::translate(model, selectedBlock.glm());
+ model = glm::translate(model,glm::vec3(0.5f,0.5f,0.5f));
+ model = glm::scale(model,glm::vec3(1.01f,1.01f,1.01f));
+ glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
+ glUniform3f(colorLoc, 0.0, 0.0, 0.0);
+ glCheckError();
+ glDrawArrays(GL_LINE_STRIP, 0, 36);
+ }
+ glLineWidth(1.0f);
+ glCheckError();
+ }
+
//Render sections
renderState.SetActiveShader(blockShader->Program);
projectionLoc = glGetUniformLocation(blockShader->Program, "projection");