47 const std::string& path,
int column,
int row,
int level,
55 m_top_right(topRight),
56 m_bottom_right(bottomRight),
57 m_bottom_left(bottomLeft),
58 m_transformed_top_left(topLeft),
59 m_transformed_top_right(topRight),
60 m_transformed_bottom_right(bottomRight),
61 m_transformed_bottom_left(bottomLeft),
63 m_textureLoaded(false),
66 m_tileId(1000000 * level + 1000 * column + row),
77 return QFile::exists(
m_path.c_str());
98 float max_dim = std::max(width, height);
100 std::pow(2.0
f, std::ceil(std::log(max_dim)/std::log(2.0
f))));
117 catch(std::exception& e)
119 std::cout <<
"An exception occurred loading image: " << e.what() << std::endl;
148 glGenTextures(1, &ids[0]);
156 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
157 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
164 catch (
const std::exception& e)
166 std::cout <<
"An exception occured loading texture: " << e.what() << std::endl;
185 glDeleteTextures(1, &ids[0]);