make sure we retain shared state when destructing the map object

refs #261
This commit is contained in:
Konstantin Käfer
2014-05-30 17:00:47 +02:00
parent 3e7f801de1
commit 78fda8bb62
18 changed files with 174 additions and 110 deletions

View File

@@ -14,13 +14,13 @@
using namespace llmr;
Raster::Raster(Texturepool &texturepool)
Raster::Raster(const std::shared_ptr<Texturepool> &texturepool)
: texturepool(texturepool)
{}
Raster::~Raster() {
if (textured) {
texturepool.removeTextureID(texture);
texturepool->removeTextureID(texture);
}
}
@@ -49,7 +49,7 @@ void Raster::bind(bool linear) {
}
if (img && !textured) {
texture = texturepool.getTextureID();
texture = texturepool->getTextureID();
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);