Skip to content
Snippets Groups Projects
Commit 74d2d2e9 authored by Jonathan Kunstwald's avatar Jonathan Kunstwald
Browse files

Reintroduce file check in instance load method

parent 90c87333
Branches
No related tags found
No related merge requests found
......@@ -24,6 +24,17 @@ glow::assimp::Importer::Importer() {}
glow::SharedVertexArray glow::assimp::Importer::load(const std::string& filename)
{
GLOW_ACTION();
using namespace assimp;
if (!std::ifstream(filename).good())
{
error() << "Error loading `" << filename << "' with Assimp.";
error() << " File not found/not readable";
return nullptr;
}
uint32_t flags = aiProcess_SortByPType;
if (mTriangulate)
......
......@@ -156,7 +156,8 @@ public:
/// Each attribute gets their own buffer.
static SharedVertexArray LoadAndCreateMesh(std::string const& filename, uint32_t flags = importDefaultFlags);
/// Creates a VA from MeshData, requires OGL context and initialized GLOW on the same thread
/// Creates a VA from MeshData
/// Requires OGL context and initialized GLOW on the same thread
static SharedVertexArray CreateMeshFromData(const MeshData& data);
/// Loads MeshData from a given filename with the given importer flags
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment