fixed many memory leaks

added working shadows, using basic shadow mapping
This commit is contained in:
erwin coumans
2013-06-30 23:19:14 -07:00
parent f2cc840c31
commit 6d6ef5d3dc
28 changed files with 581 additions and 226 deletions

View File

@@ -789,6 +789,8 @@ void sth_delete(struct sth_stash* stash)
tex = stash->textures;
while(tex != NULL) {
curtex = tex;
delete tex->m_texels;
tex->m_texels=0;
tex = tex->next;
stash->m_renderCallbacks->updateTexture(curtex,0,0,0);
free(curtex);

View File

@@ -180,6 +180,7 @@ void InternalOpenGL2RenderCallbacks::updateTexture(sth_texture* texture, sth_gly
glDeleteTextures(1, id);
//delete id;
delete texture->m_userData;
texture->m_userData = 0;
}

View File

@@ -7,6 +7,7 @@ class GLPrimitiveRenderer;
struct InternalOpenGL2RenderCallbacks : public RenderCallbacks
{
virtual PrimInternalData* getData()=0;
virtual ~InternalOpenGL2RenderCallbacks();