// read data from PPM file to Array for OpenGL rendering
file.open("default.ppm");
std::cout<<"--READING--"<<std::endl;
file>>magic_number>>skip;
std::getline(file, comment);
file>>width>>height>>max_color;
// reading the data, row by row
for(int j=0; j<width; j++)
{
for(int i=0; i<height; i++)
{
file>>data(0,i,j); //red
file>>data(1,i,j); //green
file>>data(2,i,j); //blue
data(3,i,j) = 0; //alpha -> transparent
}
}
file.close();
std::cout<<"--DONE READING--"<<std::endl;
cmd = remove("default.ppm");