Check if file to load texture from exists, display error if not
This commit is contained in:
parent
ac0a4989bd
commit
b399fed33b
3 changed files with 19 additions and 1 deletions
|
|
@ -104,6 +104,9 @@ namespace vks
|
|||
|
||||
free(textureData);
|
||||
#else
|
||||
if (!vks::tools::fileExists(filename)) {
|
||||
vks::tools::exitFatal("Could not load texture from " + filename, "File not found");
|
||||
}
|
||||
gli::texture2d tex2D(gli::load(filename.c_str()));
|
||||
#endif
|
||||
assert(!tex2D.empty());
|
||||
|
|
@ -582,9 +585,11 @@ namespace vks
|
|||
|
||||
free(textureData);
|
||||
#else
|
||||
if (!vks::tools::fileExists(filename)) {
|
||||
vks::tools::exitFatal("Could not load texture from " + filename, "File not found");
|
||||
}
|
||||
gli::texture2d_array tex2DArray(gli::load(filename));
|
||||
#endif
|
||||
|
||||
assert(!tex2DArray.empty());
|
||||
|
||||
this->device = device;
|
||||
|
|
@ -791,6 +796,9 @@ namespace vks
|
|||
|
||||
free(textureData);
|
||||
#else
|
||||
if (!vks::tools::fileExists(filename)) {
|
||||
vks::tools::exitFatal("Could not load texture from " + filename, "File not found");
|
||||
}
|
||||
gli::texture_cube texCube(gli::load(filename));
|
||||
#endif
|
||||
assert(!texCube.empty());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue