| 32 | } |
| 33 | |
| 34 | IDataStream* OpenGLDataManager::getData(const std::string& _name) const |
| 35 | { |
| 36 | std::string filepath = getDataPath(_name); |
| 37 | if (filepath.empty()) |
| 38 | return nullptr; |
| 39 | |
| 40 | auto stream = std::make_unique<std::ifstream>(); |
| 41 | stream->open(filepath.c_str(), std::ios_base::binary); |
| 42 | |
| 43 | if (!stream->is_open()) |
| 44 | return nullptr; |
| 45 | |
| 46 | DataFileStream* data = new DataFileStream(std::move(stream)); |
| 47 | |
| 48 | return data; |
| 49 | } |
| 50 | |
| 51 | void OpenGLDataManager::freeData(IDataStream* _data) |
| 52 | { |