7 #include "imstkTexture.h" 12 m_type(type), m_path(path)
30 FileType textureType = FileType::Unknown;
32 std::string extString =
m_path.substr(
m_path.find_last_of(
".") + 1);
34 if (extString.empty() ||
m_path.find(
".") == std::string::npos)
39 if (extString ==
"bmp" || extString ==
"BMP")
41 textureType = FileType::Bmp;
43 else if (extString ==
"png" || extString ==
"PNG")
45 textureType = FileType::Png;
47 else if (extString ==
"jpg" || extString ==
"JPG" 48 || extString ==
"jpeg" || extString ==
"JPEG")
50 textureType = FileType::Jpg;
52 else if (extString ==
"dds" || extString ==
"DDS")
54 textureType = FileType::Dds;
Texture(std::string path="", Type type=Type::Diffuse)
Constructor.
Type
Texture type - determines filtering.
std::string m_path
Texture file path.
Type getType() const
Get type.
FileType getFileType()
Get file extension.