stuff
This commit is contained in:
parent
dc5654ba9a
commit
3ffed086b1
7 changed files with 54 additions and 9 deletions
|
|
@ -187,7 +187,7 @@ vector<Texture> Model::loadMaterialTextures(aiMaterial *mat, aiTextureType type,
|
|||
string defaultPath = "DefaultTexture.jpg";
|
||||
|
||||
Texture texture;
|
||||
texture.id = TextureFromFile(defaultPath.c_str(), "assets/");
|
||||
texture.id = TextureFromFile(defaultPath.c_str(), "assets");
|
||||
texture.type = typeName;
|
||||
texture.path = defaultPath;
|
||||
textures.push_back(texture);
|
||||
|
|
@ -201,8 +201,7 @@ vector<Texture> Model::loadMaterialTextures(aiMaterial *mat, aiTextureType type,
|
|||
|
||||
unsigned inline int TextureFromFile(const char *path, const string &directory, bool gamma)
|
||||
{
|
||||
string filename = string(path);
|
||||
filename = directory + '/' + filename;
|
||||
string filename = directory + '/' + path;
|
||||
|
||||
unsigned int textureID;
|
||||
glGenTextures(1, &textureID);
|
||||
|
|
@ -232,7 +231,8 @@ unsigned inline int TextureFromFile(const char *path, const string &directory, b
|
|||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Texture failed to load at path: " << path << std::endl;
|
||||
std::cout << "Texture failed to load at path: " << filename << std::endl;
|
||||
std::cerr << "STB Reason: " << stbi_failure_reason() << "\n";
|
||||
stbi_image_free(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue