//=========================================================== // // Retrieves a correct file parser and uses it to load a // model. // // Parameters: // const char* path: Path to model file. // // Returns: // Model pointer or nullptr // //=========================================================== Model* LoadModel(const char* path) { Model* model; FileParser* parser = GetFileParser(path); if(!parser) return nullptr; model = parser->Parse(path); int error = parser->GetError(); if(error != 0) { DebugPrint("Could not load model... Error code: %d\n", error); } delete parser; return model; }