C++ Read Png into opengl
Posted: 2015-06-09T14:55:57-07:00
Very simple thing.
I am getting an odd result.
Here is the result in OGL:
looks like the format remains PNG? what am i missing?
I am getting an odd result.
Code: Select all
Magick::Image im;
im.magick("PNG");
im.read(std::string(TEXTURE_DIRECTORY).append(desc.filename)); //"image.png"
w = im.columns();
h = im.rows();
unsigned char* data = new unsigned char[w*h*3];
im.write(0,0,w,h,"RGB", CharPixel, data);
tex.widths.push_back(w);
tex.heights.push_back(h);
tex.texData.push_back(data);
looks like the format remains PNG? what am i missing?