added destroyGL deleting modules in renderer

This commit is contained in:
anselme 2015-11-15 12:14:42 +01:00
parent 04cc620797
commit 837fe1cd39
3 changed files with 12 additions and 3 deletions

View File

@ -49,3 +49,9 @@ void PhongMaterial::setTexture(Texture* myTexture)
diffuse_texture = myTexture;
updateShader();
}
void PhongMaterial::setNormalMap(Texture* myNormalMap)
{
normal_map = myNormalMap;
updateShader();
}

View File

@ -13,8 +13,8 @@ public:
glm::vec3 diffuse;
glm::vec3 specular;
float shininess;
Texture* diffuse_texture;
Texture* normal_map;
Texture* diffuse_texture;
Texture* normal_map;
PhongMaterial() :
emission(0),
@ -40,6 +40,7 @@ public:
void crappyBindAttributes();
void setTexture(Texture* myTexture);
void setNormalMap(Texture* myNormalMap);
void updateShader();
};

View File

@ -44,7 +44,9 @@ void SparrowRenderer::initGL(int width, int height, bool forceCrappy)
void SparrowRenderer::destroyGL()
{
for(ModuleNode &m : modules)
delete m.module;
modules.clear();
}
void SparrowRenderer::resizeGL(int width, int height)