summaryrefslogtreecommitdiffstats
path: root/src/RendererEntity.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-26 10:54:29 +0100
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2019-01-26 10:58:17 +0100
commitf8af4c44d17b94ab814f1784060388afd7a24e03 (patch)
treee0c8e06c209fe964b03caae362169facecd3c949 /src/RendererEntity.cpp
parentImplemented new Shader class (diff)
downloadAltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar.gz
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar.bz2
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar.lz
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar.xz
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.tar.zst
AltCraft-f8af4c44d17b94ab814f1784060388afd7a24e03.zip
Diffstat (limited to 'src/RendererEntity.cpp')
-rw-r--r--src/RendererEntity.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RendererEntity.cpp b/src/RendererEntity.cpp
index d465a07..a1c9566 100644
--- a/src/RendererEntity.cpp
+++ b/src/RendererEntity.cpp
@@ -6,6 +6,7 @@
#include "Entity.hpp"
#include "World.hpp"
#include "Renderer.hpp"
+#include "AssetManager.hpp"
const GLfloat vertices[] = {
-0.5f, 0.5f, 0.5f,
@@ -129,8 +130,9 @@ void RendererEntity::Render(RenderState & renderState) {
model = glm::translate(model, glm::vec3(0, entity.height / 2.0, 0));
model = glm::scale(model, glm::vec3(entity.width, entity.height, entity.width));
- glUniformMatrix4fv(modelLoc, 1, GL_FALSE, glm::value_ptr(model));
- glUniform3f(colorLoc, entity.renderColor.x, entity.renderColor.y, entity.renderColor.z);
+ Shader *entityShader = AssetManager::GetAsset<AssetShader>("/altcraft/shaders/entity")->shader.get();
+ entityShader->SetUniform("model", model);
+ entityShader->SetUniform("color", entity.renderColor);
glCheckError();
glDrawArrays(GL_LINES, 0, 24);