-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelLoader.cpp
More file actions
40 lines (30 loc) · 1.04 KB
/
Copy pathModelLoader.cpp
File metadata and controls
40 lines (30 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// Created by tztz8 on 9/26/22.
//
#include "ModelLoader.h"
#include "OpenGLHelperMethods.h"
void firstPass(SimpleModel *pModel, std::ifstream *ifstream);
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
#include <spdlog/spdlog.h>
#include <fstream>
SimpleModel* readOBJ(std::filesystem::path filename) {
SPDLOG_INFO(spdlog::fmt_lib::format("readOBJ: Start load of filepath \"{}\"", filename.string()));
SimpleModel *model;
// Open File
std::ifstream modelFile(filename);
// is the file available and open
if (!modelFile.is_open()) {
SPDLOG_ERROR(spdlog::fmt_lib::format("readOBJ: Unable to open filepath \"{}\"", filename.string()));
modelFile.close();
return nullptr;
}
// is the file empty
if (!modelFile.good()) {
SPDLOG_ERROR(spdlog::fmt_lib::format("readOBJ: model file is empty: {}",
filename.filename().string()));
return nullptr;
}
return nullptr;
}
void firstPass(SimpleModel *pModel, std::ifstream *ifstream) {
}