diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2018-12-20 20:21:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 20:21:40 +0100 |
commit | d8201e470891376d74a2b9e28743e8ba2f57174e (patch) | |
tree | bf748a539a3c9c18e3fefcba0c2be4ab5e0c67a8 /src/RendererWorld.cpp | |
parent | Merge pull request #28 from uis246/iss11 (diff) | |
parent | Fixes #29 (diff) | |
download | AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar.gz AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar.bz2 AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar.lz AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar.xz AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.tar.zst AltCraft-d8201e470891376d74a2b9e28743e8ba2f57174e.zip |
Diffstat (limited to 'src/RendererWorld.cpp')
-rw-r--r-- | src/RendererWorld.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index bb8c8f4..e1dd52c 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -291,13 +291,13 @@ void RendererWorld::Render(RenderState & renderState) { glCheckError(); modelLoc = glGetUniformLocation(entityShader->Program, "model"); colorLoc = glGetUniformLocation(entityShader->Program, "color"); + + renderState.SetActiveVao(RendererEntity::GetVao()); for (auto& it : entities) { it.modelLoc = modelLoc; it.colorLoc = colorLoc; it.Render(renderState); } - glLineWidth(1.0); - glCheckError(); //Render selected block Vector selectedBlock = gs->selectedBlock; @@ -311,16 +311,14 @@ void RendererWorld::Render(RenderState & renderState) { glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model)); glUniform3f(colorLoc, 0.0, 0.0, 0.0); glCheckError(); - glDrawArrays(GL_LINE_STRIP, 0, 36); + glDrawArrays(GL_LINES, 0, 24); } - glLineWidth(1.0f); - glCheckError(); } //Render raycast hit - bool renderHit = false; + const bool renderHit = false; if (renderHit) { - VectorF hit = gs->raycastHit; + VectorF hit = gs->raycastHit; glLineWidth(2.0f); { glm::mat4 model; @@ -334,10 +332,11 @@ void RendererWorld::Render(RenderState & renderState) { glCheckError(); glDrawArrays(GL_LINE_STRIP, 0, 36); } - glLineWidth(1.0f); - glCheckError(); } + glLineWidth(1.0); + glCheckError(); + //Render sky renderState.TimeOfDay = gs->TimeOfDay; renderState.SetActiveShader(skyShader->Program); @@ -464,4 +463,4 @@ void RendererWorld::Update(double timeToUpdate) { GameState* RendererWorld::GameStatePtr() { return gs; -}
\ No newline at end of file +} |