Jump to content

  • Log In with Google      Sign In   
  • Create Account

Jean-Claude

Member Since 26 Feb 2013
Offline Last Active Feb 28 2013 01:25 PM

Posts I've Made

In Topic: Problem loading compressed DDS without pre-generated mipmaps

27 February 2013 - 04:48 PM

Okay I solved it. 

 

In case the texture had no pre-generated mipmaps, the data was only read partly because the bufferSize was devided by 1.5, which is needed for the case with mipmaps.

The solution was therefore to replace this code

 

 

 

//    determine dataBuffer size
    bufferSize = mipMapCount > 1 ? linearSize * 2 : linearSize;
    dataBuffer = new unsigned char [bufferSize*2];


    //    read data and close file
    if (file.read((char*)dataBuffer, bufferSize/1.5))
        cout<<"Loading texture "<<path<<" successful"<<endl;
 

by this code

 

 

 

//    determine dataBuffer size
    bufferSize = mipMapCount > 1 ? linearSize * 2 : linearSize * 1.5;
    dataBuffer = new unsigned char [bufferSize*2];


    //    read data and close file
    if (file.read((char*)dataBuffer, bufferSize/1.5))
        cout<<"Loading texture "<<path<<" successful"<<endl;
 

Thanks for your help.


In Topic: Problem loading compressed DDS without pre-generated mipmaps

27 February 2013 - 09:21 AM

Thanks for your answer. 

 

Well this kind of works. Somehow only a few of my chars get drawn then, others are just invisible/(black if no transparency) so the texture is not loaded correctly there. 


PARTNERS