From 504f9a4ca26b408261050c816f6df5c4c7be44f1 Mon Sep 17 00:00:00 2001 From: jeunathe Date: Wed, 9 Jan 2013 15:17:54 +0000 Subject: [PATCH] Update EasyMesh.Convert() method. Now takes an optional shader --- src/easymesh/easymesh.cpp | 9 +++++++-- src/easymesh/easymesh.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index 33dce6bf..fee31b02 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -62,9 +62,14 @@ void EasyMesh::CloseBrace() m_cursors.Pop(); } -void EasyMesh::MeshConvert() +void EasyMesh::MeshConvert(Shader* ProvidedShader) { - m_gpu.shader = Shader::Create(lolfx_shiny); + if(ProvidedShader == NULL) + { + m_gpu.shader = Shader::Create(lolfx_shiny); + }else{ + m_gpu.shader = ProvidedShader; + } m_gpu.modelview = m_gpu.shader->GetUniformLocation("in_ModelView"); m_gpu.view = m_gpu.shader->GetUniformLocation("in_View"); diff --git a/src/easymesh/easymesh.h b/src/easymesh/easymesh.h index 74f91445..08c8dfe9 100644 --- a/src/easymesh/easymesh.h +++ b/src/easymesh/easymesh.h @@ -29,7 +29,7 @@ public: EasyMesh(); bool Compile(char const *command); - void MeshConvert(); + void MeshConvert(Shader* ProvidedShader = NULL); void Render(mat4 const &model, float damage = 0.f); void OpenBrace();