#include "texture_from_file.h" #ifndef IGL_NO_OPENGL #include "texture_from_png.h" #include #include #include #include #include #include #include #include IGL_INLINE bool igl::texture_from_file(const std::string filename, GLuint & id) { using namespace igl; using namespace std; // dirname, basename, extension and filename string d,b,ext,f; pathinfo(filename,d,b,ext,f); // Convert extension to lower case transform(ext.begin(), ext.end(), ext.begin(), ::tolower); if(ext == "tga") { return texture_from_tga(filename,id); }else if(ext == "png") { return texture_from_png(filename,id); }else { #ifdef __APPLE__ // Convert to a temporary png file string tmp = "/var/tmp/.texture_from_file.png"; #define PATH_TO_CONVERT "/opt/local/bin/convert" string command = STR(PATH_TO_CONVERT<<" \""<