Files
panopainter/engine/image.cpp
Omar Mohamed Ali Mudhir d5fed78bf5 add Slice9 type
2017-01-16 14:42:22 +00:00

15 lines
347 B
C++

#include "pch.h"
#include "image.hpp"
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>
bool Image::load(std::string filename)
{
stbi_set_flip_vertically_on_load(true);
uint8_t* buffer = stbi_load(filename.c_str(), &width, &height, nullptr, 4);
comp = 4;
m_data = std::unique_ptr<uint8_t[]>(buffer);
return true;
}