diff options
author | uis <uis9936@gmail.com> | 2018-12-19 12:45:39 +0100 |
---|---|---|
committer | uis <uis9936@gmail.com> | 2018-12-20 20:01:07 +0100 |
commit | 3770fee3778f74112d3687ad0c382f0aefa5d7a4 (patch) | |
tree | bf748a539a3c9c18e3fefcba0c2be4ab5e0c67a8 /src/RendererWorld.cpp | |
parent | #11 Single field for ip and port (diff) | |
download | AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar.gz AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar.bz2 AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar.lz AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar.xz AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.tar.zst AltCraft-3770fee3778f74112d3687ad0c382f0aefa5d7a4.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 +} |