]> git.leopard-lacewing.eu Git - cgue_weave.git/commitdiff
badHack Textures!!!
authorPeter Schaefer <schaeferpm@gmail.com>
Mon, 4 May 2015 20:29:32 +0000 (22:29 +0200)
committerPeter Schaefer <schaeferpm@gmail.com>
Mon, 4 May 2015 20:29:32 +0000 (22:29 +0200)
Weave/Game.cpp
Weave/Graphix/Graphix.cpp
Weave/Graphix/Texture.cpp
Weave/Graphix/Texture.h

index c5afb7fb967287adccab4b19b2ddc1f68cf86e0b..488b143a86f42c5d2d2a566e20d44d9141ecbb7b 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "Graphix\Shader.h"
 #include "Graphix\Graphix.h"
+#include "Graphix\Texture.h"
 #include "Fps.h"
 #include "Events.h"
 
@@ -74,6 +75,9 @@ Game::Game() : playing(true)
 Game::~Game()
 { 
        delete current_world;
+
+       //RALLLY BAD HACK!!!! No Texture will be freed!!!!
+       Texture::clean();
 }
 
 
index d4a776b53fcfc8df54b742e8ed9a5f5e88e29d37..be1e6eecde4a5cc83a176e78d5b9714eb192f45f 100644 (file)
@@ -96,6 +96,7 @@ void Graphix::clear()
 
 void Graphix::cleanup()
 {
+       delete shader_BBox;
        SDL_SetWindowGrab(sdl_window, SDL_FALSE);
 
        SDL_GL_DeleteContext(sdl_glcontext);
index e1408613a77dfd1712fb49563951a62c65ca026d..7454dc1b2e7d8f85a5ea5cba7f8b73407d08aa8a 100644 (file)
@@ -96,6 +96,7 @@ Texture::Texture(const string& _path, const vec4& _material) : path(_path), hand
 
 Texture::~Texture()
 {
+       texture_map.erase(path);
        glDeleteTextures(1, &handle);
 }
 
@@ -110,4 +111,10 @@ Texture::operator string() const
        return path;
 }
 
+void Texture::clean()
+{
+       //RALLLY BAD HACK!!!! No Texture will be freed!!!!
+       texture_map.clear();
+}
+
 str2int_map Texture::texture_map;
\ No newline at end of file
index 7137d6c6533cbee49d6777b815c35e8c0d789241..313920a69dd474c62dd256457640a4866dfeba98 100644 (file)
@@ -24,6 +24,9 @@ public:
 
        vec4 material;
 
+       //RALLLY BAD HACK!!!! No Texture will be freed!!!!
+       static void clean();
+
 private:
        unsigned int handle;
        string path;