add file picking for osx and ios and implement equirectangular import

This commit is contained in:
2017-12-09 09:07:42 +00:00
parent d18b1103bb
commit f4cd7fdc62
20 changed files with 218 additions and 8 deletions

View File

@@ -23,6 +23,15 @@ bool Image::load(std::string filename)
return true;
}
bool Image::load_file(std::string filename)
{
stbi_set_flip_vertically_on_load(false);
uint8_t* buffer = stbi_load(filename.c_str(), &width, &height, nullptr, 4);
comp = 4;
m_data = std::unique_ptr<uint8_t[]>(buffer);
return true;
}
void Image::flip()
{
auto flipped = std::make_unique<uint8_t[]>(width*height*4);