Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMartinSmith160

Posted 29 May 2013 - 08:38 AM

ok this is making sense now. Thanks for being patient.

 

 

 
 


#1MartinSmith160

Posted 29 May 2013 - 08:02 AM

ok this is making sense now. Thanks for being patient.

 

So just to be clear the above example packing code shows how to pack  D3DXIMAGE_INFO and the filename info. But we wont need that, we will need the binary data from the .tga file. So I will take the same approach as your example but i will pack the .tga info

 

E.G

std::ifstream is("graphic.tga", std::ios::binary);
is.seekg (0, is.end);
auto length = is.tellg();
is.seekg (0, is.beg);
std::vector<char> vFile(length);
is.read((char*)&vFile[0], vFile.size());
is.close();

// THEN THAT ADD A TEXTURE_ITEMS INTO A VECTOR

//ONCE ALL TEXTURE_ITEMS HAVE BEEN ADDED I WRITE ALL THE DATA FROM THE VECTOR TO A BINARY FILE 

 

 
 


PARTNERS