From f8af4c44d17b94ab814f1784060388afd7a24e03 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sat, 26 Jan 2019 14:54:29 +0500 Subject: Removed previous implementation of Shader --- src/RendererEntity.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/RendererEntity.cpp') 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("/altcraft/shaders/entity")->shader.get(); + entityShader->SetUniform("model", model); + entityShader->SetUniform("color", entity.renderColor); glCheckError(); glDrawArrays(GL_LINES, 0, 24); -- cgit v1.2.3