#include <SDL.h>
#include <SDL_image.h>
#include <GL/gl.h>
+#include <GL/glext.h>
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "image_texture.hpp"
#include "glutil.hpp"
#include "file_system.hpp"
+#include "log.hpp"
TextureManager* texture_manager = NULL;
i != image_textures.end(); ++i) {
if(i->second == NULL)
continue;
-#ifdef DEBUG
- std::cerr << "Warning: Texture '" << i->first << "' not freed\n";
-#endif
+ log_warning << "Texture '" << i->first << "' not freed" << std::endl;
delete i->second;
}
}
void
TextureManager::release(ImageTexture* texture)
{
- image_textures[texture->filename] = NULL;
+ image_textures.erase(texture->filename);
delete texture;
}
glDeleteTextures(1, &(texture->handle));
texture->handle = 0;
- assert_gl("retrieving texture");
+ assert_gl("retrieving texture for save");
}
void