added destroyGL deleting modules in renderer
This commit is contained in:
parent
04cc620797
commit
837fe1cd39
@ -49,3 +49,9 @@ void PhongMaterial::setTexture(Texture* myTexture)
|
|||||||
diffuse_texture = myTexture;
|
diffuse_texture = myTexture;
|
||||||
updateShader();
|
updateShader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PhongMaterial::setNormalMap(Texture* myNormalMap)
|
||||||
|
{
|
||||||
|
normal_map = myNormalMap;
|
||||||
|
updateShader();
|
||||||
|
}
|
||||||
|
@ -13,8 +13,8 @@ public:
|
|||||||
glm::vec3 diffuse;
|
glm::vec3 diffuse;
|
||||||
glm::vec3 specular;
|
glm::vec3 specular;
|
||||||
float shininess;
|
float shininess;
|
||||||
Texture* diffuse_texture;
|
Texture* diffuse_texture;
|
||||||
Texture* normal_map;
|
Texture* normal_map;
|
||||||
|
|
||||||
PhongMaterial() :
|
PhongMaterial() :
|
||||||
emission(0),
|
emission(0),
|
||||||
@ -40,6 +40,7 @@ public:
|
|||||||
void crappyBindAttributes();
|
void crappyBindAttributes();
|
||||||
|
|
||||||
void setTexture(Texture* myTexture);
|
void setTexture(Texture* myTexture);
|
||||||
|
void setNormalMap(Texture* myNormalMap);
|
||||||
|
|
||||||
void updateShader();
|
void updateShader();
|
||||||
};
|
};
|
||||||
|
@ -44,7 +44,9 @@ void SparrowRenderer::initGL(int width, int height, bool forceCrappy)
|
|||||||
|
|
||||||
void SparrowRenderer::destroyGL()
|
void SparrowRenderer::destroyGL()
|
||||||
{
|
{
|
||||||
|
for(ModuleNode &m : modules)
|
||||||
|
delete m.module;
|
||||||
|
modules.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SparrowRenderer::resizeGL(int width, int height)
|
void SparrowRenderer::resizeGL(int width, int height)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user