Commit ee341708 authored by Janis Born's avatar Janis Born

loadTexture2D now also loads DDS files based on file ending

parent f1e32bf8
......@@ -5,6 +5,7 @@
**********************************************************************/
#include <ACGL/OpenGL/Data/TextureLoadStore.hh>
#include <ACGL/Base/FileHelpers.hh>
using namespace ACGL;
using namespace ACGL::OpenGL;
......@@ -15,6 +16,13 @@ namespace OpenGL{
SharedTexture2D loadTexture2D( const std::string &_filename )
{
std::string fileEnding = Base::FileHelpers::getFileEnding(_filename);
if(fileEnding == "dds")
{
return loadTexture2DFromDDS(_filename);
}
else
{
SharedTexture2D texture = SharedTexture2D( new Texture2D() );
SharedTextureData data = loadTextureData( _filename );
if (!data) {
......@@ -26,6 +34,7 @@ SharedTexture2D loadTexture2D( const std::string &_filename )
texture->generateMipmaps(); // calculates all remaining mipmap levels
return texture;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment