Add a local test texture and a new TileProvider severing a single tile

This commit is contained in:
Erik Broberg
2016-06-29 15:18:25 -04:00
parent 1d856151ed
commit 5030465bb8
5 changed files with 22 additions and 10 deletions
+9 -7
View File
@@ -52,19 +52,21 @@ namespace openspace {
const Tile Tile::TileUnavailable = {nullptr, nullptr, Tile::Status::Unavailable };
SingleImagePrivoder::SingleImagePrivoder(const std::string& imagePath) {
auto texture = ghoul::io::TextureReader::ref().loadTexture(imagePath);
_tile = std::make_shared<Tile>();
_tile->texture = std::move(texture);
_tile->status = _tile->texture != nullptr ? Tile::Status::OK : Tile::Status::IOError;
_tile->preprocessData = nullptr;
_tile = Tile();
_tile.texture = std::shared_ptr<Texture>(ghoul::io::TextureReader::ref().loadTexture(imagePath).release());
_tile.status = _tile.texture != nullptr ? Tile::Status::OK : Tile::Status::IOError;
_tile.preprocessData = nullptr;
_tile.texture->uploadTexture();
_tile.texture->setFilter(ghoul::opengl::Texture::FilterMode::Linear);
}
Tile SingleImagePrivoder::getTile(const ChunkIndex& chunkIndex) {
return *_tile;
return _tile;
}
Tile::Status SingleImagePrivoder::getTileStatus(const ChunkIndex& index) {
return _tile->status;
return _tile.status;
}
TileDepthTransform SingleImagePrivoder::depthTransform() {